From c0854c880ad852a9e23b5eb7df3b0502968ac781 Mon Sep 17 00:00:00 2001 From: WolfyScript Date: Tue, 31 Oct 2023 19:39:58 +0100 Subject: [PATCH] Fix NPE when picking up stack from result slot --- .../customcrafting/gui/recipe_creator/ButtonRecipeResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/wolfyscript/customcrafting/gui/recipe_creator/ButtonRecipeResult.java b/src/main/java/me/wolfyscript/customcrafting/gui/recipe_creator/ButtonRecipeResult.java index 9fc0f5d8..ff64cb35 100644 --- a/src/main/java/me/wolfyscript/customcrafting/gui/recipe_creator/ButtonRecipeResult.java +++ b/src/main/java/me/wolfyscript/customcrafting/gui/recipe_creator/ButtonRecipeResult.java @@ -47,7 +47,7 @@ class ButtonRecipeResult extends ItemInputButton { if ((result.items().isEmpty() && !result.getTags().isEmpty()) || event instanceof InventoryClickEvent clickEvent && clickEvent.getClick().equals(ClickType.SHIFT_RIGHT) && event.getView().getTopInventory().equals(clickEvent.getClickedInventory())) { return; } - result.put(0, guiHandler.getWolfyUtils().getRegistries().getStackIdentifierParsers().parseFrom(itemStack)); + result.put(0, itemStack == null ? null : guiHandler.getWolfyUtils().getRegistries().getStackIdentifierParsers().parseFrom(itemStack)); result.buildChoices(); }, null, (hashMap, cache, guiHandler, player, inventory, itemStack, slot, help) -> { Result result = cache.getRecipeCreatorCache().getRecipeCache().getResult();