diff options
author | md_5 <git@md-5.net> | 2018-05-05 08:22:40 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-05-05 08:22:40 +1000 |
commit | 61ca7d92c1fc78e1ddb3339637493ad6e36a93a8 (patch) | |
tree | 20e6b0af78a0a42148571fef6230be4eebad98a0 /src/main/java | |
parent | ca057a3457d376b4c38c9765713169505dc17c98 (diff) | |
download | craftbukkit-61ca7d92c1fc78e1ddb3339637493ad6e36a93a8.tar craftbukkit-61ca7d92c1fc78e1ddb3339637493ad6e36a93a8.tar.gz craftbukkit-61ca7d92c1fc78e1ddb3339637493ad6e36a93a8.tar.lz craftbukkit-61ca7d92c1fc78e1ddb3339637493ad6e36a93a8.tar.xz craftbukkit-61ca7d92c1fc78e1ddb3339637493ad6e36a93a8.zip |
SPIGOT-3923: Defer PlayerInventory ItemStack change to 1.13
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java index 40a73fe8..4866d1ae 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -46,10 +46,7 @@ public class CraftInventory implements Inventory { } public ItemStack getItem(int index) { - return asCraftMirror(getInventory().getItem(index)); - } - - protected static ItemStack asCraftMirror(net.minecraft.server.ItemStack item) { + net.minecraft.server.ItemStack item = getInventory().getItem(index); return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item); } @@ -59,7 +56,7 @@ public class CraftInventory implements Inventory { for (int i = 0; i < size; i++) { net.minecraft.server.ItemStack mcItem = mcItems.get(i); - items[i] = asCraftMirror(mcItem); + items[i] = (mcItem.isEmpty()) ? null : CraftItemStack.asCraftMirror(mcItem); } return items; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java index 0c015d2f..67c54899 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java @@ -29,7 +29,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i @Override public ItemStack getItemInMainHand() { - return asCraftMirror(getInventory().getItemInHand()); + return CraftItemStack.asCraftMirror(getInventory().getItemInHand()); } @Override @@ -39,7 +39,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i @Override public ItemStack getItemInOffHand() { - return asCraftMirror(getInventory().extraSlots.get(0)); + return CraftItemStack.asCraftMirror(getInventory().extraSlots.get(0)); } @Override |