From 7b173499173a0e933f320470d2e27162066d7d1a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 17 Dec 2023 18:10:06 +0100 Subject: [PATCH] fixed the book breaking when an invalid altar recipe is found closes #339 --- .../naturesaura/compat/patchouli/ProcessorAltar.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java index 2fa30e0b..86752d70 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorAltar.java @@ -23,8 +23,7 @@ public class ProcessorAltar implements IComponentProcessor { return switch (key) { case "input" -> PatchouliCompat.ingredientVariable(this.recipe.input); case "output" -> IVariable.from(this.recipe.output); - case "catalyst" -> - this.recipe.catalyst != Ingredient.EMPTY ? PatchouliCompat.ingredientVariable(this.recipe.catalyst) : null; + case "catalyst" -> this.recipe.catalyst != Ingredient.EMPTY ? PatchouliCompat.ingredientVariable(this.recipe.catalyst) : null; case "name" -> IVariable.wrap(this.recipe.output.getHoverName().getString()); default -> null; }; @@ -32,6 +31,7 @@ public class ProcessorAltar implements IComponentProcessor { @Override public boolean allowRender(String group) { - return group.isEmpty() || group.equals(this.recipe.catalyst == Ingredient.EMPTY ? "altar" : "catalyst"); + return group.isEmpty() || this.recipe != null && group.equals(this.recipe.catalyst == Ingredient.EMPTY ? "altar" : "catalyst"); } + }