commit e9f33a207298349b173e92ddebdf796a46e05278 Author: hkc Date: Thu Apr 4 20:19:23 2024 +0300 Initial commit diff --git a/data/ironchests/recipes/.gitkeep b/data/ironchests/recipes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/ironchests/recipes/crushing_ironchests_copper_chest.json b/data/ironchests/recipes/crushing_ironchests_copper_chest.json new file mode 100644 index 0000000..0c820a1 --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_copper_chest.json @@ -0,0 +1,26 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:copper_chest" + } + ], + "results": [ + { + "item": "minecraft:chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:copper_ingot", + "count": 6, + "chance": 1 + }, + { + "item": "create:copper_nugget", + "count": 6, + "chance": 0.75 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/data/ironchests/recipes/crushing_ironchests_crystal_chest.json b/data/ironchests/recipes/crushing_ironchests_crystal_chest.json new file mode 100644 index 0000000..bc3d048 --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_crystal_chest.json @@ -0,0 +1,31 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:crystal_chest" + } + ], + "results": [ + { + "item": "ironchests:diamond_chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:glass", + "count": 3, + "chance": 1 + }, + { + "item": "minecraft:glass", + "count": 3, + "chance": 0.5 + }, + { + "item": "minecraft:amethyst_shard", + "count": 2, + "chance": 0.75 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/data/ironchests/recipes/crushing_ironchests_diamond_chest.json b/data/ironchests/recipes/crushing_ironchests_diamond_chest.json new file mode 100644 index 0000000..60ffad7 --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_diamond_chest.json @@ -0,0 +1,31 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:diamond_chest" + } + ], + "results": [ + { + "item": "ironchests:golden_chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:diamond", + "count": 2, + "chance": 1 + }, + { + "item": "minecraft:gold_ingot", + "count": 4, + "chance": 1 + }, + { + "item": "minecraft:gold_nugget", + "count": 6, + "chance": 0.75 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/data/ironchests/recipes/crushing_ironchests_gold_chest.json b/data/ironchests/recipes/crushing_ironchests_gold_chest.json new file mode 100644 index 0000000..1e3231c --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_gold_chest.json @@ -0,0 +1,26 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:gold_chest" + } + ], + "results": [ + { + "item": "ironchests:iron_chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:gold_ingot", + "count": 6, + "chance": 1 + }, + { + "item": "minecraft:gold_nugget", + "count": 6, + "chance": 0.75 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/data/ironchests/recipes/crushing_ironchests_iron_chest.json b/data/ironchests/recipes/crushing_ironchests_iron_chest.json new file mode 100644 index 0000000..73f2a58 --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_iron_chest.json @@ -0,0 +1,26 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:iron_chest" + } + ], + "results": [ + { + "item": "ironchests:copper_chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:iron_ingot", + "count": 6, + "chance": 1 + }, + { + "item": "minecraft:iron_nugget", + "count": 6, + "chance": 0.75 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/data/ironchests/recipes/crushing_ironchests_obsidian_chest.json b/data/ironchests/recipes/crushing_ironchests_obsidian_chest.json new file mode 100644 index 0000000..0c2ab79 --- /dev/null +++ b/data/ironchests/recipes/crushing_ironchests_obsidian_chest.json @@ -0,0 +1,31 @@ +{ + "type": "create:crushing", + "ingredients": [ + { + "item": "ironchests:obsidian_chest" + } + ], + "results": [ + { + "item": "ironchests:diamond_chest", + "count": 1, + "chance": 0.9 + }, + { + "item": "minecraft:obsidian", + "count": 6, + "chance": 1 + }, + { + "item": "minecraft:obsidian", + "count": 2, + "chance": 0.5 + }, + { + "item": "create:powdered_obsidian", + "count": 2, + "chance": 0.25 + } + ], + "processingTime": 300 +} \ No newline at end of file diff --git a/generator.py b/generator.py new file mode 100644 index 0000000..258d242 --- /dev/null +++ b/generator.py @@ -0,0 +1,63 @@ + +from dataclasses import dataclass +from json import dump + +@dataclass +class RandomItemStack: + item: str + count: int = 1 + chance: float = 1 + +recipes: dict[str, list[RandomItemStack]] = { + "ironchests:copper_chest": [ + RandomItemStack("minecraft:chest", 1, 0.9), + RandomItemStack("minecraft:copper_ingot", 6, 1), + RandomItemStack("create:copper_nugget", 6, 0.75), + ], + "ironchests:iron_chest": [ + RandomItemStack("ironchests:copper_chest", 1, 0.9), + RandomItemStack("minecraft:iron_ingot", 6, 1), + RandomItemStack("minecraft:iron_nugget", 6, 0.75), + ], + "ironchests:gold_chest": [ + RandomItemStack("ironchests:iron_chest", 1, 0.9), + RandomItemStack("minecraft:gold_ingot", 6, 1), + RandomItemStack("minecraft:gold_nugget", 6, 0.75), + ], + "ironchests:diamond_chest": [ + RandomItemStack("ironchests:golden_chest", 1, 0.9), + RandomItemStack("minecraft:diamond", 2, 1), + RandomItemStack("minecraft:gold_ingot", 4, 1), + RandomItemStack("minecraft:gold_nugget", 6, 0.75), + ], + "ironchests:obsidian_chest": [ + RandomItemStack("ironchests:diamond_chest", 1, 0.9), + RandomItemStack("minecraft:obsidian", 6, 1), + RandomItemStack("minecraft:obsidian", 2, 0.5), + RandomItemStack("create:powdered_obsidian", 2, 0.25), + ], + "ironchests:crystal_chest": [ + RandomItemStack("ironchests:diamond_chest", 1, 0.9), + RandomItemStack("minecraft:glass", 3, 1), + RandomItemStack("minecraft:glass", 3, 0.5), + RandomItemStack("minecraft:amethyst_shard", 2, 0.75), + ], +} + +for input_name, outputs in recipes.items(): + namespace, item_name = input_name.split(":", 1) + filename = f"data/ironchests/recipes/crushing_{namespace}_{item_name}.json" + with open(filename, "w") as fp: + dump({ + "type": "create:crushing", + "ingredients": [{ "item": input_name }], + "results": [ + { + "item": output.item, + "count": output.count, + "chance": output.chance + } + for output in outputs + ], + "processingTime": 300 + }, fp, indent=2) diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..f917c09 --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "Uncrafting IronChests chests", + "pack_format": 15 + } +}