diff --git a/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java b/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java index 4f96a5b7..5f23e9c0 100644 --- a/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java +++ b/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java @@ -216,7 +216,18 @@ public class InfusionRecipe implements Recipe, UnknownReceipBook @Override public InfusionRecipe fromJson(ResourceLocation id, JsonObject json) { InfusionRecipe recipe = new InfusionRecipe(id); - recipe.input = Ingredient.fromJson(json.get("input")); + JsonObject inputObject = GsonHelper.getAsJsonObject(json, "input"); + recipe.input = Ingredient.fromJson(inputObject); + if (inputObject.has("nbt") && !recipe.input.isEmpty()) { + try { + String nbtData = GsonHelper.getAsString(inputObject, "nbt"); + CompoundTag nbt = TagParser.parseTag(nbtData); + recipe.input.getItems()[0].setTag(nbt); + } catch (CommandSyntaxException ex) { + BetterEnd.LOGGER.warning("Error parse nbt data for input.", ex); + } + } + JsonObject result = GsonHelper.getAsJsonObject(json, "result"); recipe.output = ItemUtil.fromJsonRecipe(result); if (recipe.output == null) {