Skip to content

Commit

Permalink
update to and fix issues with latest TFC version, add production path…
Browse files Browse the repository at this point in the history
… for pumpkin pie, fix oven knapping, ensure recipes from firmalife override TFC ones, fix pack format,
  • Loading branch information
eerussianguy committed Aug 26, 2022
1 parent ec8aee8 commit 3943296
Show file tree
Hide file tree
Showing 90 changed files with 677 additions and 28 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mixin_version=0.8.5
jei_version=9.7.1.232
patchouli_version=1.18.2-70
tfc_version=0.0.0-indev
tfc_identifier=3943694
tfc_identifier=3946866
4 changes: 2 additions & 2 deletions resources/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Vein = NamedTuple('Vein', ore=str, type=str, rarity=int, size=int, min_y=int, max_y=int, density=float, poor=float, normal=float, rich=float, rocks=List[str], spoiler_ore=str, spoiler_rarity=int, spoiler_rocks=List[str], biomes=Optional[str], height=Optional[int], deposits=bool)

SIMPLE_ITEMS = ('peel', 'fruit_leaf', 'cinnamon_bark', 'beeswax', 'pineapple_leather', 'pineapple_yarn', 'raw_honey', 'rennet', 'watering_can', 'treated_lumber', 'beehive_frame', 'empty_jar', 'cheesecloth', 'spoon', 'pie_pan', 'seed_ball')
SIMPLE_FOODS = ('frothy_coconut', 'white_chocolate_blend', 'dark_chocolate_blend', 'milk_chocolate_blend', 'tofu', 'soy_mixture', 'yak_curd', 'goat_curd', 'milk_curd', 'cheddar', 'chevre', 'rajya_metok', 'gouda', 'feta', 'shosha', 'butter', 'pie_dough', 'filled_pie', 'cooked_pie', 'pizza_dough', 'raw_pizza', 'cooked_pizza', 'shredded_cheese', 'pickled_egg')
SIMPLE_FOODS = ('frothy_coconut', 'white_chocolate_blend', 'dark_chocolate_blend', 'milk_chocolate_blend', 'tofu', 'soy_mixture', 'yak_curd', 'goat_curd', 'milk_curd', 'cheddar', 'chevre', 'rajya_metok', 'gouda', 'feta', 'shosha', 'butter', 'pie_dough', 'filled_pie', 'cooked_pie', 'pizza_dough', 'raw_pizza', 'cooked_pizza', 'shredded_cheese', 'pickled_egg', 'pumpkin_pie_dough', 'raw_pumpkin_pie', 'cooked_pumpkin_pie')
SIMPLE_SPICES = ('ground_cinnamon', 'cinnamon')
SIMPLE_BLOCKS: Dict[str, str] = {
'sealed_bricks': 'minecraft:mineable/pickaxe'
Expand Down Expand Up @@ -82,7 +82,7 @@
'right': ['XXXXX', 'X X', 'XXX X', 'XXX X', 'XXXXX'],
}

DISABLED_TFC_RECIPES = ('crafting/pumpkin_pie',)
DISABLED_TFC_RECIPES = ()

# Default parameters for common ore veins
# rarity, size, min_y, max_y, density, poor, normal, rich
Expand Down
5 changes: 4 additions & 1 deletion resources/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def generate(rm: ResourceManager):
rm.item_tag('tfc:foods/can_be_salted', 'firmalife:food/butter')
rm.item_tag('tfc:usable_on_tool_rack', 'firmalife:spoon')
rm.item_tag('pumpkin_knapping', 'tfc:pumpkin')
rm.item_tag('foods/heatable', 'firmalife:food/raw_pizza', 'firmalife:food/filled_pie')
rm.item_tag('foods/heatable', 'firmalife:food/raw_pizza', 'firmalife:food/filled_pie', 'firmalife:food/raw_pumpkin_pie')
rm.item_tag('foods/dynamic', 'firmalife:food/raw_pizza', 'firmalife:food/filled_pie', 'firmalife:food/cooked_pizza', 'firmalife:food/cooked_pie')
rm.item_tag('foods/washable', 'firmalife:food/filled_pie', 'firmalife:food/cooked_pie')
rm.item_tag('pie_pans', 'firmalife:pie_pan')
Expand Down Expand Up @@ -140,6 +140,9 @@ def generate(rm: ResourceManager):
decayable(rm, 'butter', 'firmalife:food/butter', Category.dairy)
decayable(rm, 'pie_dough', 'firmalife:food/pie_dough', Category.other)
food_item(rm, 'pumpkin_chunks', 'firmalife:food/pumpkin_chunks', Category.fruit, 4, 1, 5, 1.5, fruit=1)
decayable(rm, 'pumpkin_pie_dough', 'firmalife:food/pumpkin_pie_dough', Category.other)
decayable(rm, 'raw_pumpkin_pie', 'firmalife:food/raw_pumpkin_pie', Category.other)
decayable(rm, 'cooked_pumpkin_pie', 'firmalife:food/cooked_pumpkin_pie', Category.other)

item_size(rm, 'jars', '#firmalife:jars', Size.very_large, Weight.medium)
item_size(rm, 'beehive_frame', 'firmalife:beehive_frame', Size.very_small, Weight.very_heavy)
Expand Down
2 changes: 1 addition & 1 deletion resources/generate_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def make_book(rm: ResourceManager, i18n: I18n, local_instance: bool = False):
)),
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/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!'),
crafting('tfc:crafting/barley_dough', text_contents='Yeast Starter, Sugar, and Flour can be combined to make $(thing)Dough$(). Dough can be cooked like normal to produce $(thing)Bread!$().'),
crafting('firmalife:crafting/barley_dough', text_contents='Yeast Starter, Sugar, and Flour can be combined to make $(thing)Dough$(). Dough can be cooked like normal to produce $(thing)Bread!$().'),
)),
entry('more_fertilizer', 'More Fertilizer Options', 'firmalife:iron_composter', pages=(
text('Given a greater need for fertilization in Firmalife, there are more options for getting fertilizers.'),
Expand Down
13 changes: 11 additions & 2 deletions resources/recipes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from enum import Enum
from itertools import repeat
from typing import Union

from mcresources import ResourceManager, RecipeContext, utils
Expand Down Expand Up @@ -68,6 +69,10 @@ def generate(rm: ResourceManager):
damage_shapeless(rm, 'crafting/shredded_cheese', ('#tfc:knives', '#firmalife:foods/cheeses'), '4 firmalife:food/shredded_cheese').with_advancement('#firmalife:foods/cheeses')
rm.crafting_shapeless('crafting/pickled_egg', ('minecraft:clay_ball', 'tfc:powder/wood_ash', 'tfc:powder/salt', 'tfc:food/boiled_egg'), 'firmalife:food/pickled_egg')
rm.crafting_shaped('crafting/seed_ball', [' X ', 'XYX', ' X '], {'X': '#tfc:seeds', 'Y': 'tfc:compost'}, 'firmalife:seed_ball').with_advancement('tfc:compost')
rm.crafting_shapeless('crafting/raw_pumpkin_pie', ('firmalife:food/pumpkin_pie_dough', 'firmalife:pie_pan'), 'firmalife:food/raw_pumpkin_pie').with_advancement('firmalife:food/pumpkin_pie_dough')
rm.domain = 'tfc'
rm.crafting_shapeless('crafting/pumpkin_pie', ('firmalife:food/cooked_pumpkin_pie',), 'minecraft:pumpkin_pie').with_advancement('firmalife:food/cooked_pumpkin_pie')
rm.domain = 'firmalife'

for jar, remainder, _, ing in JARS:
make_jar(rm, jar, remainder, ing)
Expand Down Expand Up @@ -104,11 +109,12 @@ def generate(rm: ResourceManager):
rm.domain = 'firmalife' # DOMAIN RESET

clay_knapping(rm, 'oven_top', ['XXXXX', 'XX XX', 'X X', 'X X', 'XXXXX'], 'firmalife:oven_top')
clay_knapping(rm, 'oven_bottom', ['XX XX', 'X X', 'X X', 'XXXXX'], 'firmalife:oven_bottom')
clay_knapping(rm, 'oven_bottom', ['XX XX', 'X X', 'X X', 'XX XX', 'XXXXX'], 'firmalife:oven_bottom')
clay_knapping(rm, 'oven_chimney', ['XX XX', 'XX XX', 'XX XX'], 'firmalife:oven_chimney')

heat_recipe(rm, 'cooked_pie', 'firmalife:food/filled_pie', 400, result_item=item_stack_provider('firmalife:food/cooked_pie', other_modifier='firmalife:copy_dynamic_food', remove_trait='firmalife:raw'))
heat_recipe(rm, 'cooked_pizza', 'firmalife:food/raw_pizza', 400, result_item=item_stack_provider('firmalife:food/cooked_pizza', other_modifier='firmalife:copy_dynamic_food', remove_trait='firmalife:raw'))
heat_recipe(rm, 'pumpkin_pie', 'firmalife:food/raw_pumpkin_pie', 400, result_item=item_stack_provider('firmalife:food/cooked_pumpkin_pie'))

# Firmalife Recipes
for carving, pattern in CARVINGS.items():
Expand All @@ -126,6 +132,7 @@ def generate(rm: ResourceManager):

mixing_recipe(rm, 'butter', ingredients=[utils.ingredient('tfc:powder/salt')], fluid='1000 firmalife:cream', output_item='firmalife:food/butter')
mixing_recipe(rm, 'pie_dough', ingredients=[not_rotten('firmalife:food/butter'), not_rotten('#tfc:foods/flour'), utils.ingredient('#firmalife:sweetener')], fluid='1000 minecraft:water', output_item='firmalife:food/pie_dough')
mixing_recipe(rm, 'pumpkin_pie_dough', ingredients=[not_rotten('minecraft:egg'), not_rotten('firmalife:food/pumpkin_chunks'), not_rotten('firmalife:food/pumpkin_chunks'), not_rotten('#tfc:foods/flour'), utils.ingredient('#firmalife:sweetener')], fluid='1000 minecraft:water', output_item='firmalife:food/pumpkin_pie_dough')
mixing_recipe(rm, 'pizza_dough', ingredients=[not_rotten('#tfc:foods/dough'), utils.ingredient('tfc:powder/salt')], fluid='1000 tfc:olive_oil', output_item='4 firmalife:food/pizza_dough')

meal_shapeless(rm, 'crafting/filled_pie', ('firmalife:food/pie_dough', '#firmalife:foods/preserves', '#firmalife:pie_pans'), 'firmalife:food/filled_pie', 'firmalife:pie').with_advancement('firmalife:food/pie_dough')
Expand All @@ -150,8 +157,10 @@ def generate(rm: ResourceManager):
for grain in TFC_GRAINS:
damage_shapeless(rm, 'crafting/%s_slice' % grain, ('tfc:food/%s_bread' % grain, '#tfc:knives'), '2 firmalife:food/%s_slice' % grain).with_advancement('tfc:food/%s_bread' % grain)

rm.domain = 'tfc' # DOMAIN CHANGE
rm.crafting_shapeless('crafting/%s_dough' % grain, (not_rotten('tfc:food/%s_flour' % grain), fluid_item_ingredient('100 firmalife:yeast_starter'), '#firmalife:sweetener'), (4, 'tfc:food/%s_dough' % grain)).with_advancement('tfc:food/%s_grain' % grain)
rm.domain = 'tfc' # DOMAIN CHANGE
for i in range(1, 9):
disable_recipe(rm, 'crafting/dough/%s_dough_%s' % (grain, i))
rm.domain = 'firmalife' # DOMAIN RESET

ore = 'chromite'
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/eerussianguy/firmalife/FirmaLife.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import com.eerussianguy.firmalife.client.FLClientEvents;
import com.eerussianguy.firmalife.client.FLClientForgeEvents;
import com.eerussianguy.firmalife.common.FLEvents;
import com.eerussianguy.firmalife.common.FLForgeEvents;
import com.eerussianguy.firmalife.common.blockentities.FLBlockEntities;
import com.eerussianguy.firmalife.common.blocks.FLBlocks;
Expand Down Expand Up @@ -54,6 +55,7 @@ public FirmaLife()

FLPackets.init();

FLEvents.init();
bus.addListener(this::setup);

FLForgeEvents.init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
import net.minecraft.client.renderer.entity.ThrownItemRenderer;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.model.ForgeModelBakery;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.registries.RegistryObject;

import com.eerussianguy.firmalife.client.render.*;
import com.eerussianguy.firmalife.client.screen.BeehiveScreen;
Expand Down
49 changes: 49 additions & 0 deletions src/main/java/com/eerussianguy/firmalife/common/FLEvents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package com.eerussianguy.firmalife.common;

import java.io.IOException;

import net.minecraft.network.chat.TextComponent;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.metadata.pack.PackMetadataSection;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackSource;
import net.minecraftforge.event.AddPackFindersEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.resource.PathResourcePack;

import com.eerussianguy.firmalife.FirmaLife;

public class FLEvents
{
public static void init()
{
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();

bus.addListener(FLEvents::onPackFinder);
}

public static void onPackFinder(AddPackFindersEvent event)
{
try
{
if (event.getPackType() == PackType.SERVER_DATA)
{
var resourcePath = ModList.get().getModFileById(FirmaLife.MOD_ID).getFile().getFilePath();
var pack = new PathResourcePack(ModList.get().getModFileById(FirmaLife.MOD_ID).getFile().getFileName() + ":" + resourcePath, resourcePath);
var metadata = pack.getMetadataSection(PackMetadataSection.SERIALIZER);
if (metadata != null)
{
event.addRepositorySource((consumer, constructor) ->
consumer.accept(constructor.create("builtin/firmalife_data", new TextComponent("Firmalife Data"), true, () -> pack, metadata, Pack.Position.TOP, PackSource.BUILT_IN, false))
);
}
}
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public enum FLFood
SHOSHA,
BUTTER,
PIE_DOUGH,
PUMPKIN_PIE_DOUGH,
RAW_PUMPKIN_PIE,
COOKED_PUMPKIN_PIE,
PIZZA_DOUGH,
SHREDDED_CHEESE,
PICKLED_EGG,
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/assets/firmalife/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@
"item.firmalife.food.cooked_pizza": "Cooked Pizza",
"item.firmalife.food.shredded_cheese": "Shredded Cheese",
"item.firmalife.food.pickled_egg": "Pickled Egg",
"item.firmalife.food.pumpkin_pie_dough": "Pumpkin Pie Dough",
"item.firmalife.food.raw_pumpkin_pie": "Raw Pumpkin Pie",
"item.firmalife.food.cooked_pumpkin_pie": "Cooked Pumpkin Pie",
"item.firmalife.food.wheat_slice": "Wheat Slice",
"item.firmalife.food.rye_slice": "Rye Slice",
"item.firmalife.food.barley_slice": "Barley Slice",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"parent": "item/generated",
"textures": {
"layer0": "firmalife:item/food/cooked_pumpkin_pie"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"parent": "item/generated",
"textures": {
"layer0": "firmalife:item/food/pumpkin_pie_dough"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"parent": "item/generated",
"textures": {
"layer0": "firmalife:item/food/raw_pumpkin_pie"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/barley_dough"
"recipe": "firmalife:crafting/barley_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/barley_dough"
"firmalife:crafting/barley_dough"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/maize_dough"
"recipe": "firmalife:crafting/maize_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/maize_dough"
"firmalife:crafting/maize_dough"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/oat_dough"
"recipe": "firmalife:crafting/oat_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/oat_dough"
"firmalife:crafting/oat_dough"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"__comment__": "This file was automatically created by mcresources",
"parent": "minecraft:recipes/root",
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"items": [
"firmalife:food/pumpkin_pie_dough"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/raw_pumpkin_pie"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/raw_pumpkin_pie"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/rice_dough"
"recipe": "firmalife:crafting/rice_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/rice_dough"
"firmalife:crafting/rice_dough"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/rye_dough"
"recipe": "firmalife:crafting/rye_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/rye_dough"
"firmalife:crafting/rye_dough"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "tfc:crafting/wheat_dough"
"recipe": "firmalife:crafting/wheat_dough"
}
}
},
Expand All @@ -29,7 +29,7 @@
],
"rewards": {
"recipes": [
"tfc:crafting/wheat_dough"
"firmalife:crafting/wheat_dough"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
{
"type": "patchouli:crafting",
"recipe": "tfc:crafting/barley_dough",
"recipe": "firmalife:crafting/barley_dough",
"text": "Yeast Starter, Sugar, and Flour can be combined to make $(thing)Dough$(). Dough can be cooked like normal to produce $(thing)Bread!$()."
}
],
Expand Down
Loading

0 comments on commit 3943296

Please sign in to comment.