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 0000000..5b95e30 Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_whites.png differ 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 0000000..9a5a483 Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/burnt_yolk.png differ diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_whites.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_whites.png new file mode 100644 index 0000000..924c12a Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_whites.png differ 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 0000000..c7daace Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/cooked_yolk.png differ diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_whites.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_whites.png new file mode 100644 index 0000000..508b76c Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_whites.png differ 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 0000000..f19d51d Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/raw_yolk.png differ diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_whites.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_whites.png new file mode 100644 index 0000000..4d92d34 Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_whites.png differ diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_yolk.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_yolk.png new file mode 100644 index 0000000..ab50a87 Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/ingredients/egg/rotten_yolk.png differ diff --git a/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/vanilla/egg_rotten.png b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/vanilla/egg_rotten.png new file mode 100644 index 0000000..8cf5d76 Binary files /dev/null and b/ItemsAdder/tfmc_cooking/resourcepack/assets/tfmc_cooking/textures/item/vanilla/egg_rotten.png differ 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; + } +}