Skip to content

Commit

Permalink
actually get the firmalife book running properly
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Aug 21, 2022
1 parent 97db2cb commit 2cd272d
Show file tree
Hide file tree
Showing 31 changed files with 472 additions and 380 deletions.
2 changes: 1 addition & 1 deletion resources/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def generate(rm: ResourceManager):
for herb in ('basil', 'bay_laurel', 'cardamom', 'cilantro', 'cumin', 'oregano', 'pimento', 'vanilla'):
for stage in ('0', '1'):
rm.block_model('plant/%s_%s' % (herb, stage), parent='minecraft:block/cross', textures={'cross': 'firmalife:block/plant/%s/%s' % (herb, stage)})
rm.blockstate('plant/%s' % herb, variants={'stage=0': {'model': 'firmalife:block/plant/%s_0' % herb}, 'stage=1': {'model': 'firmalife:block/plant/%s_0' % herb}}).with_lang(lang(herb)).with_tag('firmalife:butterfly_grass_mutants')
rm.blockstate('plant/%s' % herb, variants={'stage=0': {'model': 'firmalife:block/plant/%s_0' % herb}, 'stage=1': {'model': 'firmalife:block/plant/%s_1' % herb}}).with_lang(lang(herb)).with_tag('firmalife:butterfly_grass_mutants')
simple_plant_data(rm, 'firmalife:plant/%s' % herb)
rm.item_model('plant/%s' % herb, 'firmalife:block/plant/%s/1' % herb)

Expand Down
346 changes: 26 additions & 320 deletions resources/generate_book.py

Large diffs are not rendered by default.

16 changes: 9 additions & 7 deletions resources/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,25 @@ def translate(self, text: str) -> str:

def flush(self):
""" Updates the local translation file, if needed """
pass


class ForLanguage(I18n):
def __init__(self, lang: str):
super().__init__(lang)
self.before = {}
self.after = {}
self.lang_path = './lang/%s.json' % lang

# Default translation
if not os.path.isfile(self.lang + '.json'):
print('Writing default translation for language %s' % self.lang)
with open(self.lang + '.json', 'w', encoding='utf-8') as f:
if not os.path.isfile(self.lang_path):
print('Writing default translation for language %s to %s' % (self.lang, self.lang_path))
with open(self.lang_path, 'w', encoding='utf-8') as f:
f.write('{}\n')

# Read the existing translation
with open(self.lang + '.json', 'r', encoding='utf-8') as f:
print('Reading translation for language %s' % self.lang)
with open(self.lang_path, 'r', encoding='utf-8') as f:
print('Reading translation for language %s to %s' % (self.lang, self.lang_path))
j = json.load(f)

# Parse json
Expand All @@ -55,7 +57,7 @@ def translate(self, text: str) -> str:
return translated

def flush(self):
with open(self.lang + '.json', 'w', encoding='utf-8') as f:
with open(self.lang_path, 'w', encoding='utf-8') as f:
print('Writing updated translation for language %s' % self.lang)
json.dump(self.after, f, indent=2)
json.dump(self.after, f, indent=2, ensure_ascii=False)

373 changes: 373 additions & 0 deletions resources/patchouli.py

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ authors="EERussianguy" #optional
description='''
An addon for TFC.
'''
[[dependencies.firmalife]] #optional
modId="forge" #mandatory
mandatory=true #mandatory
versionRange="[40,)" #mandatory
# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory
[[dependencies.firmalife]]
modId="forge"
mandatory=true
versionRange="[40,)"
ordering="NONE"
side="BOTH"
[[dependencies.firmalife]]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/basil_0"
},
"stage=1": {
"model": "firmalife:block/plant/basil_0"
"model": "firmalife:block/plant/basil_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/bay_laurel_0"
},
"stage=1": {
"model": "firmalife:block/plant/bay_laurel_0"
"model": "firmalife:block/plant/bay_laurel_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/cardamom_0"
},
"stage=1": {
"model": "firmalife:block/plant/cardamom_0"
"model": "firmalife:block/plant/cardamom_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/cilantro_0"
},
"stage=1": {
"model": "firmalife:block/plant/cilantro_0"
"model": "firmalife:block/plant/cilantro_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/cumin_0"
},
"stage=1": {
"model": "firmalife:block/plant/cumin_0"
"model": "firmalife:block/plant/cumin_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/oregano_0"
},
"stage=1": {
"model": "firmalife:block/plant/oregano_0"
"model": "firmalife:block/plant/oregano_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/pimento_0"
},
"stage=1": {
"model": "firmalife:block/plant/pimento_0"
"model": "firmalife:block/plant/pimento_1"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"model": "firmalife:block/plant/vanilla_0"
},
"stage=1": {
"model": "firmalife:block/plant/vanilla_0"
"model": "firmalife:block/plant/vanilla_1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"__comment__": "This file was automatically created by mcresources",
"extend": "tfc:field_guide"
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Beekeeping",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:beehive",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Bread",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "tfc:food/rye_bread",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Cellars",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:sealed_bricks",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Cheese",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:food/gouda",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Climate Station",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:climate_station",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Drying",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:drying_mat",
"pages": [
{
"type": "patchouli:text",
"text": "The $(thing)Drying Mat$() is used to dry items. It is made with $(thing)Fruit Leaves$(), which are obtained from breaking the leaves of $(thing)Fruit Trees$()."
},
{
"type": "patchouli:crafting",
"recipe": "firmalife:crafting/drying_mat",
"text": "The $(thing)Drying Mat$() is used to dry items. It is made with $(thing)Fruit Leaves$(), which are obtained from breaking the leaves of $(thing)Fruit Trees$()."
"text": "The recipe for the drying mat."
},
{
"type": "patchouli:text",
"text": "To use the drying mat, place it out on the sun and add an item to it with $(item)$(k:key.use)$(). After a half day, it will be dried. If it rains, the drying process must start over."
},
{
"type": "tfc:drying_recipe",
"type": "firmalife:drying_recipe",
"recipe": "firmalife:drying/drying_fruit",
"text": "Drying fruit is a common use of the drying mat. Dried fruit is used in some recipes, and lasts longer."
},
{
"type": "tfc:drying_recipe",
"type": "firmalife:drying_recipe",
"recipe": "firmalife:drying/tofu",
"text": "Tofu is made using a drying mat."
},
{
"type": "tfc:drying_recipe",
"type": "firmalife:drying_recipe",
"recipe": "firmalife:drying/cinnamon",
"text": "Cinnamon is made using a drying mat."
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Greenhouse",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:sealed_bricks",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Jars",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:empty_jar",
"pages": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Mixing Bowl",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:mixing_bowl",
"pages": [
{
"type": "patchouli:crafting",
"recipe": "firmalife:crafting/mixing_bowl",
"recipe2": "firmalife:crafting/spoon"
},
{
"type": "patchouli:text",
"text": "The mixing bowl is a way of mixing items and fluids together in a friendly way. $(item)$(k:key.use)$() on it with a $(thing)Spoon$() to add it to the bowl, which allows it to operate."
},
{
"type": "patchouli:crafting",
"recipe": "firmalife:crafting/mixing_bowl",
"text": "firmalife:crafting/spoon"
}
],
"read_by_default": true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "More Fertilizer Options",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:iron_composter",
"pages": [
{
"type": "patchouli:text",
"text": "Given a greater need for fertilization in Firmalife, there are more options for getting fertilizers."
},
{
"type": "tfc:drying_recipe",
"type": "firmalife:drying_recipe",
"recipe": "firmalife:drying/dry_grass",
"text": "Thatch can be $(l:firmalife/drying)Dried$() into $(thing)Dry Grass$(), which can be used in a Composter as a brown item."
},
{
"type": "patchouli:crafting",
"recipe": "firmalife:crafting/iron_composter",
"recipe2": "The Composter can be upgraded to an $(thing)Iron Composter$(), which works the same, except it produces compost four times as fast."
"text": "The Composter can be upgraded to an $(thing)Iron Composter$(), which works the same, except it produces compost four times as fast."
},
{
"type": "tfc:multimultiblock",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Ovens",
"category": "tfc:firmalife",
"icon": "firmalife:cured_top_oven",
"category": "firmalife:firmalife",
"icon": "firmalife:cured_oven_top",
"pages": [
{
"type": "patchouli:text",
"text": "$(thing)Ovens$() are a great way of cooking lots of food in a way that improves their shelf life. Oven-baked food decays at 90% of the rate of regular food. Ovens are a multiblock structure consisting of a $(thing)Bottom Oven$(), $(thing)Top Oven$(), and optionally $(thing)Chimneys$(). These blocks start off as clay, and must be $(thing)Cured$() by raising their temperature to a certain amount for long enough."
},
{
"type": "tfc:clay_knapping_recipe",
"recipe": "firmalife:clay_knapping/oven_top",
"recipe": "tfc:clay_knapping/oven_top",
"text": "The recipe for the top oven."
},
{
"type": "tfc:clay_knapping_recipe",
"recipe": "firmalife:clay_knapping/oven_bottom",
"recipe": "tfc:clay_knapping/oven_bottom",
"text": "The recipe for the top oven."
},
{
"type": "tfc:clay_knapping_recipe",
"recipe": "firmalife:clay_knapping/oven_chimney",
"recipe": "tfc:clay_knapping/oven_chimney",
"text": "The recipe for the top oven."
},
{
Expand Down Expand Up @@ -61,11 +61,11 @@
]
],
"mapping": {
"0": "firmalife:cured_top_oven",
"T": "firmalife:cured_top_oven",
"B": "firmalife:cured_bottom_oven",
"0": "firmalife:cured_oven_top",
"T": "firmalife:cured_oven_top",
"B": "firmalife:cured_oven_bottom",
"W": "minecraft:bricks",
"C": "firmalife:cured_chimney"
"C": "firmalife:cured_oven_chimney"
}
},
{
Expand All @@ -88,11 +88,11 @@
]
],
"mapping": {
"0": "firmalife:top_oven",
"T": "firmalife:top_oven",
"B": "firmalife:bottom_oven",
"0": "firmalife:oven_top",
"T": "firmalife:oven_top",
"B": "firmalife:oven_bottom",
"W": "minecraft:bricks",
"C": "firmalife:chimney"
"C": "firmalife:oven_chimney"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__comment__": "This file was automatically created by mcresources",
"name": "Planters",
"category": "tfc:firmalife",
"category": "firmalife:firmalife",
"icon": "firmalife:large_planter",
"pages": [
{
Expand Down
Loading

0 comments on commit 2cd272d

Please sign in to comment.