geforkt von Mirrors/Paper
SPIGOT-2850: NPE in CraftInventoryCrafting
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
0dcf5cb67e
Commit
8399bc349a
@ -112,26 +112,17 @@ public class CraftInventoryCrafting extends CraftInventory implements CraftingIn
|
|||||||
|
|
||||||
for (int i = 0; i < mcItems.size(); i++) {
|
for (int i = 0; i < mcItems.size(); i++) {
|
||||||
if (i < contents.length) {
|
if (i < contents.length) {
|
||||||
ItemStack item = contents[i];
|
getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(contents[i]));
|
||||||
if (item == null || item.getTypeId() <= 0) {
|
|
||||||
getMatrixInventory().setItem(i, null);
|
|
||||||
} else {
|
} else {
|
||||||
getMatrixInventory().setItem(i, CraftItemStack.asNMSCopy(item));
|
getMatrixInventory().setItem(i, net.minecraft.server.ItemStack.a);
|
||||||
}
|
|
||||||
} else {
|
|
||||||
getMatrixInventory().setItem(i, null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResult(ItemStack item) {
|
public void setResult(ItemStack item) {
|
||||||
List<net.minecraft.server.ItemStack> contents = getResultInventory().getContents();
|
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() {
|
public Recipe getRecipe() {
|
||||||
IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
|
IRecipe recipe = ((InventoryCrafting)getInventory()).currentRecipe;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren