diff --git a/src/main/java/de/jottyfan/quickiemod/Quickiemod.java b/src/main/java/de/jottyfan/quickiemod/Quickiemod.java index 08ef398..fabe44f 100644 --- a/src/main/java/de/jottyfan/quickiemod/Quickiemod.java +++ b/src/main/java/de/jottyfan/quickiemod/Quickiemod.java @@ -13,6 +13,7 @@ import de.jottyfan.quickiemod.item.ModItems; import de.jottyfan.quickiemod.itemgroup.ModItemGroup; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; +import net.fabricmc.fabric.api.registry.CompostingChanceRegistry; import net.minecraft.block.Block; import net.minecraft.item.Item; @@ -25,12 +26,20 @@ public class Quickiemod implements ModInitializer { public static final String MOD_ID = "quickiemod"; public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID); + private void registerComposterItems() { + CompostingChanceRegistry.INSTANCE.add(ModItems.ITEM_COTTONSEED, 0.5f); + CompostingChanceRegistry.INSTANCE.add(ModItems.ITEM_COTTON, 0.75f); + CompostingChanceRegistry.INSTANCE.add(ModItems.ITEM_CANOLASEED, 0.5f); + CompostingChanceRegistry.INSTANCE.add(ModItems.ITEM_CANOLA, 0.75f); + } + @Override public void onInitialize() { ModBlockentity.registerModBlockentities(); List items = ModItems.registerModItems(); List blocks = ModBlocks.registerModBlocks(); ModFeatures.registerFeatures(); + registerComposterItems(); ModItemGroup.registerItemGroup(items, blocks); PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, blockEntity) -> { diff --git a/src/main/java/de/jottyfan/quickiemod/QuickiemodClient.java b/src/main/java/de/jottyfan/quickiemod/QuickiemodClient.java index 3a28ec5..6ceb67f 100644 --- a/src/main/java/de/jottyfan/quickiemod/QuickiemodClient.java +++ b/src/main/java/de/jottyfan/quickiemod/QuickiemodClient.java @@ -1,6 +1,9 @@ package de.jottyfan.quickiemod; +import de.jottyfan.quickiemod.block.ModBlocks; import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; +import net.minecraft.client.render.RenderLayer; /** * @@ -11,6 +14,7 @@ public class QuickiemodClient implements ClientModInitializer { @Override public void onInitializeClient() { - + BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.BLOCK_COTTONPLANT, RenderLayer.getCutout()); + BlockRenderLayerMap.INSTANCE.putBlock(ModBlocks.BLOCK_CANOLAPLANT, RenderLayer.getCutout()); } } diff --git a/src/main/java/de/jottyfan/quickiemod/block/BlockPlant.java b/src/main/java/de/jottyfan/quickiemod/block/BlockPlant.java new file mode 100644 index 0000000..f662662 --- /dev/null +++ b/src/main/java/de/jottyfan/quickiemod/block/BlockPlant.java @@ -0,0 +1,79 @@ +package de.jottyfan.quickiemod.block; + +import java.util.List; +import java.util.Random; + +import net.minecraft.block.AbstractBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.CropBlock; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemConvertible; +import net.minecraft.item.ItemStack; +import net.minecraft.loot.context.LootWorldContext.Builder; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Identifier; +import net.minecraft.util.ItemScatterer; +import net.minecraft.util.collection.DefaultedList; +import net.minecraft.util.hit.BlockHitResult; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * + * @author jotty + * + */ +public class BlockPlant extends CropBlock { + + private Item seed; + private Item fruit; + + public BlockPlant(Identifier identifier, Item seed, Item fruit) { + super(AbstractBlock.Settings.copy(Blocks.WHEAT).registryKey(RegistryKey.of(RegistryKeys.BLOCK, identifier))); + this.seed = seed; + this.fruit = fruit; + } + + @Override + public List getDroppedStacks(BlockState state, Builder builder) { + DefaultedList list = DefaultedList.of(); + list.add(new ItemStack(getSeedsItem())); // the one from the seed + if (isMature(state)) { + list.add(new ItemStack(getSeedsItem(), new Random().nextInt(2))); + list.add(new ItemStack(fruit, new Random().nextFloat() > 0.9f ? 2 : 1)); + } + return list; + } + + private void spawnHarvested(World world, BlockPos pos, BlockState state) { + DefaultedList list = DefaultedList.of(); + getDroppedStacks(state, null).forEach(itemStack -> { + list.add(itemStack); + }); + ItemScatterer.spawn(world, pos, list); + } + + @Override + public BlockState onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) { + spawnHarvested(world, pos, state); + return super.onBreak(world, pos, state, player); + } + + @Override + protected ItemConvertible getSeedsItem() { + return seed; + } + + @Override + protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + if (!world.isClient && isMature(state)) { + spawnHarvested(world, pos, state); + world.setBlockState(pos, state.with(AGE, 0)); + } + return ActionResult.PASS; + } +} diff --git a/src/main/java/de/jottyfan/quickiemod/block/ModBlocks.java b/src/main/java/de/jottyfan/quickiemod/block/ModBlocks.java index 8124151..e2974b6 100644 --- a/src/main/java/de/jottyfan/quickiemod/block/ModBlocks.java +++ b/src/main/java/de/jottyfan/quickiemod/block/ModBlocks.java @@ -56,10 +56,20 @@ public class ModBlocks { new BlockSandSalpeter(ModIdentifiers.BLOCK_SANDSALPETER)); public static final Block BLOCK_KELPSTACK = registerBlock(ModIdentifiers.BLOCK_KELPSTACK, new BlockSlippery(ModIdentifiers.BLOCK_KELPSTACK, 0.1f, 1.0f, BlockSoundGroup.WET_GRASS)); + public static final Block BLOCK_COTTONPLANT = registerBlock(ModIdentifiers.BLOCK_COTTONPLANT, + new BlockPlant(ModIdentifiers.BLOCK_COTTONPLANT, ModItems.ITEM_COTTONSEED, ModItems.ITEM_COTTON), false); + public static final Block BLOCK_CANOLAPLANT = registerBlock(ModIdentifiers.BLOCK_CANOLAPLANT, + new BlockPlant(ModIdentifiers.BLOCK_CANOLAPLANT, ModItems.ITEM_CANOLASEED, ModItems.ITEM_CANOLA), false); private static final Block registerBlock(Identifier identifier, Block block) { - Registry.register(Registries.ITEM, identifier, new BlockItem(block, new Item.Settings() - .registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)).useBlockPrefixedTranslationKey())); + return registerBlock(identifier, block, true); + } + + private static final Block registerBlock(Identifier identifier, Block block, boolean registerAsItem) { + if (registerAsItem) { + Registry.register(Registries.ITEM, identifier, new BlockItem(block, new Item.Settings() + .registryKey(RegistryKey.of(RegistryKeys.ITEM, identifier)).useBlockPrefixedTranslationKey())); + } return Registry.register(Registries.BLOCK, identifier, block); } diff --git a/src/main/java/de/jottyfan/quickiemod/identifier/ModIdentifiers.java b/src/main/java/de/jottyfan/quickiemod/identifier/ModIdentifiers.java index 177e7d1..fae89bd 100644 --- a/src/main/java/de/jottyfan/quickiemod/identifier/ModIdentifiers.java +++ b/src/main/java/de/jottyfan/quickiemod/identifier/ModIdentifiers.java @@ -19,6 +19,14 @@ public class ModIdentifiers { public static final Identifier ITEM_QUICKIEINGOT = Identifier.of(Quickiemod.MOD_ID, "quickieingot"); public static final Identifier ITEM_CARROTSTACK = Identifier.of(Quickiemod.MOD_ID, "carrotstack"); public static final Identifier ITEM_ROTTENFLESHSTRIPES = Identifier.of(Quickiemod.MOD_ID, "rotten_flesh_stripes"); + public static final Identifier ITEM_COTTON = Identifier.of(Quickiemod.MOD_ID, "cotton"); + public static final Identifier ITEM_COTTONPLANT = Identifier.of(Quickiemod.MOD_ID, "cottonplant"); + public static final Identifier ITEM_COTTONSEED = Identifier.of(Quickiemod.MOD_ID, "cottonseed"); + public static final Identifier ITEM_CANOLA = Identifier.of(Quickiemod.MOD_ID, "canola"); + public static final Identifier ITEM_CANOLAPLANT = Identifier.of(Quickiemod.MOD_ID, "canolaplant"); + public static final Identifier ITEM_CANOLASEED = Identifier.of(Quickiemod.MOD_ID, "canolaseed"); + public static final Identifier ITEM_CANOLABOTTLE = Identifier.of(Quickiemod.MOD_ID, "canolabottle"); + public static final Identifier ITEM_CANOLABOTTLESTACK = Identifier.of(Quickiemod.MOD_ID, "canolabottlestack"); public static final Identifier TOOL_SPEEDPOWDERAXE = Identifier.of(Quickiemod.MOD_ID, "speedpowderaxe"); public static final Identifier TOOL_SPEEDPOWDERHOE = Identifier.of(Quickiemod.MOD_ID, "speedpowderhoe"); @@ -48,6 +56,8 @@ public class ModIdentifiers { public static final Identifier BLOCK_ORESULFOR = Identifier.of(Quickiemod.MOD_ID, "oresulphor"); public static final Identifier BLOCK_SANDSALPETER = Identifier.of(Quickiemod.MOD_ID, "sandsalpeter"); public static final Identifier BLOCK_KELPSTACK = Identifier.of(Quickiemod.MOD_ID, "kelpstack"); + public static final Identifier BLOCK_COTTONPLANT = Identifier.of(Quickiemod.MOD_ID, "blockcottonplant"); + public static final Identifier BLOCK_CANOLAPLANT = Identifier.of(Quickiemod.MOD_ID, "blockcanolaplant"); public static final Identifier BLOCKENTITY_ITEMHOARDER = Identifier.of(Quickiemod.MOD_ID, "itemhoarderblockentity"); public static final Identifier BLOCKENTITY_BLOCKSTACKER = Identifier.of(Quickiemod.MOD_ID, "blockstackerblockentity"); diff --git a/src/main/java/de/jottyfan/quickiemod/item/ItemSeed.java b/src/main/java/de/jottyfan/quickiemod/item/ItemSeed.java new file mode 100644 index 0000000..e79bfdf --- /dev/null +++ b/src/main/java/de/jottyfan/quickiemod/item/ItemSeed.java @@ -0,0 +1,45 @@ +package de.jottyfan.quickiemod.item; + +import de.jottyfan.quickiemod.Quickiemod; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.item.ItemUsageContext; +import net.minecraft.registry.Registries; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +/** + * + * @author jotty + * + */ +public class ItemSeed extends Item64Stack { + + private Identifier plant; + + public ItemSeed(Identifier identifier, Identifier plant) { + super(identifier); + this.plant = plant; + } + + @Override + public ActionResult useOnBlock(ItemUsageContext context) { + BlockPos pos = context.getBlockPos(); + World world = context.getWorld(); + if (this.asItem().equals(context.getStack().getItem())) { + BlockState state = world.getBlockState(pos); + if (Registries.BLOCK.containsId(plant)) { + if (Blocks.FARMLAND.equals(state.getBlock()) && world.getBlockState(pos.up()).isAir()) { + world.setBlockState(pos.up(), Registries.BLOCK.get(plant).getDefaultState()); + context.getStack().decrement(1); + } else { + Quickiemod.LOGGER.error("could not find block {} in Registries...", plant.toShortTranslationKey()); + } + } + } + return super.useOnBlock(context); + } + +} diff --git a/src/main/java/de/jottyfan/quickiemod/item/ModItems.java b/src/main/java/de/jottyfan/quickiemod/item/ModItems.java index 197ca6e..e3626ee 100644 --- a/src/main/java/de/jottyfan/quickiemod/item/ModItems.java +++ b/src/main/java/de/jottyfan/quickiemod/item/ModItems.java @@ -16,28 +16,65 @@ import net.minecraft.util.Identifier; * */ public class ModItems { - public static final Item ITEM_STUB = registerItem(ModIdentifiers.ITEM_STUB, new Item64Stack(ModIdentifiers.ITEM_STUB)); - public static final Item ITEM_SPEEDPOWDER = registerItem(ModIdentifiers.ITEM_SPEEDPOWDER, new Item64Stack(ModIdentifiers.ITEM_SPEEDPOWDER)); - public static final Item ITEM_QUICKIEPOWDER = registerItem(ModIdentifiers.ITEM_QUICKIEPOWDER, new Item64Stack(ModIdentifiers.ITEM_QUICKIEPOWDER)); - public static final Item ITEM_SALPETER = registerItem(ModIdentifiers.ITEM_SALPETER, new Item64Stack(ModIdentifiers.ITEM_SALPETER)); - public static final Item ITEM_SULFOR = registerItem(ModIdentifiers.ITEM_SULFOR, new Item64Stack(ModIdentifiers.ITEM_SULFOR)); - public static final Item ITEM_OXIDIZEDCOPPERPOWDER = registerItem(ModIdentifiers.ITEM_OXIDIZEDCOPPERPOWDER, new Item64Stack(ModIdentifiers.ITEM_OXIDIZEDCOPPERPOWDER)); - public static final Item ITEM_SPEEDINGOT = registerItem(ModIdentifiers.ITEM_SPEEDINGOT, new Item64Stack(ModIdentifiers.ITEM_SPEEDINGOT)); - public static final Item ITEM_QUICKIEINGOT = registerItem(ModIdentifiers.ITEM_QUICKIEINGOT, new Item64Stack(ModIdentifiers.ITEM_QUICKIEINGOT)); - public static final Item ITEM_CARROTSTACK = registerItem(ModIdentifiers.ITEM_CARROTSTACK, new Item64Stack(ModIdentifiers.ITEM_CARROTSTACK)); - public static final Item ITEM_ROTTENFLESHSTRIPES = registerItem(ModIdentifiers.ITEM_ROTTENFLESHSTRIPES, new Item64Stack(ModIdentifiers.ITEM_ROTTENFLESHSTRIPES)); + public static final Item ITEM_STUB = registerItem(ModIdentifiers.ITEM_STUB, + new Item64Stack(ModIdentifiers.ITEM_STUB)); + public static final Item ITEM_SPEEDPOWDER = registerItem(ModIdentifiers.ITEM_SPEEDPOWDER, + new Item64Stack(ModIdentifiers.ITEM_SPEEDPOWDER)); + public static final Item ITEM_QUICKIEPOWDER = registerItem(ModIdentifiers.ITEM_QUICKIEPOWDER, + new Item64Stack(ModIdentifiers.ITEM_QUICKIEPOWDER)); + public static final Item ITEM_SALPETER = registerItem(ModIdentifiers.ITEM_SALPETER, + new Item64Stack(ModIdentifiers.ITEM_SALPETER)); + public static final Item ITEM_SULFOR = registerItem(ModIdentifiers.ITEM_SULFOR, + new Item64Stack(ModIdentifiers.ITEM_SULFOR)); + public static final Item ITEM_OXIDIZEDCOPPERPOWDER = registerItem(ModIdentifiers.ITEM_OXIDIZEDCOPPERPOWDER, + new Item64Stack(ModIdentifiers.ITEM_OXIDIZEDCOPPERPOWDER)); + public static final Item ITEM_SPEEDINGOT = registerItem(ModIdentifiers.ITEM_SPEEDINGOT, + new Item64Stack(ModIdentifiers.ITEM_SPEEDINGOT)); + public static final Item ITEM_QUICKIEINGOT = registerItem(ModIdentifiers.ITEM_QUICKIEINGOT, + new Item64Stack(ModIdentifiers.ITEM_QUICKIEINGOT)); + public static final Item ITEM_CARROTSTACK = registerItem(ModIdentifiers.ITEM_CARROTSTACK, + new Item64Stack(ModIdentifiers.ITEM_CARROTSTACK)); + public static final Item ITEM_ROTTENFLESHSTRIPES = registerItem(ModIdentifiers.ITEM_ROTTENFLESHSTRIPES, + new Item64Stack(ModIdentifiers.ITEM_ROTTENFLESHSTRIPES)); + public static final Item ITEM_COTTON = registerItem(ModIdentifiers.ITEM_COTTON, + new Item64Stack(ModIdentifiers.ITEM_COTTON)); + public static final Item ITEM_COTTONPLANT = registerItem(ModIdentifiers.ITEM_COTTONPLANT, + new Item64Stack(ModIdentifiers.BLOCK_COTTONPLANT)); + public static final Item ITEM_COTTONSEED = registerItem(ModIdentifiers.ITEM_COTTONSEED, + new ItemSeed(ModIdentifiers.ITEM_COTTONSEED, ModIdentifiers.BLOCK_COTTONPLANT)); + public static final Item ITEM_CANOLA = registerItem(ModIdentifiers.ITEM_CANOLA, + new Item64Stack(ModIdentifiers.ITEM_CANOLA)); + public static final Item ITEM_CANOLAPLANT = registerItem(ModIdentifiers.ITEM_CANOLAPLANT, + new Item64Stack(ModIdentifiers.BLOCK_CANOLAPLANT)); + public static final Item ITEM_CANOLASEED = registerItem(ModIdentifiers.ITEM_CANOLASEED, + new ItemSeed(ModIdentifiers.ITEM_CANOLASEED, ModIdentifiers.BLOCK_CANOLAPLANT)); + public static final Item ITEM_CANOLABOTTLE = registerItem(ModIdentifiers.ITEM_CANOLABOTTLE, + new Item64Stack(ModIdentifiers.ITEM_CANOLABOTTLE)); + public static final Item ITEM_CANOLABOTTLESTACK = registerItem(ModIdentifiers.ITEM_CANOLABOTTLESTACK, + new Item64Stack(ModIdentifiers.ITEM_CANOLABOTTLESTACK)); - public static final Item TOOL_SPEEDPOWDERAXE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERAXE, new ToolSpeedpowderAxe(ModIdentifiers.TOOL_SPEEDPOWDERAXE)); - public static final Item TOOL_SPEEDPOWDERHOE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERHOE, new ToolSpeedpowderHoe(ModIdentifiers.TOOL_SPEEDPOWDERHOE)); - public static final Item TOOL_SPEEDPOWDERPICKAXE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERPICKAXE, new ToolSpeedpowderPickaxe(ModIdentifiers.TOOL_SPEEDPOWDERPICKAXE)); - public static final Item TOOL_SPEEDPOWDERSHEARS = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERSHEARS, new ToolSpeedpowderShears(ModIdentifiers.TOOL_SPEEDPOWDERSHEARS)); - public static final Item TOOL_SPEEDPOWDERSHOVEL = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERSHOVEL, new ToolSpeedpowderShovel(ModIdentifiers.TOOL_SPEEDPOWDERSHOVEL)); - public static final Item TOOL_SPEEDPOWDERWATERHOE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERWATERHOE, new ToolSpeedpowderWaterHoe(ModIdentifiers.TOOL_SPEEDPOWDERWATERHOE)); - public static final Item TOOL_QUICKIEPOWDERAXE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERAXE, new ToolQuickiepowderAxe(ModIdentifiers.TOOL_QUICKIEPOWDERAXE)); - public static final Item TOOL_QUICKIEPOWDERHOE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERHOE, new ToolQuickiepowderHoe(ModIdentifiers.TOOL_QUICKIEPOWDERHOE)); - public static final Item TOOL_QUICKIEPOWDERPICKAXE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERPICKAXE, new ToolQuickiepowderPickaxe(ModIdentifiers.TOOL_QUICKIEPOWDERPICKAXE)); - public static final Item TOOL_QUICKIEPOWDERSHOVEL = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERSHOVEL, new ToolQuickiepowderShovel(ModIdentifiers.TOOL_QUICKIEPOWDERSHOVEL)); - public static final Item TOOL_QUICKIEPOWDERWATERHOE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE, new ToolQuickiepowderWaterHoe(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE)); + public static final Item TOOL_SPEEDPOWDERAXE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERAXE, + new ToolSpeedpowderAxe(ModIdentifiers.TOOL_SPEEDPOWDERAXE)); + public static final Item TOOL_SPEEDPOWDERHOE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERHOE, + new ToolSpeedpowderHoe(ModIdentifiers.TOOL_SPEEDPOWDERHOE)); + public static final Item TOOL_SPEEDPOWDERPICKAXE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERPICKAXE, + new ToolSpeedpowderPickaxe(ModIdentifiers.TOOL_SPEEDPOWDERPICKAXE)); + public static final Item TOOL_SPEEDPOWDERSHEARS = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERSHEARS, + new ToolSpeedpowderShears(ModIdentifiers.TOOL_SPEEDPOWDERSHEARS)); + public static final Item TOOL_SPEEDPOWDERSHOVEL = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERSHOVEL, + new ToolSpeedpowderShovel(ModIdentifiers.TOOL_SPEEDPOWDERSHOVEL)); + public static final Item TOOL_SPEEDPOWDERWATERHOE = registerItem(ModIdentifiers.TOOL_SPEEDPOWDERWATERHOE, + new ToolSpeedpowderWaterHoe(ModIdentifiers.TOOL_SPEEDPOWDERWATERHOE)); + public static final Item TOOL_QUICKIEPOWDERAXE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERAXE, + new ToolQuickiepowderAxe(ModIdentifiers.TOOL_QUICKIEPOWDERAXE)); + public static final Item TOOL_QUICKIEPOWDERHOE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERHOE, + new ToolQuickiepowderHoe(ModIdentifiers.TOOL_QUICKIEPOWDERHOE)); + public static final Item TOOL_QUICKIEPOWDERPICKAXE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERPICKAXE, + new ToolQuickiepowderPickaxe(ModIdentifiers.TOOL_QUICKIEPOWDERPICKAXE)); + public static final Item TOOL_QUICKIEPOWDERSHOVEL = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERSHOVEL, + new ToolQuickiepowderShovel(ModIdentifiers.TOOL_QUICKIEPOWDERSHOVEL)); + public static final Item TOOL_QUICKIEPOWDERWATERHOE = registerItem(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE, + new ToolQuickiepowderWaterHoe(ModIdentifiers.TOOL_QUICKIEPOWDERWATERHOE)); private static final Item registerItem(Identifier identifier, Item item) { return Registry.register(Registries.ITEM, identifier, item); @@ -57,6 +94,12 @@ public class ModItems { items.add(ITEM_QUICKIEINGOT); items.add(ITEM_CARROTSTACK); items.add(ITEM_ROTTENFLESHSTRIPES); + items.add(ITEM_COTTON); + items.add(ITEM_COTTONSEED); + items.add(ITEM_CANOLA); + items.add(ITEM_CANOLASEED); + items.add(ITEM_CANOLABOTTLE); + items.add(ITEM_CANOLABOTTLESTACK); items.add(TOOL_SPEEDPOWDERPICKAXE); items.add(TOOL_SPEEDPOWDERAXE); diff --git a/src/main/resources/assets/quickiemod/blockstates/blockcanolaplant.json b/src/main/resources/assets/quickiemod/blockstates/blockcanolaplant.json new file mode 100644 index 0000000..987b3c0 --- /dev/null +++ b/src/main/resources/assets/quickiemod/blockstates/blockcanolaplant.json @@ -0,0 +1,12 @@ +{ + "variants": { + "age=0": { "model": "quickiemod:block/canolaplant0" }, + "age=1": { "model": "quickiemod:block/canolaplant1" }, + "age=2": { "model": "quickiemod:block/canolaplant2" }, + "age=3": { "model": "quickiemod:block/canolaplant3" }, + "age=4": { "model": "quickiemod:block/canolaplant4" }, + "age=5": { "model": "quickiemod:block/canolaplant5" }, + "age=6": { "model": "quickiemod:block/canolaplant6" }, + "age=7": { "model": "quickiemod:block/canolaplant7" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/blockstates/blockcottonplant.json b/src/main/resources/assets/quickiemod/blockstates/blockcottonplant.json new file mode 100644 index 0000000..38dfbac --- /dev/null +++ b/src/main/resources/assets/quickiemod/blockstates/blockcottonplant.json @@ -0,0 +1,12 @@ +{ + "variants": { + "age=0": { "model": "quickiemod:block/cottonplant0" }, + "age=1": { "model": "quickiemod:block/cottonplant1" }, + "age=2": { "model": "quickiemod:block/cottonplant2" }, + "age=3": { "model": "quickiemod:block/cottonplant3" }, + "age=4": { "model": "quickiemod:block/cottonplant4" }, + "age=5": { "model": "quickiemod:block/cottonplant5" }, + "age=6": { "model": "quickiemod:block/cottonplant6" }, + "age=7": { "model": "quickiemod:block/cottonplant7" } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/lang/de_de.json b/src/main/resources/assets/quickiemod/lang/de_de.json index b72f024..e211fb9 100644 --- a/src/main/resources/assets/quickiemod/lang/de_de.json +++ b/src/main/resources/assets/quickiemod/lang/de_de.json @@ -69,8 +69,8 @@ "block.quickiemod.itemhoarder": "Itemsauger", "block.quickiemod.monsterhoarder": "Monstersauger", "block.quickiemod.kelpstack": "Seegrassbündel", - "block.quickiemod.cottonplant": "Baumwollpflanze", - "block.quickiemod.canolaplant": "Canolapflanze", + "block.quickiemod.blockcottonplant": "Baumwollpflanze", + "block.quickiemod.blockcanolaplant": "Canolapflanze", "block.quickiemod.blocksulphor": "Schwefelblock", "block.quickiemod.blocksalpeter": "Salpeterblock", "block.quickiemod.blockspeedpowder": "Fluchtpulverblock", diff --git a/src/main/resources/assets/quickiemod/lang/en_us.json b/src/main/resources/assets/quickiemod/lang/en_us.json index 9bac343..a5b3ef0 100644 --- a/src/main/resources/assets/quickiemod/lang/en_us.json +++ b/src/main/resources/assets/quickiemod/lang/en_us.json @@ -69,8 +69,8 @@ "block.quickiemod.itemhoarder": "item hoarder", "block.quickiemod.monsterhoarder": "monster hoarder", "block.quickiemod.kelpstack": "kelp bundle", - "block.quickiemod.cottonplant": "cotton plant", - "block.quickiemod.canolaplant": "canola plant", + "block.quickiemod.blockcottonplant": "cotton plant", + "block.quickiemod.blockcanolaplant": "canola plant", "block.quickiemod.blocksulphor": "block of sulfur", "block.quickiemod.blocksalpeter": "block of salpeter", "block.quickiemod.blockspeedpowder": "block of speedpowder", diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant0.json b/src/main/resources/assets/quickiemod/models/block/canolaplant0.json new file mode 100644 index 0000000..87814f8 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant0.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant1.json b/src/main/resources/assets/quickiemod/models/block/canolaplant1.json new file mode 100644 index 0000000..e68dadc --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant1.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant2.json b/src/main/resources/assets/quickiemod/models/block/canolaplant2.json new file mode 100644 index 0000000..2f5ee99 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant2.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant3.json b/src/main/resources/assets/quickiemod/models/block/canolaplant3.json new file mode 100644 index 0000000..9ffb888 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant3.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant4.json b/src/main/resources/assets/quickiemod/models/block/canolaplant4.json new file mode 100644 index 0000000..345cd3a --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant4.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant5.json b/src/main/resources/assets/quickiemod/models/block/canolaplant5.json new file mode 100644 index 0000000..cfcb6f8 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant5.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant6.json b/src/main/resources/assets/quickiemod/models/block/canolaplant6.json new file mode 100644 index 0000000..b07ce06 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant6.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/canolaplant7.json b/src/main/resources/assets/quickiemod/models/block/canolaplant7.json new file mode 100644 index 0000000..916aea4 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/canolaplant7.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/canolaplant7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant0.json b/src/main/resources/assets/quickiemod/models/block/cottonplant0.json new file mode 100644 index 0000000..dbf487d --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant0.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant0" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant1.json b/src/main/resources/assets/quickiemod/models/block/cottonplant1.json new file mode 100644 index 0000000..dc809b5 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant1.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant1" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant2.json b/src/main/resources/assets/quickiemod/models/block/cottonplant2.json new file mode 100644 index 0000000..5af3fba --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant2.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant2" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant3.json b/src/main/resources/assets/quickiemod/models/block/cottonplant3.json new file mode 100644 index 0000000..8b1f69d --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant3.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant3" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant4.json b/src/main/resources/assets/quickiemod/models/block/cottonplant4.json new file mode 100644 index 0000000..a733dbc --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant4.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant4" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant5.json b/src/main/resources/assets/quickiemod/models/block/cottonplant5.json new file mode 100644 index 0000000..6b195fc --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant5.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant5" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant6.json b/src/main/resources/assets/quickiemod/models/block/cottonplant6.json new file mode 100644 index 0000000..18ed782 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant6.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant6" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/block/cottonplant7.json b/src/main/resources/assets/quickiemod/models/block/cottonplant7.json new file mode 100644 index 0000000..8b17f77 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/block/cottonplant7.json @@ -0,0 +1,6 @@ +{ + "parent":"block/cross", + "textures":{ + "cross":"quickiemod:block/cottonplant7" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/canola.json b/src/main/resources/assets/quickiemod/models/item/canola.json new file mode 100644 index 0000000..92a204d --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/canola.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/canola" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/canolabottle.json b/src/main/resources/assets/quickiemod/models/item/canolabottle.json new file mode 100644 index 0000000..3091d87 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/canolabottle.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/canolabottle" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/canolabottlestack.json b/src/main/resources/assets/quickiemod/models/item/canolabottlestack.json new file mode 100644 index 0000000..47b93ab --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/canolabottlestack.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/canolabottlestack" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/canolaplant.json b/src/main/resources/assets/quickiemod/models/item/canolaplant.json new file mode 100644 index 0000000..91ee0b6 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/canolaplant.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/canolaseed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/canolaseed.json b/src/main/resources/assets/quickiemod/models/item/canolaseed.json new file mode 100644 index 0000000..91ee0b6 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/canolaseed.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/canolaseed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/cotton.json b/src/main/resources/assets/quickiemod/models/item/cotton.json new file mode 100644 index 0000000..e9c043a --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/cotton.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/cotton" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/cottonplant.json b/src/main/resources/assets/quickiemod/models/item/cottonplant.json new file mode 100644 index 0000000..7410b36 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/cottonplant.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/cottonseed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/models/item/cottonseed.json b/src/main/resources/assets/quickiemod/models/item/cottonseed.json new file mode 100644 index 0000000..7410b36 --- /dev/null +++ b/src/main/resources/assets/quickiemod/models/item/cottonseed.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "quickiemod:item/cottonseed" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/quickiemod/textures/block/cottonplant3.png b/src/main/resources/assets/quickiemod/textures/block/cottonplant3.png index d19a189..6ce03a4 100644 Binary files a/src/main/resources/assets/quickiemod/textures/block/cottonplant3.png and b/src/main/resources/assets/quickiemod/textures/block/cottonplant3.png differ diff --git a/src/main/resources/assets/quickiemod/textures/block/cottonplant4.png b/src/main/resources/assets/quickiemod/textures/block/cottonplant4.png index 4cd6a05..81cd078 100644 Binary files a/src/main/resources/assets/quickiemod/textures/block/cottonplant4.png and b/src/main/resources/assets/quickiemod/textures/block/cottonplant4.png differ diff --git a/src/main/resources/assets/quickiemod/textures/block/cottonplant5.png b/src/main/resources/assets/quickiemod/textures/block/cottonplant5.png index b50f8d1..677923b 100644 Binary files a/src/main/resources/assets/quickiemod/textures/block/cottonplant5.png and b/src/main/resources/assets/quickiemod/textures/block/cottonplant5.png differ diff --git a/src/main/resources/assets/quickiemod/textures/block/cottonplant6.png b/src/main/resources/assets/quickiemod/textures/block/cottonplant6.png index 9ed2608..c8cacf4 100644 Binary files a/src/main/resources/assets/quickiemod/textures/block/cottonplant6.png and b/src/main/resources/assets/quickiemod/textures/block/cottonplant6.png differ diff --git a/src/main/resources/data/quickiemod/loot_table/chests/seeds_in_chest.json b/src/main/resources/data/quickiemod/loot_table/chests/seeds_in_chest.json new file mode 100644 index 0000000..1772dfe --- /dev/null +++ b/src/main/resources/data/quickiemod/loot_table/chests/seeds_in_chest.json @@ -0,0 +1,40 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 9.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + } + ], + "name": "quickiemod:canolaseed" + }, + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 9.0, + "min": 1.0 + }, + "function": "minecraft:set_count" + } + ], + "name": "quickiemod:cottonseed" + } + ] + } + ] +} diff --git a/src/main/resources/data/quickiemod/recipe/shaped_canolabottlestack.json b/src/main/resources/data/quickiemod/recipe/shaped_canolabottlestack.json new file mode 100644 index 0000000..2b01214 --- /dev/null +++ b/src/main/resources/data/quickiemod/recipe/shaped_canolabottlestack.json @@ -0,0 +1,15 @@ +{ + "type": "crafting_shaped", + "pattern": [ + "ccc", + "ccc", + "ccc" + ], + "key": { + "c":"quickiemod:canolabottle" + }, + "result": { + "id": "quickiemod:canolabottlestack", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/quickiemod/recipe/shaped_string_from_cotton.json b/src/main/resources/data/quickiemod/recipe/shaped_string_from_cotton.json new file mode 100644 index 0000000..6038fe9 --- /dev/null +++ b/src/main/resources/data/quickiemod/recipe/shaped_string_from_cotton.json @@ -0,0 +1,15 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + "c", + "c", + "c" + ], + "key": { + "c": "quickiemod:cotton" + }, + "result": { + "id": "minecraft:string", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle.json b/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle.json new file mode 100644 index 0000000..88f8760 --- /dev/null +++ b/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle.json @@ -0,0 +1,11 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + "minecraft:glass_bottle", + "quickiemod:canola" + ], + "result": { + "id": "quickiemod:canolabottle", + "count": 1 + } +} \ No newline at end of file diff --git a/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle_from_stack.json b/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle_from_stack.json new file mode 100644 index 0000000..b8b8a59 --- /dev/null +++ b/src/main/resources/data/quickiemod/recipe/shapeless_canolabottle_from_stack.json @@ -0,0 +1,10 @@ +{ + "type": "minecraft:crafting_shapeless", + "ingredients": [ + "quickiemod:canolabottlestack" + ], + "result": { + "id": "quickiemod:canolabottle", + "count": 9 + } +} \ No newline at end of file