mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 08:46:44 +01:00
SPIGOT-3342: Fix invalid usage of null in InventoryWrapper
This commit is contained in:
parent
732911efbc
commit
885da43758
1 changed files with 6 additions and 6 deletions
|
@ -39,11 +39,11 @@ public class InventoryWrapper implements IInventory {
|
||||||
// Copied from CraftItemStack
|
// Copied from CraftItemStack
|
||||||
ItemStack stack = getItem(i);
|
ItemStack stack = getItem(i);
|
||||||
ItemStack result;
|
ItemStack result;
|
||||||
if (stack == null) {
|
if (stack.isEmpty()) {
|
||||||
return null;
|
return stack;
|
||||||
}
|
}
|
||||||
if (stack.getCount() <= j) {
|
if (stack.getCount() <= j) {
|
||||||
this.setItem(i, null);
|
this.setItem(i, ItemStack.a);
|
||||||
result = stack;
|
result = stack;
|
||||||
} else {
|
} else {
|
||||||
result = CraftItemStack.copyNMSStack(stack, j);
|
result = CraftItemStack.copyNMSStack(stack, j);
|
||||||
|
@ -58,11 +58,11 @@ public class InventoryWrapper implements IInventory {
|
||||||
// Copied from CraftItemStack
|
// Copied from CraftItemStack
|
||||||
ItemStack stack = getItem(i);
|
ItemStack stack = getItem(i);
|
||||||
ItemStack result;
|
ItemStack result;
|
||||||
if (stack == null) {
|
if (stack.isEmpty()) {
|
||||||
return null;
|
return stack;
|
||||||
}
|
}
|
||||||
if (stack.getCount() <= 1) {
|
if (stack.getCount() <= 1) {
|
||||||
this.setItem(i, null);
|
this.setItem(i, ItemStack.a);
|
||||||
result = stack;
|
result = stack;
|
||||||
} else {
|
} else {
|
||||||
result = CraftItemStack.copyNMSStack(stack, 1);
|
result = CraftItemStack.copyNMSStack(stack, 1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue