Skip to content

Commit

Permalink
ash trays. finally fix nutritive basin renderer. half fruit leaf drop…
Browse files Browse the repository at this point in the history
… rate. other fixes and testing
  • Loading branch information
eerussianguy committed Mar 27, 2023
1 parent 556abdd commit 1727251
Show file tree
Hide file tree
Showing 57 changed files with 625 additions and 119 deletions.
13 changes: 11 additions & 2 deletions resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def generate(rm: ResourceManager):
rm.item_model('%soven_hopper' % pref, parent='firmalife:block/%soven_hopper' % pref, no_textures=True)

rm.block_model('cured_oven_hopper', parent='minecraft:block/orientable', textures={'top': 'firmalife:block/oven_hopper_top', 'side': 'minecraft:block/bricks', 'front': 'firmalife:block/oven_hopper_front'})
rm.block_model('oven_hopper', parent='minecraft:block/orientable', textures={'top': 'firmalife:block/clay_oven_hopper_top', 'side': 'minecraft:block/bricks', 'front': 'firmalife:block/clay_oven_hopper_front'})
rm.block_model('oven_hopper', parent='minecraft:block/orientable', textures={'top': 'firmalife:block/clay_oven_hopper_top', 'side': 'firmalife:block/unfired_bricks', 'front': 'firmalife:block/clay_oven_hopper_front'})

block = rm.blockstate('ashtray', variants=dict(('stage=%s' % i, {'model': 'firmalife:block/ashtray_%s' % i}) for i in range(0, 11)))
block.with_lang(lang('ashtray')).with_tag('minecraft:mineable/pickaxe').with_block_loot('firmalife:ashtray')
for i in range(0, 11):
rm.block_model('ashtray_%s' % i, parent='minecraft:block/cube_column', textures={'side': 'firmalife:block/ashtray_side_%s' % i, 'end': 'firmalife:block/ashtray_top'})
rm.item_model('ashtray', parent='firmalife:block/ashtray_0', no_textures=True)

rm.blockstate('drying_mat', model='firmalife:block/drying_mat').with_item_model().with_tag('tfc:mineable_with_sharp_tool').with_lang(lang('drying mat')).with_block_loot('firmalife:drying_mat')
rm.blockstate('solar_drier', model='firmalife:block/solar_drier').with_item_model().with_tag('minecraft:mineable/axe').with_lang(lang('solar drier')).with_block_loot('firmalife:solar_drier')
Expand Down Expand Up @@ -122,7 +128,10 @@ def generate(rm: ResourceManager):
block = rm.block('firmalife:sealed_door').with_tag('minecraft:doors').with_lang(lang('sealed door')).with_tag('minecraft:mineable/pickaxe')
door_loot(block, 'firmalife:sealed_door')

rm.blockstate('nutritive_basin', model='firmalife:block/nutritive_basin').with_block_loot('firmalife:nutritive_basin').with_lang(lang('nutritive basin')).with_tag('minecraft:mineable/axe').with_item_model()
rm.blockstate('nutritive_basin', variants={
'watered=false': {'model': 'firmalife:block/nutritive_basin'},
'watered=true': {'model': 'firmalife:block/nutritive_basin_water'},
}).with_block_loot('firmalife:nutritive_basin').with_lang(lang('nutritive basin')).with_tag('minecraft:mineable/axe').with_item_model()

for cheese in CHEESE_WHEELS:
for age in ('fresh', 'aged', 'vintage'):
Expand Down
8 changes: 5 additions & 3 deletions resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Wood(NamedTuple):
'treated_wood': 'minecraft:mineable/axe'
}
COLORS = ('white', 'orange', 'magenta', 'light_blue', 'yellow', 'lime', 'pink', 'gray', 'light_gray', 'cyan', 'purple', 'blue', 'brown', 'green', 'red', 'black')
BLOCK_ENTITIES = ('oven_bottom', 'oven_top', 'drying_mat', 'beehive', 'solar_drier', 'mixing_bowl', 'iron_composter', 'string', 'berry_bush', 'large_planter', 'bonsai_planter', 'trellis_planter', 'hanging_planter', 'quad_planter', 'climate_station', 'hydroponic_planter', 'vat', 'oven_hopper')
BLOCK_ENTITIES = ('oven_bottom', 'oven_top', 'drying_mat', 'beehive', 'solar_drier', 'mixing_bowl', 'iron_composter', 'string', 'berry_bush', 'large_planter', 'bonsai_planter', 'trellis_planter', 'hanging_planter', 'quad_planter', 'climate_station', 'hydroponic_planter', 'vat', 'oven_hopper', 'ashtray')
EXTRA_FLUIDS = ('yeast_starter', 'coconut_milk', 'yak_milk', 'goat_milk', 'curdled_yak_milk', 'curdled_goat_milk', 'pina_colada', 'cream', 'chocolate')
JARS: Sequence[Tuple[str, int, str, str]] = (
('honey', 1, 'minecraft:block/honey_block_side', 'firmalife:raw_honey'),
Expand Down Expand Up @@ -254,8 +254,10 @@ def preset_vein(ore: str, vein_type: str, rocks: List[str], spoiler_ore: Optiona

'death.attack.firmalife.oven': '%1$s died by sticking their hand in a hot oven.',
'death.attack.firmalife.oven.player': '%1$s climbed into an oven to escape %2$s.',
'death.attack.firmalife.swarm': '%1$s was stung to death by bees.',
'death.attack.firmalife.swarm.player': '%1$s was stung to death by bees while trying to escape %2$s.',
'death.attack.firmalife.swarm': '%1$s was stung to death by a swarm of bees!',
'death.attack.firmalife.swarm.player': '%1$s was stung to death by a swarm of bees while trying to escape %2$s.',
'death.attack.firmalife.ash': '%1$s lit wood ash on fire and was exploded.',
'death.attack.firmalife.ash.player': '%1$s lit wood ash on fire and was exploded while trying to escape %2$s.',
'subtitles.item.firmalife.hollow_shell.blow': 'Shell whistles',

'item.firmalife.hollow_shell.filled': '%s Hollow Shell',
Expand Down
4 changes: 2 additions & 2 deletions resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ def generate(rm: ResourceManager):
simple_plantable(rm, 'green_bean', 'nitrogen', 4, planter='large', firmalife=True)
simple_plantable(rm, 'tomato', 'potassium', 4, planter='large', firmalife=True)
simple_plantable(rm, 'sugarcane', 'potassium', 4, planter='large', firmalife=True)
simple_plantable(rm, 'papyrus', 'potassium', 5, planter='large', firmalife=True)
plantable(rm, 'jute', 'tfc:seeds/jute', 'tfc:jute', 'potassium', ['firmalife:block/crop/jute_%s' % i for i in range(0, 5)], 4, 'large')
plantable(rm, 'papyrus', 'tfc:seeds/papyrus', 'tfc:papyrus', 'potassium', ['firmalife:block/crop/papyrus_%s' % i for i in range(0, 6)], 5, 'large')

bonsai_plantable(rm, 'cherry', 'nitrogen')
bonsai_plantable(rm, 'green_apple', 'nitrogen')
Expand Down Expand Up @@ -232,7 +232,7 @@ def generate(rm: ResourceManager):
global_loot_modifiers(rm, 'firmalife:fruit_leaf', 'firmalife:rennet', 'firmalife:rennet_three')
global_loot_modifier(rm, 'rennet', 'firmalife:add_item', {'item': utils.item_stack('2 firmalife:rennet')}, match_entity_tag('firmalife:drops_rennet'))
global_loot_modifier(rm, 'rennet_three', 'firmalife:add_item', {'item': utils.item_stack('3 firmalife:rennet')}, match_entity_tag('firmalife:drops_three_rennet'))
global_loot_modifier(rm, 'fruit_leaf', 'firmalife:add_item', {'item': utils.item_stack('firmalife:fruit_leaf')}, match_block_ingredient('firmalife:drops_fruit_leaf'))
global_loot_modifier(rm, 'fruit_leaf', 'firmalife:add_item', {'item': utils.item_stack('firmalife:fruit_leaf'), 'chance': 0.5}, match_block_ingredient('firmalife:drops_fruit_leaf'))


def greenhouse(rm: ResourceManager, name: str, block_ingredient: str, tier: int):
Expand Down
8 changes: 5 additions & 3 deletions resources/generate_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,18 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False):
('WT0TW', 'WWCWW'),
('WBBBW', 'WWCWW'),
), {
'0': 'firmalife:%soven_top[facing=south]' % pref,
'T': 'firmalife:%soven_top[facing=south]' % pref,
'B': 'firmalife:%soven_bottom[facing=south]' % pref,
'0': 'firmalife:%soven_top[facing=north]' % pref,
'T': 'firmalife:%soven_top[facing=north]' % pref,
'B': 'firmalife:%soven_bottom[facing=north]' % pref,
'W': 'minecraft:bricks',
'C': 'firmalife:%soven_chimney' % pref,
}) for pref in ('cured_', '')]),
text('The Bottom Oven is used to hold fuel, which may only be logs. Press $(item)$(k:key.use)$() to add or remove them. The bottom oven is also the part of the oven which may be lit with a $(thing)Firestarter$() or other tool. It transfers heat contained in it to the top oven.'),
text('The Top Oven contains the items that are being cooked. It will draw heat from the Bottom Oven and slowly release it over time. This means that even if your fuel runs out, your Top Oven can continue to work for a little while. Adding items to it is as simple as pressing $(item)$(k:key.use)$(). Remember to use a $(thing)Peel$() to remove the items after.'),
text('Curing Oven blocks is easy, but requires patience. Simply start running your Bottom Oven as you would normally, and then wait. If an oven block is above 600 degrees for about 80 seconds, it will cure itself and any oven blocks around it. The curing effect will pass all the way up chimneys nearby.'),
crafting('firmalife:crafting/oven_hopper', text_contents='The $(thing)Oven Hopper$() will input logs into any Bottom Oven that it is facing. It holds 16 logs (4 stacks of 4, like a log pile), and its inventory is fed by dropping items in the top. It can also be fed via automation from other mods.'),
crafting('firmalife:crafting/ashtray', text_contents='The $(thing)Ashtray$() collects $(thing)Wood Ash$() when placed below a $(thing)Bottom Oven Block$(). There is a 0.5 chance it gains ash when fuel is consumed. Ash is extracted with $(item)$(k:key.use)$() and inserted via attacking it.'),
empty_last_page()
)),
entry('bread', 'Bread', 'tfc:food/rye_bread', pages=(
text('To make $(thing)Bread$(), one first must get $(thing)Yeast$(). To get your first yeast, seal $(l:firmalife: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
1 change: 1 addition & 0 deletions resources/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def generate(rm: ResourceManager):
rm.crafting_shapeless('crafting/toast_with_butter', ('firmalife:food/toast', 'firmalife:food/butter'), 'firmalife:food/toast_with_butter').with_advancement('firmalife:food/toast')
damage_shapeless(rm, 'crafting/bacon', (not_rotten(has_trait('tfc:food/pork', trait='firmalife:smoked')), '#tfc:knives', 'tfc:powder/salt'), '4 firmalife:food/bacon').with_advancement('tfc:food/cooked_pork')
rm.crafting_shapeless('crafting/tomato_sauce_mix', (not_rotten('tfc:food/tomato'), utils.ingredient('tfc:powder/salt'), not_rotten('tfc:food/garlic')), 'firmalife:food/tomato_sauce_mix').with_advancement('tfc:food/tomato')
rm.crafting_shaped('crafting/ashtray', ['ZZZ', 'XYX'], {'Z': 'tfc:powder/salt', 'X': 'firmalife:sealed_bricks', 'Y': '#forge:sheets/wrought_iron'}, 'firmalife:ashtray').with_advancement('#forge:sheets/wrought_iron')

for i in range(1, 9):
advanced_shapeless(rm, 'crafting/masa_%s' % i, (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import net.dries007.tfc.client.TFCColors;
import net.dries007.tfc.client.particle.GlintParticleProvider;
import net.dries007.tfc.client.screen.KnappingScreen;
import net.dries007.tfc.common.blocks.TFCBlocks;
import net.dries007.tfc.common.capabilities.food.FoodCapability;
import net.dries007.tfc.common.items.TFCItems;

Expand Down Expand Up @@ -68,10 +67,11 @@ public static void clientSetup(FMLClientSetupEvent event)
FLBlocks.CURED_OVEN_CHIMNEY, FLBlocks.QUAD_PLANTER, FLBlocks.LARGE_PLANTER, FLBlocks.HANGING_PLANTER, FLBlocks.BONSAI_PLANTER,
FLBlocks.IRON_COMPOSTER, FLBlocks.COMPOST_JAR, FLBlocks.HONEY_JAR, FLBlocks.ROTTEN_COMPOST_JAR, FLBlocks.GUANO_JAR, FLBlocks.CHEDDAR_WHEEL,
FLBlocks.RAJYA_METOK_WHEEL, FLBlocks.CHEVRE_WHEEL, FLBlocks.SHOSHA_WHEEL, FLBlocks.FETA_WHEEL, FLBlocks.GOUDA_WHEEL, FLBlocks.SMALL_CHROMITE,
FLBlocks.MIXING_BOWL, FLBlocks.BUTTERFLY_GRASS, FLBlocks.SPRINKLER, FLBlocks.DRIBBLER, FLBlocks.VAT, FLBlocks.HYDROPONIC_PLANTER, FLBlocks.NUTRITIVE_BASIN
FLBlocks.MIXING_BOWL, FLBlocks.BUTTERFLY_GRASS, FLBlocks.SPRINKLER, FLBlocks.DRIBBLER, FLBlocks.VAT, FLBlocks.HYDROPONIC_PLANTER
).forEach(reg -> ItemBlockRenderTypes.setRenderLayer(reg.get(), cutout));

ItemBlockRenderTypes.setRenderLayer(FLBlocks.SOLAR_DRIER.get(), translucent);
ItemBlockRenderTypes.setRenderLayer(FLBlocks.NUTRITIVE_BASIN.get(), translucent);

FLBlocks.CHROMITE_ORES.values().forEach(map -> map.values().forEach(reg -> ItemBlockRenderTypes.setRenderLayer(reg.get(), cutout)));
FLBlocks.FRUIT_PRESERVES.values().forEach(reg -> ItemBlockRenderTypes.setRenderLayer(reg.get(), translucent));
Expand Down Expand Up @@ -149,7 +149,6 @@ public static void registerEntityRenderers(EntityRenderersEvent.RegisterRenderer
event.registerBlockEntityRenderer(FLBlockEntities.MIXING_BOWL.get(), ctx -> new MixingBowlBlockEntityRenderer());
event.registerBlockEntityRenderer(FLBlockEntities.HANGER.get(), ctx -> new HangerBlockEntityRenderer());
event.registerBlockEntityRenderer(FLBlockEntities.FOOD_SHELF.get(), ctx -> new FoodShelfBlockEntityRenderer());
event.registerBlockEntityRenderer(FLBlockEntities.NUTRITIVE_BASIN.get(), ctx -> new NutritiveBasinBlockEntityRenderer());

event.registerEntityRenderer(FLEntities.SEED_BALL.get(), ThrownItemRenderer::new);
}
Expand All @@ -170,6 +169,13 @@ public static void onTextureStitch(TextureStitchEvent.Pre event)
event.addSprite(FLHelpers.identifier("block/crop/" + name + "_" + i));
}
}
for (String name : new String[] {"papyrus"})
{
for (int i = 0; i < 6; i++)
{
event.addSprite(FLHelpers.identifier("block/crop/" + name + "_" + i));
}
}
for (String name : new String[] {"squash", "banana"})
{
for (int i = 0; i < 5; i++)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.eerussianguy.firmalife.common.blockentities;

import com.eerussianguy.firmalife.common.FLHelpers;
import com.eerussianguy.firmalife.common.blocks.AshtrayBlock;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.Mth;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.items.ItemStackHandler;

import net.dries007.tfc.common.blockentities.InventoryBlockEntity;
import net.dries007.tfc.common.capabilities.PartialItemHandler;
import net.dries007.tfc.common.items.Powder;
import net.dries007.tfc.common.items.TFCItems;
import net.dries007.tfc.util.Helpers;

public class AshTrayBlockEntity extends InventoryBlockEntity<ItemStackHandler>
{
public AshTrayBlockEntity(BlockPos pos, BlockState state)
{
super(FLBlockEntities.ASHTRAY.get(), pos, state, defaultInventory(1), FLHelpers.blockEntityName("ashtray"));

sidedInventory.on(new PartialItemHandler(inventory).extract(0), d -> d != Direction.UP);
}

@Override
public boolean isItemValid(int slot, ItemStack stack)
{
return Helpers.isItem(stack, TFCItems.POWDERS.get(Powder.WOOD_ASH).get());
}

@Override
public int getSlotStackLimit(int slot)
{
return 16;
}

@Override
public void setAndUpdateSlots(int slot)
{
super.setAndUpdateSlots(slot);
updateBlockState();
}

public void updateBlockState()
{
assert level != null;
final BlockState current = level.getBlockState(getBlockPos());
final int stage = Mth.clamp(Mth.ceil(inventory.getStackInSlot(0).getCount() * 10f / 16f), 0, 5);
if (current.hasProperty(AshtrayBlock.STAGE) && current.getValue(AshtrayBlock.STAGE) != stage)
{
level.setBlockAndUpdate(getBlockPos(), current.setValue(AshtrayBlock.STAGE, stage));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class FLBlockEntities
public static final RegistryObject<BlockEntityType<FoodShelfBlockEntity>> FOOD_SHELF = register("food_shelf", FoodShelfBlockEntity::new, Stream.of(FLBlocks.FOOD_SHELVES.values()).<Supplier<? extends Block>>flatMap(Helpers::flatten));
public static final RegistryObject<BlockEntityType<HangerBlockEntity>> HANGER = register("hanger", HangerBlockEntity::new, Stream.of(FLBlocks.HANGERS.values()).<Supplier<? extends Block>>flatMap(Helpers::flatten));
public static final RegistryObject<BlockEntityType<VatBlockEntity>> VAT = register("vat", VatBlockEntity::new, FLBlocks.VAT);
public static final RegistryObject<BlockEntityType<NutritiveBasinBlockEntity>> NUTRITIVE_BASIN = register("nutritive_basin", NutritiveBasinBlockEntity::new, FLBlocks.NUTRITIVE_BASIN);
public static final RegistryObject<BlockEntityType<AshTrayBlockEntity>> ASHTRAY = register("ashtray", AshTrayBlockEntity::new, FLBlocks.ASHTRAY);

public static final RegistryObject<BlockEntityType<LargePlanterBlockEntity>> LARGE_PLANTER = register("large_planter", LargePlanterBlockEntity::new, FLBlocks.LARGE_PLANTER);
public static final RegistryObject<BlockEntityType<BonsaiPlanterBlockEntity>> BONSAI_PLANTER = register("bonsai_planter", BonsaiPlanterBlockEntity::new, FLBlocks.BONSAI_PLANTER);
Expand Down

This file was deleted.

Loading

0 comments on commit 1727251

Please sign in to comment.