Skip to content

Commit

Permalink
wine fluids, trait transfer, wine glasses
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Jun 19, 2024
1 parent 4ead78b commit 85fa43b
Show file tree
Hide file tree
Showing 69 changed files with 679 additions and 59 deletions.
3 changes: 3 additions & 0 deletions resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ def generate(rm: ResourceManager):
flower_pot_cross(rm, '%s sapling' % fruit, 'firmalife:plant/potted/%s_sapling' % fruit, 'plant/flowerpot/%s_sapling' % fruit, 'firmalife:block/fruit_tree/%s_sapling' % fruit, 'firmalife:plant/%s_sapling' % fruit)

contained_fluid(rm, 'hollow_shell', 'firmalife:item/hollow_shell', 'firmalife:item/hollow_shell_overlay').with_lang(lang('Hollow Shell')).with_tag('tfc:buckets')
contained_fluid(rm, 'wine_glass', 'firmalife:item/wine_glass', 'firmalife:item/wine_glass_overlay').with_lang(lang('wine glass')).with_tag('tfc:buckets')

peel(rm, 'peel', 'firmalife:item/peel')

Expand Down Expand Up @@ -544,6 +545,8 @@ def generate(rm: ResourceManager):
rm.lang('firmalife.block_entity.%s' % be, lang(be))
for fluid in EXTRA_FLUIDS:
water_based_fluid(rm, fluid)
for fluid in WINES:
water_based_fluid(rm, fluid + '_wine')

for key, value in DEFAULT_LANG.items():
rm.lang(key, value)
Expand Down
6 changes: 5 additions & 1 deletion resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Wood(NamedTuple):
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', 'string', 'berry_bush', 'large_planter', 'bonsai_planter', 'trellis_planter', 'hanging_planter', 'quad_planter', 'climate_station', 'hydroponic_planter', 'vat', 'oven_hopper', 'ashtray', 'stovetop_grill', 'stovetop_pot', 'jarbnet', 'plate', 'big_barrel', 'jarring_station', 'barrel_press', 'stomping_barrel')
EXTRA_FLUIDS = ('yeast_starter', 'coconut_milk', 'yak_milk', 'goat_milk', 'curdled_yak_milk', 'curdled_goat_milk', 'pina_colada', 'cream', 'chocolate', 'sugar_water', 'fruity_fluid', 'mead')
WINES = ('red', 'white', 'rose', 'sparkling', 'dessert')
JARS: Sequence[Tuple[str, int, str]] = (
('honey', 1, 'firmalife:raw_honey'),
('compost', 8, 'tfc:compost'),
Expand Down Expand Up @@ -184,7 +185,7 @@ class Wood(NamedTuple):
'firmalife.tooltip.food_trait.smoked': 'Smoked',
'firmalife.tooltip.food_trait.rancid_smoked': 'Rancid Smoked',
'firmalife.tooltip.food_trait.fermented': 'Fermented',
'firmalife.tooltip.food_trait.bee_grown': 'Bee Grown',
'firmalife.tooltip.food_trait.bee_pollinated': 'Bee Pollinated',
'firmalife.tooltip.food_trait.slope_grown': 'Slope Grown',
'firmalife.tooltip.food_trait.dirt_grown': 'Dirt Grown',
'firmalife.tooltip.food_trait.gravel_grown': 'Gravel Grown',
Expand Down Expand Up @@ -265,6 +266,8 @@ class Wood(NamedTuple):
'firmalife.wine.making': 'Making %s Wine',
'firmalife.wine.how_to_open': 'Right click with a knife to pop the cork.',
'firmalife.wine.has_output': '%s servings of %s wine',
'firmalife.wine.need_cork': 'You need corks to bottle wine!',
'firmalife.wine.empty': 'Empty (may be cleaned in barrel of water)',
'greenhouse.firmalife.treated_wood': 'Treated Wood',
'greenhouse.firmalife.copper': 'Copper',
'greenhouse.firmalife.iron': 'Iron',
Expand Down Expand Up @@ -321,6 +324,7 @@ class Wood(NamedTuple):
'subtitles.item.firmalife.hollow_shell.blow': 'Shell whistles',

'item.firmalife.hollow_shell.filled': '%s Hollow Shell',
'item.firmalife.wine_glass.filled': 'Glass of %s',
'firmalife.screen.pumpkin_knapping': 'Pumpkin Knapping',
'tfc.jei.pumpkin_knapping': 'Pumpkin Knapping',
'tfc.jei.drying': 'Drying',
Expand Down
9 changes: 6 additions & 3 deletions resources/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def craft_decorations(recipe_name: str, base_block: str):
rm.crafting_shapeless('crafting/oxidized_copper_pipe', ('firmalife:copper_pipe', 'firmalife:copper_pipe', 'firmalife:copper_pipe', 'firmalife:copper_pipe', 'tfc:powder/wood_ash'), '4 firmalife:oxidized_copper_pipe').with_advancement('firmalife:copper_pipe')
rm.crafting_shapeless('crafting/irrigation_tank', ('#tfc:barrels', '#forge:sheets/bronze', 'firmalife:copper_pipe'), 'firmalife:irrigation_tank').with_advancement('firmalife:copper_pipe')
rm.crafting_shaped('crafting/pumping_station', ['SRS', 'BBB', 'ZZZ'], {'S': '#forge:sheets/bronze', 'R': '#forge:dusts/redstone', 'B': 'tfc:brass_mechanisms', 'Z': '#tfc:axles'}, 'firmalife:pumping_station').with_advancement('tfc:brass_mechanisms')
damage_shapeless(rm, 'crafting/chiseled_sealed_bricks', ('firmalife:sealed_bricks', '#tfc:chisels', 'tfc:mortar'), 'firmalife:chiseled_sealed_bricks').with_advancement('firmalife:sealed_bricks')
damage_shapeless(rm, 'crafting/polished_sealed_bricks', ('firmalife:sealed_bricks', '#tfc:chisels'), 'firmalife:polished_sealed_bricks').with_advancement('firmalife:sealed_bricks')
damage_shapeless(rm, 'crafting/chiseled_sealed_bricks', ('firmalife:polished_sealed_bricks', '#tfc:chisels'), 'firmalife:chiseled_sealed_bricks').with_advancement('firmalife:sealed_bricks')
damage_shapeless(rm, 'crafting/polished_sealed_bricks', ('firmalife:sealed_bricks', '#tfc:chisels', 'tfc:mortar'), 'firmalife:polished_sealed_bricks').with_advancement('firmalife:sealed_bricks')
damage_shapeless(rm, 'crafting/barrel_stave', ('firmalife:treated_lumber', 'firmalife:treated_lumber', '#forge:sheets/wrought_iron', '#tfc:hammers'), 'firmalife:barrel_stave').with_advancement('#forge:sheets/wrought_iron')
rm.crafting_shaped('crafting/grape_trellis_post', ['X', 'X', 'X'], {'X': 'firmalife:treated_lumber'}, 'firmalife:grape_trellis_post').with_advancement('firmalife:treated_lumber')
damage_shapeless(rm, 'crafting/bottle_label', ('minecraft:paper', '#tfc:knives', 'firmalife:beeswax'), '16 firmalife:bottle_label').with_advancement('firmalife:bottle_label')
Expand Down Expand Up @@ -211,6 +211,8 @@ def chisel_stair_slab(name: str, ingredient: str):
})

barrel_instant_recipe(rm, 'clean_any_bowl', '#firmalife:foods/washable', '100 minecraft:water', output_item=item_stack_provider(other_modifier='firmalife:empty_pan'))
for glass in ('olivine', 'volcanic', 'hematitic'):
barrel_instant_recipe(rm, 'clean_%s_wine_bottle' % glass, 'firmalife:%s_wine_bottle' % glass, '100 minecraft:water', output_item='firmalife:empty_%s_wine_bottle' % glass)

barrel_sealed_recipe(rm, 'yeast_starter', 'Yeast Starter', 24000 * 3, not_rotten(has_trait('#tfc:foods/fruits', 'firmalife:dried')), '100 minecraft:water', output_fluid='100 firmalife:yeast_starter')
barrel_sealed_recipe(rm, 'feed_yeast', 'Feeding Yeast', 12000, not_rotten('#firmalife:feeds_yeast'), '100 firmalife:yeast_starter', output_fluid='600 firmalife:yeast_starter')
Expand Down Expand Up @@ -271,7 +273,7 @@ def chisel_stair_slab(name: str, ingredient: str):
drying_recipe(rm, '%s_dirt' % dirt, 'tfc:mud/%s' % dirt, item_stack_provider('tfc:dirt/%s' % dirt))

stomping_recipe(rm, 'red_grapes', not_rotten(lacks_trait('firmalife:food/red_grapes', 'firmalife:dried')), item_stack_provider('firmalife:food/smashed_red_grapes'), 'firmalife:block/red_unsmashed_grapes', 'firmalife:block/red_smashed_grapes')
stomping_recipe(rm, 'white_grapes', not_rotten(lacks_trait('firmalife:food/white_grapes', 'firmalife:dried')), item_stack_provider('firmalife:food/smashed_red_grapes'), 'firmalife:block/white_unsmashed_grapes', 'firmalife:block/white_smashed_grapes')
stomping_recipe(rm, 'white_grapes', not_rotten(lacks_trait('firmalife:food/white_grapes', 'firmalife:dried')), item_stack_provider('firmalife:food/smashed_white_grapes'), 'firmalife:block/white_unsmashed_grapes', 'firmalife:block/white_smashed_grapes')
stomping_recipe(rm, 'charcoal', 'minecraft:charcoal', item_stack_provider('4 tfc:powder/charcoal'), 'tfc:block/charcoal_pile', 'tfc:block/powder/charcoal', 'tfc:block.charcoal.fall')

smoking_recipe(rm, 'meat', not_rotten(has_trait(lacks_trait('#tfc:foods/raw_meats', 'firmalife:smoked'), 'tfc:brined')), item_stack_provider(copy_input=True, add_trait='firmalife:smoked'))
Expand Down Expand Up @@ -452,6 +454,7 @@ def chisel_stair_slab(name: str, ingredient: str):
glass_recipe(rm, 'reinforced_glass_pane', ['flatten', 'soda_ash', 'table_pour'], 'tfc:silica_glass_batch', 'firmalife:reinforced_poured_glass')
for glass in ('olivine', 'hematitic', 'volcanic'):
glass_recipe(rm, '%s_wine_bottle' % glass, ['blow', 'blow', 'pinch', 'saw'], 'tfc:%s_glass_batch' % glass, 'firmalife:empty_%s_wine_bottle' % glass)
glass_recipe(rm, 'wine_glass', ['blow', 'blow', 'pinch', 'saw'], 'tfc:silica_glass_batch', '2 firmalife:wine_glass')

for recipe in DISABLED_TFC_RECIPES:
rm.domain = 'tfc' # DOMAIN CHANGE
Expand Down
3 changes: 2 additions & 1 deletion resources/tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ def generate(rm: ResourceManager):
rm.entity_tag('drops_rennet', 'tfc:goat', 'tfc:yak')
rm.entity_tag('drops_three_rennet', 'tfc:cow', 'tfc:sheep', 'tfc:musk_ox')

rm.fluid_tag('tfc:alcohols', 'firmalife:pina_colada', 'firmalife:mead')
rm.fluid_tag('tfc:alcohols', 'firmalife:pina_colada', 'firmalife:mead', *['firmalife:%s_wine' % r for r in WINES])
rm.fluid_tag('tfc:milks', 'firmalife:yak_milk', 'firmalife:goat_milk', 'firmalife:coconut_milk')
rm.fluid_tag('tfc:drinkables', 'firmalife:chocolate')
rm.fluid_tag('tfc:ingredients', *['firmalife:%s' % fluid for fluid in EXTRA_FLUIDS])
rm.fluid_tag('usable_in_mixing_bowl', '#tfc:usable_in_pot')
rm.fluid_tag('usable_in_hollow_shell', '#tfc:usable_in_wooden_bucket')
rm.fluid_tag('usable_in_wine_glass', '#tfc:drinkables')
rm.fluid_tag('usable_in_vat', '#tfc:usable_in_pot', 'firmalife:fruity_fluid')

# Ore tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ public static void onItemColors(RegisterColorHandlersEvent.Item event)
event.register(new DynamicFluidContainerModel.Colors(), fluid.getBucket());
}
}
event.register(new DynamicFluidContainerModel.Colors(), FLItems.HOLLOW_SHELL.get());
event.register(new DynamicFluidContainerModel.Colors(), FLItems.WINE_GLASS.get());
}

public static void registerParticleFactories(RegisterParticleProvidersEvent event)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.entity.player.Inventory;

import net.dries007.tfc.client.screen.BlockEntityScreen;
import net.dries007.tfc.common.capabilities.Capabilities;

public class BarrelPressScreen extends BlockEntityScreen<BarrelPressBlockEntity, BarrelPressContainer>
{
Expand All @@ -26,7 +27,8 @@ protected void renderLabels(GuiGraphics graphics, int mouseX, int mouseY)
super.renderLabels(graphics, mouseX, mouseY);
if (blockEntity.getOutput() != null)
{
graphics.drawWordWrap(font, Component.translatable("firmalife.wine.has_output", blockEntity.getOutput().getServings(), FLHelpers.translateEnum(blockEntity.getOutput().getType())), 17, 40, 110, 0x404040);
final boolean hasCork = blockEntity.getCapability(Capabilities.ITEM).map(inv -> !inv.getStackInSlot(BarrelPressBlockEntity.SLOT_CORK).isEmpty()).orElse(false);
graphics.drawWordWrap(font, hasCork ? Component.translatable("firmalife.wine.has_output", blockEntity.getOutput().getServings(), FLHelpers.translateEnum(blockEntity.getOutput().getType())) : Component.translatable("firmalife.wine.need_cork"), 17, 40, 110, 0x404040);
return;
}
final WineType type = blockEntity.getWineType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public static void fillFirmalifeTab(CreativeModeTab.ItemDisplayParameters parame
accept(out, FLItems.BEEHIVE_FRAME);
accept(out, FLItems.CHEESECLOTH);
accept(out, FLItems.FRUIT_LEAF);
accept(out, FLItems.HOLLOW_SHELL);
accept(out, FLItems.ICE_SHAVINGS);
accept(out, FLItems.OVEN_INSULATION);
accept(out, FLItems.PEEL);
Expand All @@ -75,6 +74,7 @@ public static void fillFirmalifeTab(CreativeModeTab.ItemDisplayParameters parame
accept(out, FLItems.EMPTY_HEMATITIC_WINE_BOTTLE);
accept(out, FLItems.EMPTY_VOLCANIC_WINE_BOTTLE);
accept(out, FLItems.CORK);
accept(out, FLItems.BOTTLE_LABEL);
accept(out, FLItems.BARREL_STAVE);
accept(out, FLItems.RED_GRAPE_SEEDS);
accept(out, FLItems.WHITE_GRAPE_SEEDS);
Expand Down Expand Up @@ -131,6 +131,7 @@ else if (type == OvenType.TILE)
accept(out, FLBlocks.SEALED_WALL);
accept(out, FLBlocks.SEALED_TRAPDOOR);
accept(out, FLItems.HOLLOW_SHELL);
accept(out, FLItems.WINE_GLASS);
accept(out, FLItems.TREATED_LUMBER);
accept(out, FLBlocks.TREATED_WOOD);
for (Wood wood : Wood.values())
Expand Down Expand Up @@ -233,6 +234,7 @@ else if (out.getTab() == TFCCreativeTabs.MISC.tab().get())
{
FLItems.METAL_FLUID_BUCKETS.values().forEach(reg -> accept(out, reg));
FLItems.EXTRA_FLUID_BUCKETS.values().forEach(reg -> accept(out, reg));
FLItems.WINE_FLUID_BUCKETS.values().forEach(reg -> accept(out, reg));
}
}

Expand Down
33 changes: 33 additions & 0 deletions src/main/java/com/eerussianguy/firmalife/common/FLHelpers.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import net.dries007.tfc.common.blockentities.TickCounterBlockEntity;
import net.dries007.tfc.common.capabilities.Capabilities;
import net.dries007.tfc.common.capabilities.food.FoodCapability;
import net.dries007.tfc.common.capabilities.food.FoodTrait;
import net.dries007.tfc.util.Helpers;
import net.dries007.tfc.util.JsonHelpers;

Expand Down Expand Up @@ -79,6 +80,38 @@ public static void resetCounter(Level level, BlockPos pos)
}
}

public static void writeTraitList(List<FoodTrait> list, CompoundTag nbt, String key)
{
if (!list.isEmpty())
{
final ListTag listTag = new ListTag();
for (FoodTrait trait : list)
{
final CompoundTag newTag = new CompoundTag();
newTag.putString("trait", FoodTrait.getId(trait).toString());
listTag.add(newTag);
}
nbt.put(key, listTag);
}
}

public static void readTraitList(List<FoodTrait> list, CompoundTag nbt, String key)
{
list.clear();
if (nbt.contains(key))
{
final ListTag excessNbt = nbt.getList(key, Tag.TAG_COMPOUND);
for (int i = 0; i < excessNbt.size(); i++)
{
final FoodTrait trait = FoodTrait.getTrait(new ResourceLocation(excessNbt.getCompound(i).getString("trait")));
if (trait != null)
{
list.add(trait);
}
}
}
}

public static void writeItemStackList(List<ItemStack> list, CompoundTag nbt, String key)
{
if (!list.isEmpty())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public static class Fluids
{
public static final TagKey<Fluid> USABLE_IN_MIXING_BOWL = create("usable_in_mixing_bowl");
public static final TagKey<Fluid> USABLE_IN_HOLLOW_SHELL = create("usable_in_hollow_shell");
public static final TagKey<Fluid> USABLE_IN_WINE_GLASS = create("usable_in_wine_glass");
public static final TagKey<Fluid> USABLE_IN_VAT = create("usable_in_vat");

private static TagKey<Fluid> create(String id)
Expand Down
Loading

0 comments on commit 85fa43b

Please sign in to comment.