From b795a3599ec5e4d0fa518f30c9438ce202813ab1 Mon Sep 17 00:00:00 2001 From: Drefvelin <54400154+Drefvelin@users.noreply.github.com> Date: Thu, 24 Sep 2026 10:31:01 +0000 Subject: [PATCH] feat: fry eggs using chicken genetics for quality Whole eggs stay raw and inedible, spoil into a rotten egg texture, and become edible only after they are fried. Chickens lay that ingredient with stars from their genetics. Co-authored-by: Cursor --- .../tfmc_cooking/contents/categories.yml | 5 + ItemsAdder/tfmc_cooking/contents/items.yml | 35 +++ .../item/ingredients/egg/fried_egg_burnt.json | 281 ++++++++++++++++++ .../ingredients/egg/fried_egg_cooked.json | 281 ++++++++++++++++++ .../item/ingredients/egg/fried_egg_raw.json | 281 ++++++++++++++++++ .../ingredients/egg/fried_egg_rotten.json | 281 ++++++++++++++++++ .../models/item/vanilla/egg_rotten.json | 6 + .../item/ingredients/egg/burnt_whites.png | Bin 0 -> 207 bytes .../item/ingredients/egg/burnt_yolk.png | Bin 0 -> 180 bytes .../item/ingredients/egg/cooked_whites.png | Bin 0 -> 206 bytes .../item/ingredients/egg/cooked_yolk.png | Bin 0 -> 193 bytes .../item/ingredients/egg/raw_whites.png | Bin 0 -> 202 bytes .../item/ingredients/egg/raw_yolk.png | Bin 0 -> 163 bytes .../item/ingredients/egg/rotten_whites.png | Bin 0 -> 263 bytes .../item/ingredients/egg/rotten_yolk.png | Bin 0 -> 175 bytes .../textures/item/vanilla/egg_rotten.png | Bin 0 -> 233 bytes .../cooking/cooking/FryingReference.java | 25 +- .../tfminecraft/cooking/item/FoodItem.java | 14 +- src/main/resources/config.yml | 1 + src/main/resources/conversions.yml | 1 + src/main/resources/husbandry.yml | 2 +- src/main/resources/models.yml | 99 ++++++ src/main/resources/types.yml | 19 ++ .../cooking/item/EggIngredientTest.java | 69 +++++ 24 files changed, 1397 insertions(+), 3 deletions(-) create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_burnt.json create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_cooked.json create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_raw.json create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_rotten.json create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/vanilla/egg_rotten.json create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_whites.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_yolk.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_whites.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_yolk.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_whites.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_yolk.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_whites.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_yolk.png create mode 100644 ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/vanilla/egg_rotten.png create mode 100644 src/test/java/net/tfminecraft/cooking/item/EggIngredientTest.java diff --git a/ItemsAdder/tfmc_cooking/contents/categories.yml b/ItemsAdder/tfmc_cooking/contents/categories.yml index a9eacec..cfc3498 100644 --- a/ItemsAdder/tfmc_cooking/contents/categories.yml +++ b/ItemsAdder/tfmc_cooking/contents/categories.yml @@ -82,6 +82,7 @@ categories: - tfmc_cooking:carrot_rotten - tfmc_cooking:wheat_rotten - tfmc_cooking:apple_rotten + - tfmc_cooking:egg_rotten - tfmc_cooking:beetroot_rotten - tfmc_cooking:potato_rotten - tfmc_cooking:cut_carrot @@ -299,6 +300,10 @@ categories: - tfmc_cooking:cream - tfmc_cooking:egg_carton - tfmc_cooking:fried_egg + - tfmc_cooking:fried_egg_raw + - tfmc_cooking:fried_egg_cooked + - tfmc_cooking:fried_egg_burnt + - tfmc_cooking:fried_egg_rotten - tfmc_cooking:grilled_mushroom - tfmc_cooking:maple_syrup - tfmc_cooking:mashed_potatoes diff --git a/ItemsAdder/tfmc_cooking/contents/items.yml b/ItemsAdder/tfmc_cooking/contents/items.yml index a406b47..e856b38 100644 --- a/ItemsAdder/tfmc_cooking/contents/items.yml +++ b/ItemsAdder/tfmc_cooking/contents/items.yml @@ -29,6 +29,41 @@ items: generate: false model_path: item/vanilla/apple_rotten + egg_rotten: + display_name: "Egg Rotten" + resource: + material: EGG + generate: false + model_path: item/vanilla/egg_rotten + + fried_egg_raw: + display_name: "Fried Egg Raw" + resource: + material: TROPICAL_FISH + generate: false + model_path: item/ingredients/egg/fried_egg_raw + + fried_egg_cooked: + display_name: "Fried Egg Cooked" + resource: + material: APPLE + generate: false + model_path: item/ingredients/egg/fried_egg_cooked + + fried_egg_burnt: + display_name: "Fried Egg Burnt" + resource: + material: APPLE + generate: false + model_path: item/ingredients/egg/fried_egg_burnt + + fried_egg_rotten: + display_name: "Fried Egg Rotten" + resource: + material: APPLE + generate: false + model_path: item/ingredients/egg/fried_egg_rotten + beetroot_rotten: display_name: "Beetroot Rotten" resource: diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_burnt.json b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_burnt.json new file mode 100644 index 0000000..ab2cc4a --- /dev/null +++ b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_burnt.json @@ -0,0 +1,281 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "textures": { + "0": "tfmc_cooking:item/ingredients/egg/burnt_yolk", + "1": "tfmc_cooking:item/ingredients/egg/burnt_whites", + "particle": "tfmc_cooking:item/ingredients/egg/burnt_yolk" + }, + "elements": [ + { + "from": [ + 7.3, + 0.25, + 5.7 + ], + "to": [ + 9.3, + 1, + 7.7 + ], + "rotation": { + "angle": -20, + "axis": "y", + "origin": [ + 7.3, + 0, + 5.7 + ] + }, + "faces": { + "north": { + "uv": [ + 2, + 0, + 4, + 1 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 1, + 4, + 2 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 2, + 4, + 3 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 3, + 4, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 2, + 2 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 2, + 2, + 4 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 0, + 5 + ], + "to": [ + 10.5, + 0.5, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0, + 10, + 1 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 5, + 2, + 9, + 3 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 5, + 1, + 10, + 2 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 5, + 3, + 9, + 4 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 0, + 5, + 4 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 4, + 5, + 8 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [ + 96.75, + 0, + 0 + ], + "translation": [ + -0.25, + -0.25, + 9.25 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "thirdperson_lefthand": { + "rotation": [ + 96.75, + 0, + 0 + ], + "translation": [ + -0.25, + -0.25, + 9.25 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "firstperson_righthand": { + "rotation": [ + 96.75, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 96.75, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "gui": { + "rotation": [ + 55, + 30, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 2.6, + 2.6, + 2.6 + ] + }, + "ground": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "fixed": { + "rotation": [ + 90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -2 + ], + "scale": [ + 2, + 2, + 2 + ] + } + } +} diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_cooked.json b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_cooked.json new file mode 100644 index 0000000..fc97af8 --- /dev/null +++ b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_cooked.json @@ -0,0 +1,281 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "textures": { + "0": "tfmc_cooking:item/ingredients/egg/cooked_yolk", + "1": "tfmc_cooking:item/ingredients/egg/cooked_whites", + "particle": "tfmc_cooking:item/ingredients/egg/cooked_yolk" + }, + "elements": [ + { + "from": [ + 7.3, + 0.25, + 5.7 + ], + "to": [ + 9.3, + 1, + 7.7 + ], + "rotation": { + "angle": -20, + "axis": "y", + "origin": [ + 7.3, + 0, + 5.7 + ] + }, + "faces": { + "north": { + "uv": [ + 2, + 0, + 4, + 1 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 1, + 4, + 2 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 2, + 4, + 3 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 3, + 4, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 2, + 2 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 2, + 2, + 4 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 0, + 5 + ], + "to": [ + 10.5, + 0.5, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0, + 10, + 1 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 5, + 2, + 9, + 3 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 5, + 1, + 10, + 2 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 5, + 3, + 9, + 4 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 0, + 5, + 4 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 4, + 5, + 8 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [ + 98.25, + 0, + 0 + ], + "translation": [ + 0, + -1, + 8.75 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "thirdperson_lefthand": { + "rotation": [ + 98.25, + 0, + 0 + ], + "translation": [ + 0, + -1, + 8.75 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "firstperson_righthand": { + "rotation": [ + 98.25, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 98.25, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "gui": { + "rotation": [ + 55, + 30, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 2.6, + 2.6, + 2.6 + ] + }, + "ground": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "fixed": { + "rotation": [ + 90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -2 + ], + "scale": [ + 2, + 2, + 2 + ] + } + } +} diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_raw.json b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_raw.json new file mode 100644 index 0000000..0e246f2 --- /dev/null +++ b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_raw.json @@ -0,0 +1,281 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "textures": { + "0": "tfmc_cooking:item/ingredients/egg/raw_yolk", + "1": "tfmc_cooking:item/ingredients/egg/raw_whites", + "particle": "tfmc_cooking:item/ingredients/egg/raw_yolk" + }, + "elements": [ + { + "from": [ + 7.3, + 0.25, + 5.7 + ], + "to": [ + 9.3, + 1, + 7.7 + ], + "rotation": { + "angle": -20, + "axis": "y", + "origin": [ + 7.3, + 0, + 5.7 + ] + }, + "faces": { + "north": { + "uv": [ + 2, + 0, + 4, + 1 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 1, + 4, + 2 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 2, + 4, + 3 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 3, + 4, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 2, + 2 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 2, + 2, + 4 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 0, + 5 + ], + "to": [ + 10.5, + 0.5, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0, + 10, + 1 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 5, + 2, + 9, + 3 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 5, + 1, + 10, + 2 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 5, + 3, + 9, + 4 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 0, + 5, + 4 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 4, + 5, + 8 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [ + 104.75, + 0, + 0 + ], + "translation": [ + 0, + -2.25, + 7.75 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "thirdperson_lefthand": { + "rotation": [ + 104.75, + 0, + 0 + ], + "translation": [ + 0, + -2.25, + 7.75 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "firstperson_righthand": { + "rotation": [ + 104.75, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 104.75, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "gui": { + "rotation": [ + 55, + 30, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 2.6, + 2.6, + 2.6 + ] + }, + "ground": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "fixed": { + "rotation": [ + 90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -2 + ], + "scale": [ + 2, + 2, + 2 + ] + } + } +} diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_rotten.json b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_rotten.json new file mode 100644 index 0000000..1331457 --- /dev/null +++ b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/ingredients/egg/fried_egg_rotten.json @@ -0,0 +1,281 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "textures": { + "0": "tfmc_cooking:item/ingredients/egg/rotten_yolk", + "1": "tfmc_cooking:item/ingredients/egg/rotten_whites", + "particle": "tfmc_cooking:item/ingredients/egg/rotten_yolk" + }, + "elements": [ + { + "from": [ + 7.3, + 0.25, + 5.7 + ], + "to": [ + 9.3, + 1, + 7.7 + ], + "rotation": { + "angle": -20, + "axis": "y", + "origin": [ + 7.3, + 0, + 5.7 + ] + }, + "faces": { + "north": { + "uv": [ + 2, + 0, + 4, + 1 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 1, + 4, + 2 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 2, + 4, + 3 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 3, + 4, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 0, + 0, + 2, + 2 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0, + 2, + 2, + 4 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 0, + 5 + ], + "to": [ + 10.5, + 0.5, + 9 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 7, + 0, + 6 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 0, + 10, + 1 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 5, + 2, + 9, + 3 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 5, + 1, + 10, + 2 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 5, + 3, + 9, + 4 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 0, + 0, + 5, + 4 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 0, + 4, + 5, + 8 + ], + "texture": "#1" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [ + 103.5, + 0, + 0 + ], + "translation": [ + -0.25, + -1.75, + 9 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "thirdperson_lefthand": { + "rotation": [ + 103.5, + 0, + 0 + ], + "translation": [ + -0.25, + -1.75, + 9 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "firstperson_righthand": { + "rotation": [ + 103.5, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 103.5, + 0, + 0 + ], + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 1.8, + 1.8, + 1.8 + ] + }, + "gui": { + "rotation": [ + 55, + 30, + 0 + ], + "translation": [ + 0, + 1.5, + 0 + ], + "scale": [ + 2.6, + 2.6, + 2.6 + ] + }, + "ground": { + "translation": [ + 0, + 3, + 0 + ], + "scale": [ + 1.6, + 1.6, + 1.6 + ] + }, + "fixed": { + "rotation": [ + 90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -2 + ], + "scale": [ + 2, + 2, + 2 + ] + } + } +} diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/vanilla/egg_rotten.json b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/vanilla/egg_rotten.json new file mode 100644 index 0000000..e50854e --- /dev/null +++ b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/models/item/vanilla/egg_rotten.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "tfmc_cooking:item/vanilla/egg_rotten" + } +} diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_whites.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_whites.png new file mode 100644 index 0000000000000000000000000000000000000000..5b95e30f2998e67b400b89bd011f236d583626ac GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EuJopAr*{of*iRT6a=o+dS201 zs`6-Gu$)!4%EM*7#xGCPjETFt6iU1#O4DNR$}Ukl-?uJTuAx|9o?~gKl;Uh@$2Nh* zmX~(Dy(GBR;qsmrYol`3h5SDg)*ycW!*cGAz3d0M-ptFD^K$FCkZs@diOqs(V}fsw z@3Ec#n_ep)>=03zUBSe_@c)0;;RKN5*g)=KX1Hx>qB#3ph67N9!PC{xWt~$(698xs BOa%Y{ literal 0 HcmV?d00001 diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_yolk.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_yolk.png new file mode 100644 index 0000000000000000000000000000000000000000..9a5a483ff8cf7830f54c8389718d709b865aae1f GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`nVv3=Ar*{oCT!$vFc5IvZ{E7L z^#M;g|}f-TK^Z=V{y_3-4?%TJSHL@j_m}LpDwZhX4Q5&pL?#EoB2) a%FGb!siY`9HAVp_!rZQ4I?b_mY@D#5 zGU(!$Tf%D{o*Ld<8);#lRUxK*pgX_i^3-3)nlo7Uq@PPZ*&$f9_Lbj#26qL~MV%{8 zT6~W$s8x}e*qkHm4|K)<|2c=6wg4GyAm=bM2r-!`?$~;GFHnTR)78&qol`;+01$jk A&j0`b literal 0 HcmV?d00001 diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_yolk.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_yolk.png new file mode 100644 index 0000000000000000000000000000000000000000..c7daaceb9c14765d6c8f1eeac8e65f2293927255 GIT binary patch literal 193 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Wu7jMAr*{oCK+-y81T3z7nE-D z5IlJCtaF91|1-;&J?)DXf|mF_QVYAh@izN$F*}n9-`o6uNJX3T-+DeH$o;|N(%UPw zxP!K;?$!`cPhxac`Y>5CMqz=6N=;VGg)eF+ci(pZx1upn;ZA?kd%iVmT&M5=yZH-$D(+yd4Yq+1*Mg5 z-DNxD7Ob23_nPh;Yg5~9(FaG(FTM1teeAf6>7McPohe5+_DUsx;VoeCQk)ertEc!s x>vi`gLDLmxA6Xa}{{L^uw7m;-3LD5N%nb9_nkbeo+75CfgQu&X%Q~loCIGkNOu_&F literal 0 HcmV?d00001 diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_yolk.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_yolk.png new file mode 100644 index 0000000000000000000000000000000000000000..f19d51d24aea1c12fceefc45b592ef460c87f567 GIT binary patch literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`5uPrNAr*{o0t~qhCgwGkCiCxvXBA%xl?;vrOkQShvqrH)2JekG zpXRZRo2_*EzuE!8xDuTSmLcbzpI;7+cyRl!6Kh@6>jS1QeopXxp7!nC^#J3%^j|gk zPRZxYxAO}h6;;$*v!Sx^aoyj`CpeNL7}ib`S4?JiDiCA{@kc%SGl=J_cLFM}^H&R80^Lo1SR8!0x+F*CXHTb&0`d b9t;do_Z=;4+PAR+-Ok|Y>gTe~DWM4f<|A43 literal 0 HcmV?d00001 diff --git a/src/main/java/net/tfminecraft/cooking/cooking/FryingReference.java b/src/main/java/net/tfminecraft/cooking/cooking/FryingReference.java index de7b1ee..1816206 100644 --- a/src/main/java/net/tfminecraft/cooking/cooking/FryingReference.java +++ b/src/main/java/net/tfminecraft/cooking/cooking/FryingReference.java @@ -23,6 +23,7 @@ import net.tfminecraft.cooking.utils.ItemUpdater; import net.tfminecraft.cooking.utils.WarmthUtils; import net.tfminecraft.interactiblefurniture.events.FurnitureInteractEvent; +import net.tfminecraft.interactiblefurniture.events.FurnitureSlotItemAddEvent; import net.tfminecraft.interactiblefurniture.events.FurnitureSlotItemTakeEvent; import net.tfminecraft.interactiblefurniture.furniture.Furniture; import net.tfminecraft.interactiblefurniture.furniture.PlacedSlot; @@ -170,6 +171,24 @@ public void clear() { super.clear(); } + @Override + public void slotAdd(FurnitureSlotItemAddEvent e) { + super.slotAdd(e); + if (e.isCancelled()) { + return; + } + FoodItem fi = slots.get(e.getSlot().getId()); + if (fi == null || fi.getModel() == null) { + return; + } + ItemStack shown = ItemUpdater.applyItemUpdate(e.getItem(), fi, f.getId()); + if (shown != null) { + shown.setAmount(1); + e.setItem(shown); + } + e.setDisplayData(fi.getModelData().getDisplayData(f.getId())); + } + @Override public void slotRemove(FurnitureSlotItemTakeEvent e) { FoodItem fi = slots.remove(e.getSlot().getId()); @@ -187,6 +206,10 @@ public void slotRemove(FurnitureSlotItemTakeEvent e) { return; } if (data.getCurrentTime() < 5) { + ItemStack returned = ItemUpdater.applyItemUpdate(item, fi, null); + if (returned != null) { + e.setItem(returned); + } slots.put(e.getSlot().getId(), fi); return; } @@ -204,7 +227,7 @@ public void slotRemove(FurnitureSlotItemTakeEvent e) { CompositionApplier.apply(fi, composed); } - item = ItemUpdater.applyItemUpdate(item, fi, f.getId()); + item = ItemUpdater.applyItemUpdate(item, fi, null); if (item == null) { slots.put(e.getSlot().getId(), fi); return; diff --git a/src/main/java/net/tfminecraft/cooking/item/FoodItem.java b/src/main/java/net/tfminecraft/cooking/item/FoodItem.java index abd93ed..e31995d 100644 --- a/src/main/java/net/tfminecraft/cooking/item/FoodItem.java +++ b/src/main/java/net/tfminecraft/cooking/item/FoodItem.java @@ -33,6 +33,7 @@ public class FoodItem { private boolean valuable = false; private boolean mashable = false; private boolean edible = true; + private boolean edibleWhenCooked = false; private Integer catchSizeCm; private String seafoodCutType; private String customFishingId; @@ -83,6 +84,7 @@ public FoodItem(String key, ConfigurationSection config) { this.valuable = config.getBoolean("valuable", false); this.mashable = config.getBoolean("mashable", false); this.edible = config.getBoolean("edible", true); + this.edibleWhenCooked = config.getBoolean("edible-when-cooked", false); this.typeLevelCarveSequence = config.getString("carve-sequence", null); String modelId = config.getString("model", null); @@ -155,6 +157,7 @@ public FoodItem(FoodItem other) { this.valuable = other.valuable; this.mashable = other.mashable; this.edible = other.edible; + this.edibleWhenCooked = other.edibleWhenCooked; this.catchSizeCm = other.catchSizeCm; this.seafoodCutType = other.seafoodCutType; this.customFishingId = other.customFishingId; @@ -266,8 +269,17 @@ public void updateAge() { public boolean isValuable() { return valuable; } public boolean isMashable() { return mashable; } public void setMashable(boolean mashable) { this.mashable = mashable; } - public boolean isEdible() { return edible; } + public boolean isEdible() { + if (!edible) { + return false; + } + return !edibleWhenCooked || !hasTag(Tag.RAW); + } public void setEdible(boolean edible) { this.edible = edible; } + + void setEdibleWhenCooked(boolean edibleWhenCooked) { + this.edibleWhenCooked = edibleWhenCooked; + } public Integer getCatchSizeCm() { return catchSizeCm; } public void setCatchSizeCm(Integer catchSizeCm) { this.catchSizeCm = catchSizeCm; } public String getSeafoodCutType() { return seafoodCutType; } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 777b34e..411332a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -173,6 +173,7 @@ dictionary: vegetable: "#93c47dVegetable" fruit: "#e06666Fruit" dairy: "#ffd966Dairy" + egg: "#f5e6c8Egg" spice: "#cc4125Spice" herb: "#38761dHerb" sauce: "#997950Sauce" diff --git a/src/main/resources/conversions.yml b/src/main/resources/conversions.yml index 76b1272..1ebdf4c 100644 --- a/src/main/resources/conversions.yml +++ b/src/main/resources/conversions.yml @@ -6,6 +6,7 @@ conversions: - v.potato vegetable(type=vegetable_1;origin=Potato;tags=freshness.0) - v.beetroot vegetable(type=vegetable_1;origin=Beetroot;tags=freshness.0) - v.apple fruit(type=fruit_1;origin=Apple;tags=freshness.0) + - v.egg egg(type=egg;origin=Egg;tags=freshness.0:cooked.0) - v.melon fruit(type=fruit_1;origin=Melon;tags=freshness.0) - v.melon_slice fruit(type=fruit_1;origin=Melon Slice;tags=freshness.0) - v.pumpkin vegetable(type=vegetable_1;origin=Pumpkin;tags=freshness.0) diff --git a/src/main/resources/husbandry.yml b/src/main/resources/husbandry.yml index 263d5d9..a15e8cb 100644 --- a/src/main/resources/husbandry.yml +++ b/src/main/resources/husbandry.yml @@ -202,7 +202,7 @@ species: - { path: m.materials.legendary_wool, amount: 1, weight: 60 } CHICKEN: grow-up: 45m - egg: vanilla + egg: "food(type=egg;origin=Egg;tags=freshness.0:cooked.0)" slaughter: meat: "meat(type=roast;origin=Chicken)" drops: diff --git a/src/main/resources/models.yml b/src/main/resources/models.yml index 6d07b6b..1a6d648 100644 --- a/src/main/resources/models.yml +++ b/src/main/resources/models.yml @@ -3475,3 +3475,102 @@ seafood_octopus: item: ia.tfmc_cooking:octopus_rotten display: item: ia.tfmc_cooking:octopus_rotten + +egg: + raw: + weight: 1 + tags: + - raw + gui: + item: v.egg + display: + item: v.egg + furniture: + - frying_pan ia.tfmc_cooking:fried_egg_raw + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 + raw_rotten: + weight: 2 + tags: + - raw + - rotten + gui: + item: ia.tfmc_cooking:egg_rotten + display: + item: ia.tfmc_cooking:egg_rotten + furniture: + - frying_pan ia.tfmc_cooking:fried_egg_rotten + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 + cooked: + weight: 2 + tags: + - cooked + gui: + item: ia.tfmc_cooking:fried_egg_cooked + display: + item: ia.tfmc_cooking:fried_egg_cooked + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 + burnt: + weight: 2 + tags: + - burnt + gui: + item: ia.tfmc_cooking:fried_egg_burnt + display: + item: ia.tfmc_cooking:fried_egg_burnt + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 + cooked_rotten: + weight: 3 + tags: + - cooked + - rotten + gui: + item: ia.tfmc_cooking:fried_egg_rotten + display: + item: ia.tfmc_cooking:fried_egg_rotten + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 + burnt_rotten: + weight: 3 + tags: + - burnt + - rotten + gui: + item: ia.tfmc_cooking:fried_egg_rotten + display: + item: ia.tfmc_cooking:fried_egg_rotten + display-data: + scale: + x: 3 + y: 3 + z: 3 + position: + y: 0.05 diff --git a/src/main/resources/types.yml b/src/main/resources/types.yml index 93f2974..f7755f8 100644 --- a/src/main/resources/types.yml +++ b/src/main/resources/types.yml @@ -576,3 +576,22 @@ butter: freshness: stale: "#c3db81Rancid" rotten: "#8B7355Spoiled" + +egg: + name: "#f5e6c8Egg" + model: egg + category: egg + food: 10 + nutrition: 6 + edible-when-cooked: true + cooking-options: + frying_pan: + tag: 1 + time: 12 + burn: 25 + age: + freshness: 1 + tag-labels: + freshness: + stale: "#c3db81Stale" + rotten: "#8B7355Rotten" diff --git a/src/test/java/net/tfminecraft/cooking/item/EggIngredientTest.java b/src/test/java/net/tfminecraft/cooking/item/EggIngredientTest.java new file mode 100644 index 0000000..8b350ba --- /dev/null +++ b/src/test/java/net/tfminecraft/cooking/item/EggIngredientTest.java @@ -0,0 +1,69 @@ +package net.tfminecraft.cooking.item; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import org.junit.jupiter.api.Test; + +import net.tfminecraft.cooking.item.tag.TagStep; +import net.tfminecraft.cooking.item.tag.TagTrack; + +class EggIngredientTest { + + @Test + void rawEggIsInedibleUntilItIsFried() { + FoodItem raw = egg(); + raw.addOrModifyTrack(cookedTrack(0)); + assertFalse(raw.isEdible()); + + FoodItem cooked = egg(); + cooked.addOrModifyTrack(cookedTrack(1)); + assertTrue(cooked.isEdible()); + + FoodItem burnt = egg(); + burnt.addOrModifyTrack(cookedTrack(2)); + assertTrue(burnt.isEdible()); + } + + @Test + void eggStatesAndHusbandryQualityAreConfigured() throws Exception { + String types = Files.readString(Path.of("src/main/resources/types.yml")); + String models = Files.readString(Path.of("src/main/resources/models.yml")); + String conversions = Files.readString(Path.of("src/main/resources/conversions.yml")); + String husbandry = Files.readString(Path.of("src/main/resources/husbandry.yml")); + String items = Files.readString(Path.of("ItemsAdder/tfmc_cooking/contents/items.yml")); + + assertTrue(types.contains("edible-when-cooked: true")); + assertTrue(conversions.contains("v.egg egg(type=egg;origin=Egg;tags=freshness.0:cooked.0)")); + assertTrue(husbandry.contains("food(type=egg;origin=Egg;tags=freshness.0:cooked.0)")); + for (String id : List.of( + "egg_rotten", + "fried_egg_raw", + "fried_egg_cooked", + "fried_egg_burnt", + "fried_egg_rotten")) { + assertTrue(items.contains(id + ":"), id); + assertTrue(models.contains("ia.tfmc_cooking:" + id), id); + } + assertTrue(models.contains("item: v.egg")); + } + + private static FoodItem egg() { + FoodItem item = new FoodItem("egg", "Egg", true); + item.setEdibleWhenCooked(true); + return item; + } + + private static TagTrack cookedTrack(int value) { + TagTrack track = new TagTrack("cooked", false, List.of( + new TagStep("raw", "Raw", 0, 0.4, 0.5), + new TagStep("cooked", "Cooked", 1, 1.55, 1.25), + new TagStep("burnt", "Burnt", 2, 0.25, 0.1))); + track.forceSetValue(value); + return track; + } +}