From b9053f7902c462fe2b6810cd7ce9668040f46d3c Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Tue, 5 May 2020 10:37:34 +0200 Subject: [PATCH] the "count": is now supported in recipe inputs, changed mixer recipes to use this new feature --- .../processing/ProcessingRecipeSerializer.java | 8 +++++++- .../create/recipes/mixing/blazing_axe.json | 12 ++---------- .../create/recipes/mixing/blazing_pickaxe.json | 12 ++---------- .../create/recipes/mixing/blazing_shovel.json | 12 ++---------- .../create/recipes/mixing/blazing_sword.json | 12 ++---------- .../recipes/mixing/chromatic_compound.json | 18 ++++-------------- 6 files changed, 19 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java index 1d605ea2d..1bde1bd31 100644 --- a/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/modules/contraptions/processing/ProcessingRecipeSerializer.java @@ -28,7 +28,13 @@ public class ProcessingRecipeSerializer> List ingredients = new ArrayList<>(); for (JsonElement e : JSONUtils.getJsonArray(json, "ingredients")) { - ingredients.add(ProcessingIngredient.parse(e.getAsJsonObject())); + int count = 1; + if (JSONUtils.hasField((JsonObject) e, "count")) { + count = JSONUtils.getInt(e.getAsJsonObject().get("count"), "count"); + } + for(int i = 0; i < count; i++) { + ingredients.add(ProcessingIngredient.parse(e.getAsJsonObject())); + } } List results = new ArrayList<>(); diff --git a/src/main/resources/data/create/recipes/mixing/blazing_axe.json b/src/main/resources/data/create/recipes/mixing/blazing_axe.json index 772532f0a..c5bbc965e 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_axe.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_axe.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json b/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json index d80db6c1a..1f8c33066 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_pickaxe.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_shovel.json b/src/main/resources/data/create/recipes/mixing/blazing_shovel.json index dbce999c7..a65673c19 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_shovel.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_shovel.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/blazing_sword.json b/src/main/resources/data/create/recipes/mixing/blazing_sword.json index 8b8785f59..99f9051d9 100644 --- a/src/main/resources/data/create/recipes/mixing/blazing_sword.json +++ b/src/main/resources/data/create/recipes/mixing/blazing_sword.json @@ -8,16 +8,8 @@ "item": "create:obsidian_dust" }, { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" - }, - { - "item": "minecraft:blaze_powder" + "item": "minecraft:blaze_powder", + "count": 4 } ], "results": [ diff --git a/src/main/resources/data/create/recipes/mixing/chromatic_compound.json b/src/main/resources/data/create/recipes/mixing/chromatic_compound.json index 92f30a818..827e3a3c7 100644 --- a/src/main/resources/data/create/recipes/mixing/chromatic_compound.json +++ b/src/main/resources/data/create/recipes/mixing/chromatic_compound.json @@ -2,25 +2,15 @@ "type": "create:mixing", "ingredients": [ { - "tag": "forge:dusts/glowstone" - }, - { - "tag": "forge:dusts/glowstone" - }, - { - "tag": "forge:dusts/glowstone" + "tag": "forge:dusts/glowstone", + "count": 3 }, { "item": "create:polished_rose_quartz" }, { - "item": "create:obsidian_dust" - }, - { - "item": "create:obsidian_dust" - }, - { - "item": "create:obsidian_dust" + "item": "create:obsidian_dust", + "count": 3 }, { "item": "minecraft:dragon_breath",