Skip to content

Commit

Permalink
add recipes for hangers/shelves, fix planters giving you decayed food
Browse files Browse the repository at this point in the history
  • Loading branch information
eerussianguy committed Oct 28, 2022
1 parent 4b72150 commit 8e95921
Show file tree
Hide file tree
Showing 78 changed files with 2,097 additions and 2 deletions.
4 changes: 4 additions & 0 deletions resources/recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ def generate(rm: ResourceManager):
}
})

for wood in TFC_WOODS.keys():
rm.crafting_shaped('crafting/wood/%s_hanger' % wood, ['XXX', ' Y ', ' Y ', ], {'X': 'tfc:wood/planks/%s' % wood, 'Y': '#forge:string'}, 'firmalife:wood/hanger/%s' % wood).with_advancement('tfc:wood/lumber/%s' % wood)
rm.crafting_shaped('crafting/wood/%s_shelf' % wood, ['XXX', 'YYY', 'XXX'], {'X': 'tfc:wood/planks/%s' % wood, 'Y': 'tfc:wood/lumber/%s' % wood}, 'firmalife:wood/food_shelf/%s' % wood).with_advancement('tfc:wood/lumber/%s' % wood)

for jar, remainder, _, ing in JARS:
make_jar(rm, jar, remainder, ing)
for fruit in TFC_FRUITS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.eerussianguy.firmalife.common.FLHelpers;
import com.eerussianguy.firmalife.common.blocks.greenhouse.PlanterType;
import net.dries007.tfc.common.blockentities.FarmlandBlockEntity;
import net.dries007.tfc.common.capabilities.food.FoodCapability;
import net.dries007.tfc.network.DataManagerSyncPacket;
import net.dries007.tfc.util.DataManager;
import net.dries007.tfc.util.ItemDefinition;
Expand Down Expand Up @@ -67,7 +68,7 @@ private Plantable(ResourceLocation id, JsonObject json)
stages = JsonHelpers.getAsInt(json, "stages", 0);
extraSeedChance = JsonHelpers.getAsFloat(json, "extra_seed_chance", 0.5f);
seed = json.has("seed") ? JsonHelpers.getItemStack(json, "seed") : ItemStack.EMPTY;
crop = JsonHelpers.getItemStack(json, "crop");
crop = FoodCapability.setStackNonDecaying(JsonHelpers.getItemStack(json, "crop"));
nutrient = JsonHelpers.getEnum(json, "nutrient", FarmlandBlockEntity.NutrientType.class, FarmlandBlockEntity.NutrientType.NITROGEN);
texture = JsonHelpers.getAsString(json, "texture");
}
Expand Down Expand Up @@ -115,7 +116,7 @@ public ItemStack getSeed()

public ItemStack getCrop()
{
return crop.copy();
return FoodCapability.updateFoodDecayOnCreate(crop.copy());
}

public FarmlandBlockEntity.NutrientType getPrimaryNutrient()
Expand Down
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": [
"tfc:wood/lumber/acacia"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/acacia_hanger"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/acacia_hanger"
]
}
}
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": [
"tfc:wood/lumber/acacia"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/acacia_shelf"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/acacia_shelf"
]
}
}
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": [
"tfc:wood/lumber/ash"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/ash_hanger"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/ash_hanger"
]
}
}
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": [
"tfc:wood/lumber/ash"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/ash_shelf"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/ash_shelf"
]
}
}
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": [
"tfc:wood/lumber/aspen"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/aspen_hanger"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/aspen_hanger"
]
}
}
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": [
"tfc:wood/lumber/aspen"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/aspen_shelf"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/aspen_shelf"
]
}
}
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": [
"tfc:wood/lumber/birch"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/birch_hanger"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/birch_hanger"
]
}
}
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": [
"tfc:wood/lumber/birch"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/birch_shelf"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/birch_shelf"
]
}
}
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": [
"tfc:wood/lumber/blackwood"
]
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "firmalife:crafting/wood/blackwood_hanger"
}
}
},
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"firmalife:crafting/wood/blackwood_hanger"
]
}
}
Loading

0 comments on commit 8e95921

Please sign in to comment.