From f5fd809485ead24cf608ed419bd26bbda5ae9c2e Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 19 Dec 2023 18:54:04 +0100 Subject: [PATCH] Fixed some crashes --- .../recipe/builders/InfusionRecipe.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) 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 b2296408..ac9aa89f 100644 --- a/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java +++ b/src/main/java/org/betterx/betterend/recipe/builders/InfusionRecipe.java @@ -83,7 +83,7 @@ public class InfusionRecipe implements Recipe, UnknownReceipBook this(input, output, 1, new Ingredient[]{ Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY, Ingredient.EMPTY - }, (String) null); + }, ""); } private InfusionRecipe( @@ -93,7 +93,7 @@ public class InfusionRecipe implements Recipe, UnknownReceipBook Ingredient[] catalysts, Optional group ) { - this(input, output, time, catalysts, group.orElse(null)); + this(input, output, time, catalysts, group.orElse("")); } private InfusionRecipe(Ingredient input, ItemStack output, int time, Ingredient[] catalysts, String group) { @@ -210,14 +210,14 @@ public class InfusionRecipe implements Recipe, UnknownReceipBook Optional north_west ) { Ingredient[] result = new Ingredient[8]; - result[Catalysts.NORTH.index] = north.orElse(null); - result[Catalysts.NORTH_EAST.index] = north_east.orElse(null); - result[Catalysts.EAST.index] = east.orElse(null); - result[Catalysts.SOUTH_EAST.index] = south_east.orElse(null); - result[Catalysts.SOUTH.index] = south.orElse(null); - result[Catalysts.SOUTH_WEST.index] = south_west.orElse(null); - result[Catalysts.WEST.index] = west.orElse(null); - result[Catalysts.NORTH_WEST.index] = north_west.orElse(null); + result[Catalysts.NORTH.index] = north.orElse(Ingredient.EMPTY); + result[Catalysts.NORTH_EAST.index] = north_east.orElse(Ingredient.EMPTY); + result[Catalysts.EAST.index] = east.orElse(Ingredient.EMPTY); + result[Catalysts.SOUTH_EAST.index] = south_east.orElse(Ingredient.EMPTY); + result[Catalysts.SOUTH.index] = south.orElse(Ingredient.EMPTY); + result[Catalysts.SOUTH_WEST.index] = south_west.orElse(Ingredient.EMPTY); + result[Catalysts.WEST.index] = west.orElse(Ingredient.EMPTY); + result[Catalysts.NORTH_WEST.index] = north_west.orElse(Ingredient.EMPTY); return result; } @@ -240,7 +240,13 @@ public class InfusionRecipe implements Recipe, UnknownReceipBook @Override protected InfusionRecipe createRecipe(ResourceLocation id) { checkRecipe(); - return new InfusionRecipe(this.primaryInput, this.output, this.time, this.catalysts, this.group); + return new InfusionRecipe( + this.primaryInput, + this.output, + this.time, + this.catalysts, + this.group == null ? "" : this.group + ); } @Override