mirror of
https://github.com/JamesPeters98/ChestsPlusPlus.git
synced 2024-11-22 02:25:58 +01:00
Fixed #67 Incorrect boolean calculation for matrix result.
Fixed firework recipe breaking when server restarts
This commit is contained in:
parent
c94f73fdf5
commit
3e2ec6d04d
@ -427,7 +427,7 @@ public class VirtualCraftingHolder implements InventoryHolder {
|
||||
HashMap<Integer, ItemStack> 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<Integer, ItemStack> craftingMatrixLeftOvers =
|
||||
|
@ -37,8 +37,12 @@ public class RecipeSerializable implements ConfigurationSerializable {
|
||||
public RecipeSerializable(Map<String, Object> 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<ItemStack>)obj).toArray(new ItemStack[9]);
|
||||
}
|
||||
}
|
||||
|
||||
//noinspection deprecation
|
||||
|
Loading…
Reference in New Issue
Block a user