Skip to content

Commit

Permalink
- Made behavior of uninsulated top ovens more consistent. Now they wi…
Browse files Browse the repository at this point in the history
…ll heat items, but only to half the requested temperature.

- Added a note about the max greenhouse size to the book.
- Replaced uses of the Empty Jar With Lid item with a tag internally.
  • Loading branch information
eerussianguy committed Nov 3, 2024
1 parent c5780af commit b7098ef
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 45 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Changes
- Buff rennet drops
- Add config for classic sprinkler behavior
- Disallow knapping with rotten pumpkins
- Made behavior of uninsulated top ovens more consistent. Now they will heat items, but only to half the requested temperature.
- Added a note about the max greenhouse size to the book.
- Replaced uses of the Empty Jar With Lid item with a tag internally.
2 changes: 1 addition & 1 deletion resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ class Wood(NamedTuple):
'firmalife.jade.cook_left': '%s: %s',
'firmalife.jade.cook_left_temp': '%s: %s (%s)',
'firmalife.jade.boiling': 'Boiling',
'firmalife.jade.not_insulated': 'Not insulated!',
'firmalife.jade.not_insulated': 'Not insulated! Items can only heat half as hot!',
'firmalife.jade.no_chimney': 'Missing chimney!',
'firmalife.jade.needs_peel': 'Needs peel item to safely remove goods',
'firmalife.jade.has_firepit': 'Has an eligible firepit',
Expand Down
2 changes: 1 addition & 1 deletion resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def generate(rm: ResourceManager):

### MISC DATA ###
global_loot_modifiers(rm, 'firmalife:fruit_leaf', 'firmalife:rennet', 'firmalife:rennet_three', 'firmalife:ice_shavings')
global_loot_modifier(rm, 'rennet', 'firmalife:add_item', {'item': item_stack-_codec('4 firmalife:rennet')}, match_entity_tag('firmalife:drops_rennet'))
global_loot_modifier(rm, 'rennet', 'firmalife:add_item', {'item': item_stack_codec('4 firmalife:rennet')}, match_entity_tag('firmalife:drops_rennet'))
global_loot_modifier(rm, 'rennet_three', 'firmalife:add_item', {'item': item_stack_codec('6 firmalife:rennet')}, match_entity_tag('firmalife:drops_three_rennet'))
global_loot_modifier(rm, 'fruit_leaf', 'firmalife:add_item', {'item': item_stack_codec('firmalife:fruit_leaf'), 'chance': 0.5}, match_block_ingredient('firmalife:drops_fruit_leaf'))
global_loot_modifier(rm, 'ice_shavings', 'firmalife:add_item', {'item': item_stack_codec('firmalife:ice_shavings')}, match_block_ingredient('firmalife:drops_ice_shavings'))
Expand Down
2 changes: 2 additions & 0 deletions resources/generate_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False, rev
multimultiblock('The climate station in its valid and invalid state.', *[block_spotlight('', '', 'firmalife:climate_station[stasis=%s]' % b) for b in ('true', 'false')]),
text('$(li)It updates periodically on its own, or when placed/broken.$()$(li)When a climate station updates, it tells all the blocks inside the multiblock that they can operate. For example, it lets $(l:firmalife/cheese)Cheese$() begin aging.$()$(li)Press $(item)$(k:key.use)$() to force update the Climate Station and the blocks inside the multiblock.', 'Climate Station Tips'),
crafting('firmalife:crafting/climate_station', text_contents='The climate station is crafted like this.'),
text('A note about greenhouse construction: The largest greenhouse is 31x31x31, centered on the climate station, or 15 blocks in each direction. Centering the climate station in the greenhouse will allow you to take advantage of the full size range. You can also internally subdivide a greenhouse into multiple by using walls and multiple climate stations to make it larger.'),
empty_last_page(),
)),
entry('cellar', 'Cellars', 'firmalife:sealed_bricks', pages=(
text('The $(thing)Cellar$() is a multiblock device controlled by a $(l:firmalife/climate_station)Climate Station$(). The Cellar multiblock\'s only requirement is that it be in an enclosed area surrounded by $(thing)Sealed Bricks$() or $(thing)Sealed Brick Doors$() on all sides. The Climate Station must be placed on the first level of the cellar, touching a wall.'),
Expand Down
1 change: 1 addition & 0 deletions resources/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"$(li)It updates periodically on its own, or when placed/broken.$()$(li)When a climate station updates, it tells all the blocks inside the multiblock that they can operate. For example, it lets $(l:firmalife/cheese)Cheese$() begin aging.$()$(li)Press $(item)$(k:key.use)$() to force update the Climate Station and the blocks inside the multiblock.": "$(li)It updates periodically on its own, or when placed/broken.$()$(li)When a climate station updates, it tells all the blocks inside the multiblock that they can operate. For example, it lets $(l:firmalife/cheese)Cheese$() begin aging.$()$(li)Press $(item)$(k:key.use)$() to force update the Climate Station and the blocks inside the multiblock.",
"Climate Station Tips": "Climate Station Tips",
"The climate station is crafted like this.": "The climate station is crafted like this.",
"A note about greenhouse construction: The largest greenhouse is 31x31x31, centered on the climate station, or 15 blocks in each direction. Centering the climate station in the greenhouse will allow you to take advantage of the full size range. You can also internally subdivide a greenhouse into multiple by using walls and multiple climate stations to make it larger.": "A note about greenhouse construction: The largest greenhouse is 31x31x31, centered on the climate station, or 15 blocks in each direction. Centering the climate station in the greenhouse will allow you to take advantage of the full size range. You can also internally subdivide a greenhouse into multiple by using walls and multiple climate stations to make it larger.",
"Cellars": "Cellars",
"The $(thing)Cellar$() is a multiblock device controlled by a $(l:firmalife/climate_station)Climate Station$(). The Cellar multiblock's only requirement is that it be in an enclosed area surrounded by $(thing)Sealed Bricks$() or $(thing)Sealed Brick Doors$() on all sides. The Climate Station must be placed on the first level of the cellar, touching a wall.": "The $(thing)Cellar$() is a multiblock device controlled by a $(l:firmalife/climate_station)Climate Station$(). The Cellar multiblock's only requirement is that it be in an enclosed area surrounded by $(thing)Sealed Bricks$() or $(thing)Sealed Brick Doors$() on all sides. The Climate Station must be placed on the first level of the cellar, touching a wall.",
"An Example Cellar": "An Example Cellar",
Expand Down
2 changes: 1 addition & 1 deletion resources/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def chisel_stair_slab(name: str, ingredient: str):
for jar, remainder, ing in JARS:
make_jar(rm, jar, remainder, ing)
for fruit in FL_FRUITS:
ing = not_rotten(has_trait('firmalife:food/%s' % fruit, 'firmalife:dried', True))
ing = not_rotten(lacks_trait('firmalife:food/%s' % fruit, 'firmalife:dried'))
vat_recipe(rm, '%s_jar' % fruit, ing, '500 firmalife:sugar_water', jar='firmalife:jar/%s' % fruit, output_texture='firmalife:block/jar/%s' % fruit)
for count in (2, 3, 4):
rm.recipe(('pot', 'jam_%s_%s' % (fruit, count)), 'tfc:pot_jam', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.items.ItemStackHandler;

import net.dries007.tfc.common.TFCTags;
import net.dries007.tfc.common.blockentities.TickableInventoryBlockEntity;
import net.dries007.tfc.common.capabilities.PartialItemHandler;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;

public class JarringStationBlockEntity extends TickableInventoryBlockEntity<ItemStackHandler>
Expand All @@ -30,7 +30,7 @@ public static void tick(Level level, BlockPos pos, BlockState state, JarringStat
final ItemStack jars = vat.getOutput();
for (int i = 0; i < SLOTS; i++)
{
if (station.inventory.getStackInSlot(i).getItem() == TFCItems.EMPTY_JAR_WITH_LID.get())
if (Helpers.isItem(station.inventory.getStackInSlot(i).getItem(), TFCTags.Items.EMPTY_JAR_WITH_LID))
{
Helpers.playSound(level, pos, SoundEvents.BOTTLE_FILL);
station.inventory.setStackInSlot(i, jars.split(1));
Expand Down Expand Up @@ -70,7 +70,7 @@ public void setAndUpdateSlots(int slot)
@Override
public boolean isItemValid(int slot, ItemStack stack)
{
return Helpers.isItem(stack, TFCItems.EMPTY_JAR_WITH_LID.get());
return Helpers.isItem(stack, TFCTags.Items.EMPTY_JAR_WITH_LID);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.eerussianguy.firmalife.common.blockentities;

import com.eerussianguy.firmalife.common.blocks.OvenTopBlock;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.NonNullList;
Expand Down Expand Up @@ -64,6 +65,7 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, OvenT
if (level.getGameTime() % updateInterval == 0)
{
OvenLike.regularBlockUpdate(level, pos, state, oven, cured, updateInterval);
oven.isInsulated = ((OvenTopBlock) state.getBlock()).isInsulated(level, pos, state);
}
oven.tickTemperature();
if ((level.getGameTime() + 20) % 40 == 0)
Expand All @@ -80,10 +82,11 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, OvenT
{
inputStack.getCapability(HeatCapability.CAPABILITY).ifPresent(cap -> {
// Always heat up the item regardless if it is melting or not
if (cap.getTemperature() < oven.temperature)
final float targetTemp = oven.isInsulated ? oven.temperature : oven.temperature * 0.5f;
if (cap.getTemperature() < targetTemp)
{
final float modifier = FoodCapability.hasTrait(inputStack, FLFoodTraits.OVEN_BAKED) ? 2f : 2 + oven.temperature + 0.0025f; // Breaks even at 400 C
HeatCapability.addTemp(cap, oven.temperature, modifier);
final float modifier = FoodCapability.hasTrait(inputStack, FLFoodTraits.OVEN_BAKED) ? 2f : 2 + targetTemp + 0.0025f; // Breaks even at 400 C
HeatCapability.addTemp(cap, targetTemp, modifier);
}

final WrappedHeatingRecipe recipe = oven.cachedRecipes[slot];
Expand Down Expand Up @@ -120,6 +123,7 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, OvenT
private final WrappedHeatingRecipe[] cachedRecipes;
private int[] cookTicks;
private int cureTicks;
private boolean isInsulated = false;

public OvenTopBlockEntity(BlockPos pos, BlockState state)
{
Expand All @@ -138,6 +142,7 @@ public void loadAdditional(CompoundTag nbt)
{
cookTicks = nbt.getIntArray("cookTicks");
cureTicks = nbt.getInt("cureTicks");
isInsulated = nbt.getBoolean("isInsulated");
needsRecipeUpdate = true;
super.loadAdditional(nbt);
}
Expand All @@ -147,6 +152,7 @@ public void saveAdditional(CompoundTag nbt)
{
nbt.putIntArray("cookTicks", cookTicks);
nbt.putInt("cureTicks", cureTicks);
nbt.putBoolean("isInsulated", isInsulated);
super.saveAdditional(nbt);
}

Expand Down Expand Up @@ -242,6 +248,11 @@ public void extinguish()
targetTemperatureStabilityTicks = 0;
}

public void setInsulated(boolean insulated)
{
this.isInsulated = insulated;
}

public int getTicksLeft(int slot)
{
assert level != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import net.dries007.tfc.common.blockentities.InventoryBlockEntity;
import net.dries007.tfc.common.capabilities.InventoryFluidTank;
import net.dries007.tfc.common.capabilities.PartialItemHandler;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;

public class VatBlockEntity extends BoilingBlockEntity<VatBlockEntity.VatInventory>
Expand Down Expand Up @@ -126,7 +125,7 @@ public void handleJarring()
{
final FluidStack fluid = inventory.getFluidInTank(0);
final ItemStack stack = inventory.getStackInSlot(0);
if (fluid.hasTag() && fluid.getTag().contains("fruit", Tag.TAG_COMPOUND) && Helpers.isItem(stack, TFCItems.EMPTY_JAR_WITH_LID.get()))
if (fluid.hasTag() && fluid.getTag().contains("fruit", Tag.TAG_COMPOUND) && Helpers.isItem(stack, TFCTags.Items.EMPTY_JAR_WITH_LID))
{
final int jars = stack.getCount();
final int maxFill = fluid.getAmount() / 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSourc
pos = pos.offset(Helpers.triangle(random, 3), random.nextInt(3), Helpers.triangle(random, 3));
if (level.getBlockState(pos).isAir())
{
FLClientHelpers.randomParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, random, pos, level, 0.3f);
FLClientHelpers.randomParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, random, pos, level, 0.05f);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

import net.dries007.tfc.common.TFCTags;
import net.dries007.tfc.common.blocks.ExtendedProperties;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;

public class JarringStationBlock extends FourWayDeviceBlock
Expand All @@ -38,7 +38,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
{
return FLHelpers.takeOneAny(level, 0, JarringStationBlockEntity.SLOTS - 1, inv, player);
}
else if (Helpers.isItem(item, TFCItems.EMPTY_JAR_WITH_LID.get()))
else if (Helpers.isItem(item, TFCTags.Items.EMPTY_JAR_WITH_LID))
{
return FLHelpers.insertOneAny(level, item, 0, JarringStationBlockEntity.SLOTS - 1, inv, player);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
import com.eerussianguy.firmalife.common.items.FinishItem;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
Expand Down Expand Up @@ -94,21 +92,6 @@ public void animateTick(BlockState state, Level level, BlockPos pos, RandomSourc
}
}

@Override
@SuppressWarnings("deprecation")
public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor level, BlockPos currentPos, BlockPos facingPos)
{
extinguish(level, currentPos, state);
return super.updateShape(state, facing, facingState, level, currentPos, facingPos);
}

@Override
@SuppressWarnings("deprecation")
public void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource rand)
{
extinguish(level, pos, state);
}

@Override
public void cure(Level level, BlockState state, BlockPos pos)
{
Expand All @@ -117,12 +100,4 @@ public void cure(Level level, BlockState state, BlockPos pos)
OvenTopBlockEntity.cure(level, state, getCured().defaultBlockState(), pos);
}
}

private void extinguish(LevelAccessor level, BlockPos pos, BlockState state)
{
if (!isInsulated(level, pos, state))
{
level.getBlockEntity(pos, FLBlockEntities.OVEN_TOP.get()).ifPresent(OvenTopBlockEntity::extinguish);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import net.minecraftforge.items.ItemHandlerHelper;

import net.dries007.tfc.client.particle.TFCParticles;
import net.dries007.tfc.common.TFCTags;
import net.dries007.tfc.common.blocks.ExtendedProperties;
import net.dries007.tfc.common.blocks.devices.SealableDeviceBlock;
import net.dries007.tfc.common.capabilities.Capabilities;
import net.dries007.tfc.common.fluids.FluidHelpers;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;

public class VatBlock extends SealableDeviceBlock
Expand Down Expand Up @@ -92,7 +92,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
{
if (vat.hasOutput())
{
if (stack.getItem() == TFCItems.EMPTY_JAR_WITH_LID.get())
if (Helpers.isItem(stack, TFCTags.Items.EMPTY_JAR_WITH_LID))
{
stack.shrink(1);
ItemHandlerHelper.giveItemToPlayer(player, vat.takeOutput());
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/firmalife/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@
"firmalife.jade.cook_left": "%s: %s",
"firmalife.jade.cook_left_temp": "%s: %s (%s)",
"firmalife.jade.boiling": "Boiling",
"firmalife.jade.not_insulated": "Not insulated!",
"firmalife.jade.not_insulated": "Not insulated! Items can only heat half as hot!",
"firmalife.jade.no_chimney": "Missing chimney!",
"firmalife.jade.needs_peel": "Needs peel item to safely remove goods",
"firmalife.jade.has_firepit": "Has an eligible firepit",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
"type": "patchouli:crafting",
"recipe": "firmalife:crafting/climate_station",
"text": "The climate station is crafted like this."
},
{
"type": "patchouli:text",
"text": "A note about greenhouse construction: The largest greenhouse is 31x31x31, centered on the climate station, or 15 blocks in each direction. Centering the climate station in the greenhouse will allow you to take advantage of the full size range. You can also internally subdivide a greenhouse into multiple by using walls and multiple climate stations to make it larger."
}
],
"read_by_default": true,
Expand Down

0 comments on commit b7098ef

Please sign in to comment.