Merge pull request #299 from LordGrimmauld/master

the "count":<n> is now supported in recipe inputs
This commit is contained in:
simibubi 2020-05-05 20:23:58 +02:00 committed by GitHub
commit 90afffd644
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 55 deletions

View file

@ -28,7 +28,13 @@ public class ProcessingRecipeSerializer<T extends ProcessingRecipe<?>>
List<ProcessingIngredient> 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<ProcessingOutput> results = new ArrayList<>();

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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": [

View file

@ -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",