Skip to content

Commit

Permalink
fix the tumbler, more FG updates
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Aug 21, 2024
1 parent c52d663 commit 3e8cce3
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 29 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
### Changes
- Fix an issue where spawning of wild grapes was broken.
- 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.
10 changes: 7 additions & 3 deletions resources/generate_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!'),
Expand Down Expand Up @@ -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.'),
Expand All @@ -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(),
))
))
Expand Down
3 changes: 3 additions & 0 deletions resources/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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!",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
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;
import net.minecraftforge.items.ItemHandlerHelper;
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;
Expand All @@ -29,8 +30,17 @@
import net.dries007.tfc.util.rotation.Node;
import net.dries007.tfc.util.rotation.SinkNode;

public class CompostTumblerBlockEntity extends InventoryBlockEntity<ItemStackHandler> implements RotationSinkBlockEntity
public class CompostTumblerBlockEntity extends TickableInventoryBlockEntity<ItemStackHandler> 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;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public class FLBlocks
public static final RegistryObject<Block> 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<Block> 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<Block> 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<Block> 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<Block> 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<Block> 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<Block> 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<Block> VAT = register("vat", () -> new VatBlock(ExtendedProperties.of().sound(SoundType.METAL).strength(1f).noOcclusion().blockEntity(FLBlockEntities.VAT).serverTicks(VatBlockEntity::serverTick)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
],
Expand Down

0 comments on commit 3e8cce3

Please sign in to comment.