From 3e8cce3279ced233f551500db883f050eed2a561 Mon Sep 17 00:00:00 2001 From: eerussianguy Date: Wed, 21 Aug 2024 19:40:39 -0400 Subject: [PATCH] fix the tumbler, more FG updates --- CHANGELOG.md | 7 +++++- resources/generate_book.py | 10 +++++--- resources/lang/en_us.json | 3 +++ .../CompostTumblerBlockEntityRenderer.java | 2 +- .../CompostTumblerBlockEntity.java | 16 ++++++++++--- .../common/blocks/CompostTumblerBlock.java | 11 --------- .../firmalife/common/blocks/FLBlocks.java | 2 +- .../entries/firmalife/oven_appliances.json | 13 ++++++++++ .../en_us/entries/firmalife/wine.json | 24 ++++++++++++------- .../entries/firmalife/wine_consumption.json | 2 +- 10 files changed, 61 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 55a38a28..b98b4e28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,7 @@ ### Changes -- Fix an issue where spawning of wild grapes was broken. \ No newline at end of file +- Fix an issue where bees tended to not despawn. +- Wrote two chapters for wine-related features in the field guide. +- Added info for the jarring station to the field guide. +- Allow crafting the pumping station with all bronze types. +- Fix some visual possible bugs with the compost tumbler. +- Added a config option to make the compost tumbler and pumping station trivially powerable via redstone. \ No newline at end of file diff --git a/resources/generate_book.py b/resources/generate_book.py index 486c03f7..4079346d 100644 --- a/resources/generate_book.py +++ b/resources/generate_book.py @@ -246,7 +246,11 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False, rev text('For example, the vat can be used to make $(thing)Olive Oil Water$() using a ratio of 1 Olive Paste to 200 mB Water. To use a vat, $(item)$(k:key.use)$() it with fluids and items to add them to the inventory. With an empty hand and $(item)$(k:key.sneak)$() held, click to seal and unseal the vat. A vat will not boil until it is sealed.'), text('Vats should be placed on the block above a $(thing)Bottom Oven$(). If the vat would overflow on completion of the recipe, it will not boil, so be sure not to overfill it -- especially with recipes that produce more fluid than they consume!'), two_tall_block_spotlight('', '', 'firmalife:cured_oven_bottom', 'firmalife:vat'), + crafting('firmalife:crafting/jarring_station', text_contents='The $(thing)Jarring Station$() is used to fill jars from the vat. The jarring station has a spout on one side that should point to the station.'), + text('Using the Vat, Sugar Water can be made by adding sweetener to water. Then, adding fruit causes $(thing)Fruity Fluid$() to be made. Putting a jar in the vat can then fill it. Be careful: trying to pipe or transport fruity fluid through too many transfers could ruin it!'), + text('With $(item)$(k:key.use)$(), add empty jars with lids to the jarring station. When it detects fruity fluid, it will automatically fill the jars with $(thing)Jam$() and seal them, requiring 500 mB of fruity fluid per jar.'), text('Pots and Grills from TFC can be placed on top of a $(thing)Bottom Oven$(). These devices will get heat automatically from the bottom oven. The pot is only able to be used for making soup. It cannot execute regular pot recipes.'), + empty_last_page() )), entry('bread', 'Bread', 'tfc:textures/item/food/barley_bread.png', pages=( text('To make $(thing)Bread$(), one first must get $(thing)Yeast$(). To get your first yeast, seal $(l:firmalife/drying)Dried Fruit$() in a Barrel of $(thing)Water$(). After three days, $(thing)Yeast Starter$() will form.$(br)From now on, your yeast can be fed by sealing Yeast Starter in a Barrel with $(thing)Flour$(). This causes it to multiply. 1 flour per 100mB of Yeast produces 600mB of Yeast. That\'s a good deal!'), @@ -305,8 +309,8 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False, rev crafting('firmalife:crafting/grape_trellis_post', text_contents='Grapes must be grown on trellises constructed from these special posts and jute fiber.'), text('To construct a trellis, place two posts on top of each other. Move two blocks to the left or right and repeat the action. Then, $(item)$(k:key.use)$() the side of one of the top and bottom posts with $(thing)Jute Fiber$() to string lines between the posts. Grape trellises can be chained horizontally to create rows of grapes.'), multimultiblock('A grape trellis.', - multiblock('', '', False, (('X0X'), ('XYX'),), {'X': 'firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]', '0': 'firmalife:grape_string_plant_red[axis=x,lifecycle=healthy,stage=0]', 'Y': 'firmalife:grape_string[axis=x]'}), - multiblock('', '', False, (('X0X'), ('ZYZ'),), {'X': 'firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]', '0': 'firmalife:grape_string_plant_red[axis=x,lifecycle=healthy,stage=2]', 'Y': 'firmalife:grape_string_red[axis=x,lifecycle=healthy]', 'Z': 'firmalife:grape_trellis_post_red[axis=x,lifecycle=healthy,string_plus=true,string_minus=true]'}), + multiblock('', '', False, (('XYX',), ('X0X',),), {'X': 'firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]', '0': 'firmalife:grape_string_plant_red[axis=z,lifecycle=healthy,stage=0]', 'Y': 'firmalife:grape_string[axis=z]'}), + multiblock('', '', False, (('ZYZ',),('X0X',),), {'X': 'firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]', '0': 'firmalife:grape_string_plant_red[axis=z,lifecycle=healthy,stage=2]', 'Y': 'firmalife:grape_string_red[axis=z,lifecycle=healthy]', 'Z': 'firmalife:grape_trellis_post_red[axis=x,lifecycle=healthy,string_plus=true,string_minus=true]'}), ), text('Provided the climate requirements are satisfied, the grape will grow up and over the trellis over the course of a few months. It will fruit in the month of July, flowering the month prior. Grapes can the be harvested. Grapes can also be grown in greenhouses on trellises.'), crafting('firmalife:crafting/wood/acacia_stomping_barrel', text_contents='The stomping barrel is used to smash grapes. A quern may also be used.'), @@ -322,7 +326,7 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False, rev text('Grapes can have three terrain related traits -- \'Gravel Grown\', \'Slope Grown\', and \'Dirt Grown\', based on the environment nearby. Wine also records the Koppen Climate Classification of the area in which it is bottled. Grapes grown near bees have the \'Bee Pollinated\' trait.'), text('Wine begins aging as soon as it is bottled, and stops aging when the cork is removed. The cork can be removed by $(item)$(k:key.use)$() on the bottle item with a knife item. Otherwise, wine bottles work a little like buckets, and can be emptied into barrels or other devices.'), crafting('firmalife:crafting/wood/pine_keg', text_contents='The $(thing)Keg$() is a 2x2x2 barrel block that can contain loads of items or fluids. Perfect for your vinery!'), - crafting('firamlife:crafting/wood/hickory_wine_shelf', text_contents='The $(thing)Wine Shelf$() is the perfect accessory for your vinery, allowing you to display and store your wine bottles in style.'), + crafting('firmalife:crafting/wood/hickory_wine_shelf', text_contents='The $(thing)Wine Shelf$() is the perfect accessory for your vinery, allowing you to display and store your wine bottles in style.'), empty_last_page(), )) )) diff --git a/resources/lang/en_us.json b/resources/lang/en_us.json index 5fe542f9..e228292b 100644 --- a/resources/lang/en_us.json +++ b/resources/lang/en_us.json @@ -125,6 +125,9 @@ "The $(thing)Vat$() produces some select boiling recipes in bulk. It has one slot for items, and 10,000mB of fluid space, similar to a barrel.": "The $(thing)Vat$() produces some select boiling recipes in bulk. It has one slot for items, and 10,000mB of fluid space, similar to a barrel.", "For example, the vat can be used to make $(thing)Olive Oil Water$() using a ratio of 1 Olive Paste to 200 mB Water. To use a vat, $(item)$(k:key.use)$() it with fluids and items to add them to the inventory. With an empty hand and $(item)$(k:key.sneak)$() held, click to seal and unseal the vat. A vat will not boil until it is sealed.": "For example, the vat can be used to make $(thing)Olive Oil Water$() using a ratio of 1 Olive Paste to 200 mB Water. To use a vat, $(item)$(k:key.use)$() it with fluids and items to add them to the inventory. With an empty hand and $(item)$(k:key.sneak)$() held, click to seal and unseal the vat. A vat will not boil until it is sealed.", "Vats should be placed on the block above a $(thing)Bottom Oven$(). If the vat would overflow on completion of the recipe, it will not boil, so be sure not to overfill it -- especially with recipes that produce more fluid than they consume!": "Vats should be placed on the block above a $(thing)Bottom Oven$(). If the vat would overflow on completion of the recipe, it will not boil, so be sure not to overfill it -- especially with recipes that produce more fluid than they consume!", + "The $(thing)Jarring Station$() is used to fill jars from the vat. The jarring station has a spout on one side that should point to the station.": "The $(thing)Jarring Station$() is used to fill jars from the vat. The jarring station has a spout on one side that should point to the station.", + "Using the Vat, Sugar Water can be made by adding sweetener to water. Then, adding fruit causes $(thing)Fruity Fluid$() to be made. Putting a jar in the vat can then fill it. Be careful: trying to pipe or transport fruity fluid through too many transfers could ruin it!": "Using the Vat, Sugar Water can be made by adding sweetener to water. Then, adding fruit causes $(thing)Fruity Fluid$() to be made. Putting a jar in the vat can then fill it. Be careful: trying to pipe or transport fruity fluid through too many transfers could ruin it!", + "With $(item)$(k:key.use)$(), add empty jars with lids to the jarring station. When it detects fruity fluid, it will automatically fill the jars with $(thing)Jam$() and seal them, requiring 500 mB of fruity fluid per jar.": "With $(item)$(k:key.use)$(), add empty jars with lids to the jarring station. When it detects fruity fluid, it will automatically fill the jars with $(thing)Jam$() and seal them, requiring 500 mB of fruity fluid per jar.", "Pots and Grills from TFC can be placed on top of a $(thing)Bottom Oven$(). These devices will get heat automatically from the bottom oven. The pot is only able to be used for making soup. It cannot execute regular pot recipes.": "Pots and Grills from TFC can be placed on top of a $(thing)Bottom Oven$(). These devices will get heat automatically from the bottom oven. The pot is only able to be used for making soup. It cannot execute regular pot recipes.", "Bread": "Bread", "To make $(thing)Bread$(), one first must get $(thing)Yeast$(). To get your first yeast, seal $(l:firmalife/drying)Dried Fruit$() in a Barrel of $(thing)Water$(). After three days, $(thing)Yeast Starter$() will form.$(br)From now on, your yeast can be fed by sealing Yeast Starter in a Barrel with $(thing)Flour$(). This causes it to multiply. 1 flour per 100mB of Yeast produces 600mB of Yeast. That's a good deal!": "To make $(thing)Bread$(), one first must get $(thing)Yeast$(). To get your first yeast, seal $(l:firmalife/drying)Dried Fruit$() in a Barrel of $(thing)Water$(). After three days, $(thing)Yeast Starter$() will form.$(br)From now on, your yeast can be fed by sealing Yeast Starter in a Barrel with $(thing)Flour$(). This causes it to multiply. 1 flour per 100mB of Yeast produces 600mB of Yeast. That's a good deal!", diff --git a/src/main/java/com/eerussianguy/firmalife/client/render/CompostTumblerBlockEntityRenderer.java b/src/main/java/com/eerussianguy/firmalife/client/render/CompostTumblerBlockEntityRenderer.java index 041c2c98..43e96d3c 100644 --- a/src/main/java/com/eerussianguy/firmalife/client/render/CompostTumblerBlockEntityRenderer.java +++ b/src/main/java/com/eerussianguy/firmalife/client/render/CompostTumblerBlockEntityRenderer.java @@ -71,7 +71,7 @@ public void render(CompostTumblerBlockEntity composter, float partialTicks, Pose final BakedModel baked = Minecraft.getInstance().getModelManager().getModel(!isRotating ? OPEN_MODEL : CLOSED_MODEL); final VertexConsumer buffer = buffers.getBuffer(RenderType.cutout()); - if (isRotating) + if (!isRotating) { modelRenderer.tesselateWithAO(level, baked, state, pos, poseStack, buffer, true, level.getRandom(), combinedLight, combinedOverlay, ModelData.EMPTY, RenderType.cutout()); diff --git a/src/main/java/com/eerussianguy/firmalife/common/blockentities/CompostTumblerBlockEntity.java b/src/main/java/com/eerussianguy/firmalife/common/blockentities/CompostTumblerBlockEntity.java index 4abe3fd6..ab946882 100644 --- a/src/main/java/com/eerussianguy/firmalife/common/blockentities/CompostTumblerBlockEntity.java +++ b/src/main/java/com/eerussianguy/firmalife/common/blockentities/CompostTumblerBlockEntity.java @@ -12,6 +12,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.level.Level; import net.minecraft.world.level.block.state.BlockState; import com.eerussianguy.firmalife.config.FLConfig; @@ -19,7 +20,7 @@ import net.minecraftforge.items.ItemStackHandler; import net.dries007.tfc.common.TFCTags; -import net.dries007.tfc.common.blockentities.InventoryBlockEntity; +import net.dries007.tfc.common.blockentities.TickableInventoryBlockEntity; import net.dries007.tfc.common.blockentities.rotation.RotationSinkBlockEntity; import net.dries007.tfc.common.items.TFCItems; import net.dries007.tfc.util.Helpers; @@ -29,8 +30,17 @@ import net.dries007.tfc.util.rotation.Node; import net.dries007.tfc.util.rotation.SinkNode; -public class CompostTumblerBlockEntity extends InventoryBlockEntity implements RotationSinkBlockEntity +public class CompostTumblerBlockEntity extends TickableInventoryBlockEntity implements RotationSinkBlockEntity { + public static void serverTick(Level level, BlockPos pos, BlockState state, CompostTumblerBlockEntity tumbler) + { + tumbler.checkForLastTickSync(); + if (level.getGameTime() % 20 == 0) + { + tumbler.checkReady(); + } + } + public static final int MAX_COMPOST = 32; public static final int MIN_COMPOST = 16; public static final int SLOT_COMPOST = 0; @@ -93,7 +103,7 @@ public InteractionResult use(ItemStack stack, Player player, boolean client) return InteractionResult.sidedSuccess(client); } - public void randomTick() + public void checkReady() { if (!canWork()) return; diff --git a/src/main/java/com/eerussianguy/firmalife/common/blocks/CompostTumblerBlock.java b/src/main/java/com/eerussianguy/firmalife/common/blocks/CompostTumblerBlock.java index 3d9f07fc..10f61f98 100644 --- a/src/main/java/com/eerussianguy/firmalife/common/blocks/CompostTumblerBlock.java +++ b/src/main/java/com/eerussianguy/firmalife/common/blocks/CompostTumblerBlock.java @@ -3,7 +3,6 @@ import com.eerussianguy.firmalife.common.blockentities.CompostTumblerBlockEntity; import net.minecraft.core.BlockPos; import net.minecraft.core.particles.SimpleParticleType; -import net.minecraft.server.level.ServerLevel; import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.InteractionHand; @@ -70,16 +69,6 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player return InteractionResult.PASS; } - @Override - @SuppressWarnings("deprecation") - public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) - { - if (level.getBlockEntity(pos) instanceof CompostTumblerBlockEntity composter) - { - composter.randomTick(); - } - } - @Override @SuppressWarnings("deprecation") public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, CollisionContext context) diff --git a/src/main/java/com/eerussianguy/firmalife/common/blocks/FLBlocks.java b/src/main/java/com/eerussianguy/firmalife/common/blocks/FLBlocks.java index f458a741..ee50e4ea 100644 --- a/src/main/java/com/eerussianguy/firmalife/common/blocks/FLBlocks.java +++ b/src/main/java/com/eerussianguy/firmalife/common/blocks/FLBlocks.java @@ -90,7 +90,7 @@ public class FLBlocks public static final RegistryObject DRYING_MAT = register("drying_mat", () -> new DryingMatBlock(ExtendedProperties.of().strength(0.6f).sound(SoundType.AZALEA_LEAVES).flammable(60, 30).blockEntity(FLBlockEntities.DRYING_MAT).serverTicks(DryingMatBlockEntity::serverTick))); public static final RegistryObject SOLAR_DRIER = register("solar_drier", () -> new SolarDrierBlock(ExtendedProperties.of().strength(3.0f).sound(SoundType.WOOD).noOcclusion().flammable(60, 30).blockEntity(FLBlockEntities.SOLAR_DRIER).serverTicks(DryingMatBlockEntity::serverTick))); public static final RegistryObject BEEHIVE = register("beehive", () -> new FLBeehiveBlock(ExtendedProperties.of().strength(0.6f).sound(SoundType.WOOD).flammable(60, 30).randomTicks().blockEntity(FLBlockEntities.BEEHIVE).serverTicks(FLBeehiveBlockEntity::serverTick))); - public static final RegistryObject COMPOST_TUMBLER = register("compost_tumbler", () -> new CompostTumblerBlock(ExtendedProperties.of().strength(0.6F).noOcclusion().sound(SoundType.METAL).randomTicks().blockEntity(FLBlockEntities.COMPOST_TUMBLER))); + public static final RegistryObject COMPOST_TUMBLER = register("compost_tumbler", () -> new CompostTumblerBlock(ExtendedProperties.of().strength(0.6F).noOcclusion().sound(SoundType.METAL).blockEntity(FLBlockEntities.COMPOST_TUMBLER).serverTicks(CompostTumblerBlockEntity::serverTick))); public static final RegistryObject WOOL_STRING = registerNoItem("wool_string", () -> new StringBlock(ExtendedProperties.of().noCollission().strength(1.0f).sound(SoundType.WOOL).randomTicks().blockEntity(FLBlockEntities.STRING).serverTicks(StringBlockEntity::serverTick), TFCItems.WOOL_YARN)); public static final RegistryObject MIXING_BOWL = register("mixing_bowl", () -> new MixingBowlBlock(ExtendedProperties.of().sound(SoundType.STONE).strength(1f).noOcclusion().blockEntity(FLBlockEntities.MIXING_BOWL).ticks(MixingBowlBlockEntity::serverTick, MixingBowlBlockEntity::clientTick))); public static final RegistryObject VAT = register("vat", () -> new VatBlock(ExtendedProperties.of().sound(SoundType.METAL).strength(1f).noOcclusion().blockEntity(FLBlockEntities.VAT).serverTicks(VatBlockEntity::serverTick))); diff --git a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/oven_appliances.json b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/oven_appliances.json index b135bfed..7d032f20 100644 --- a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/oven_appliances.json +++ b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/oven_appliances.json @@ -55,6 +55,19 @@ "text": "", "enable_visualize": false }, + { + "type": "patchouli:crafting", + "recipe": "firmalife:crafting/jarring_station", + "text": "The $(thing)Jarring Station$() is used to fill jars from the vat. The jarring station has a spout on one side that should point to the station." + }, + { + "type": "patchouli:text", + "text": "Using the Vat, Sugar Water can be made by adding sweetener to water. Then, adding fruit causes $(thing)Fruity Fluid$() to be made. Putting a jar in the vat can then fill it. Be careful: trying to pipe or transport fruity fluid through too many transfers could ruin it!" + }, + { + "type": "patchouli:text", + "text": "With $(item)$(k:key.use)$(), add empty jars with lids to the jarring station. When it detects fruity fluid, it will automatically fill the jars with $(thing)Jam$() and seal them, requiring 500 mB of fruity fluid per jar." + }, { "type": "patchouli:text", "text": "Pots and Grills from TFC can be placed on top of a $(thing)Bottom Oven$(). These devices will get heat automatically from the bottom oven. The pot is only able to be used for making soup. It cannot execute regular pot recipes." diff --git a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine.json b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine.json index 0b9f2142..fbf6f8bd 100644 --- a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine.json +++ b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine.json @@ -35,24 +35,32 @@ "multiblocks": [ { "pattern": [ - "X0X", - "XYX" + [ + "XYX" + ], + [ + "X0X" + ] ], "mapping": { "X": "firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]", - "0": "firmalife:grape_string_plant_red[axis=x,lifecycle=healthy,stage=0]", - "Y": "firmalife:grape_string[axis=x]" + "0": "firmalife:grape_string_plant_red[axis=z,lifecycle=healthy,stage=0]", + "Y": "firmalife:grape_string[axis=z]" } }, { "pattern": [ - "X0X", - "ZYZ" + [ + "ZYZ" + ], + [ + "X0X" + ] ], "mapping": { "X": "firmalife:grape_trellis_post[axis=x,string_plus=true,string_minus=true]", - "0": "firmalife:grape_string_plant_red[axis=x,lifecycle=healthy,stage=2]", - "Y": "firmalife:grape_string_red[axis=x,lifecycle=healthy]", + "0": "firmalife:grape_string_plant_red[axis=z,lifecycle=healthy,stage=2]", + "Y": "firmalife:grape_string_red[axis=z,lifecycle=healthy]", "Z": "firmalife:grape_trellis_post_red[axis=x,lifecycle=healthy,string_plus=true,string_minus=true]" } } diff --git a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine_consumption.json b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine_consumption.json index b42a7737..6de9b949 100644 --- a/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine_consumption.json +++ b/src/main/resources/assets/tfc/patchouli_books/field_guide/en_us/entries/firmalife/wine_consumption.json @@ -23,7 +23,7 @@ }, { "type": "patchouli:crafting", - "recipe": "firamlife:crafting/wood/hickory_wine_shelf", + "recipe": "firmalife:crafting/wood/hickory_wine_shelf", "text": "The $(thing)Wine Shelf$() is the perfect accessory for your vinery, allowing you to display and store your wine bottles in style." } ],