From b8131e6e6723cb52c80f3d370c75822eb589d400 Mon Sep 17 00:00:00 2001 From: bl4ckscor3 Date: Tue, 25 Jun 2019 19:25:33 +0200 Subject: [PATCH] implement Ingredient.getSerializer for custom ingredients (#5813) --- .../minecraftforge/common/crafting/CompoundIngredient.java | 6 ++++++ .../net/minecraftforge/common/crafting/IngredientNBT.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/main/java/net/minecraftforge/common/crafting/CompoundIngredient.java b/src/main/java/net/minecraftforge/common/crafting/CompoundIngredient.java index 307174458..a092b9999 100644 --- a/src/main/java/net/minecraftforge/common/crafting/CompoundIngredient.java +++ b/src/main/java/net/minecraftforge/common/crafting/CompoundIngredient.java @@ -107,6 +107,12 @@ public class CompoundIngredient extends Ingredient return isSimple; } + @Override + public IIngredientSerializer getSerializer() + { + return CraftingHelper.INGREDIENT_COMPOUND; + } + @Nonnull public Collection getChildren() { diff --git a/src/main/java/net/minecraftforge/common/crafting/IngredientNBT.java b/src/main/java/net/minecraftforge/common/crafting/IngredientNBT.java index e71013835..2f7c36010 100644 --- a/src/main/java/net/minecraftforge/common/crafting/IngredientNBT.java +++ b/src/main/java/net/minecraftforge/common/crafting/IngredientNBT.java @@ -53,6 +53,12 @@ public class IngredientNBT extends Ingredient return false; } + @Override + public IIngredientSerializer getSerializer() + { + return CraftingHelper.INGREDIENT_NBT; + } + public static class Serializer implements IIngredientSerializer { @Override