implement Ingredient.getSerializer for custom ingredients (#5813)

This commit is contained in:
bl4ckscor3 2019-06-25 19:25:33 +02:00 committed by LexManos
parent f4598a97f7
commit b8131e6e67
2 changed files with 12 additions and 0 deletions

View file

@ -107,6 +107,12 @@ public class CompoundIngredient extends Ingredient
return isSimple; return isSimple;
} }
@Override
public IIngredientSerializer<? extends Ingredient> getSerializer()
{
return CraftingHelper.INGREDIENT_COMPOUND;
}
@Nonnull @Nonnull
public Collection<Ingredient> getChildren() public Collection<Ingredient> getChildren()
{ {

View file

@ -53,6 +53,12 @@ public class IngredientNBT extends Ingredient
return false; return false;
} }
@Override
public IIngredientSerializer<? extends Ingredient> getSerializer()
{
return CraftingHelper.INGREDIENT_NBT;
}
public static class Serializer implements IIngredientSerializer<IngredientNBT> public static class Serializer implements IIngredientSerializer<IngredientNBT>
{ {
@Override @Override