diff options
author | md_5 <git@md-5.net> | 2016-11-27 17:03:28 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-11-27 17:03:28 +1100 |
commit | ad0e4b31bf8401d141682ae962f9c823571c5da1 (patch) | |
tree | e168e725fd50570d3b284ba2c1eff34e2b885a9a /src/main | |
parent | 27d625184d7e3028dbdc818d166c44aba0cc2375 (diff) | |
download | craftbukkit-ad0e4b31bf8401d141682ae962f9c823571c5da1.tar craftbukkit-ad0e4b31bf8401d141682ae962f9c823571c5da1.tar.gz craftbukkit-ad0e4b31bf8401d141682ae962f9c823571c5da1.tar.lz craftbukkit-ad0e4b31bf8401d141682ae962f9c823571c5da1.tar.xz craftbukkit-ad0e4b31bf8401d141682ae962f9c823571c5da1.zip |
SPIGOT-2850: NPE in CraftInventoryCrafting
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java index 2ae768fa..24d1804a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryCrafting.java @@ -112,25 +112,16 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn for (int i = 0; i < mcItems.size(); i++) { if (i < contents.length) { - ItemStack item = contents[i]; - if (item == null || item.getTypeId() <= 0) { - getMatrixInventory().setItem(i, null); - } else { - getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(item)); - } + getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(contents[i])); } else { - getMatrixInventory().setItem(i, null); + getMatrixInventory().setItem(i, net.minecraft.server.ItemStack.a); } } } public void setResult(ItemStack item) { List<net.minecraft.server.ItemStack> contents = getResultInventory().getContents(); - if (item == null || item.getTypeId() <= 0) { - contents.set(0, net.minecraft.server.ItemStack.a); - } else { - contents.set(0, CraftItemStack.asNMSCopy(item)); - } + contents.set(0, CraftItemStack.asNMSCopy(item)); } public Recipe getRecipe() { |