diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/interfaces/VirtualCraftingHolder.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/interfaces/VirtualCraftingHolder.java index 3a6ff72..e42adc2 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/interfaces/VirtualCraftingHolder.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/interfaces/VirtualCraftingHolder.java @@ -427,7 +427,7 @@ public class VirtualCraftingHolder implements InventoryHolder { HashMap map = tempOutput.addItem(craftingResult.result()); boolean isEmpty = Arrays.stream(craftingResult.matrixResult()) - .anyMatch(itemStack -> (itemStack == null || itemStack.getType() == Material.AIR)); + .allMatch(itemStack -> (itemStack == null || itemStack.getType() == Material.AIR)); // Add any leftover items from the recipe e.g buckets. HashMap craftingMatrixLeftOvers = diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/serialize/RecipeSerializable.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/serialize/RecipeSerializable.java index 85864d0..e700b01 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/serialize/RecipeSerializable.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/serialize/RecipeSerializable.java @@ -37,8 +37,12 @@ public class RecipeSerializable implements ConfigurationSerializable { public RecipeSerializable(Map map) { Object obj = map.get("items"); if (obj != null) { - //noinspection unchecked - items = (ItemStack[]) obj; + if (obj instanceof ItemStack[] itemArray) { + items = itemArray; + } else { + //noinspection unchecked + items = ((List)obj).toArray(new ItemStack[9]); + } } //noinspection deprecation