mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 20:07:41 +01:00
SPIGOT-2850: NPE in CraftInventoryCrafting
This commit is contained in:
parent
27d625184d
commit
ad0e4b31bf
@ -112,26 +112,17 @@ 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);
|
||||
getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(contents[i]));
|
||||
} else {
|
||||
getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(item));
|
||||
}
|
||||
} 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));
|
||||
}
|
||||
}
|
||||
|
||||
public Recipe getRecipe() {
|
||||
IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
|
||||
|
Loading…
Reference in New Issue
Block a user