mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Accounted for NMS getItem() returning null in recent commit.
This commit is contained in:
parent
85ab95cec7
commit
1bbeec1f75
@ -241,6 +241,7 @@ public class EntityTrackerEntry {
|
||||
|
||||
if (this.tracker instanceof EntityItem) {
|
||||
EntityItem entityitem = (EntityItem) this.tracker;
|
||||
if (entityitem.dead|| entityitem.itemStack == null) return null; // CraftBukkit
|
||||
Packet21PickupSpawn packet21pickupspawn = new Packet21PickupSpawn(entityitem);
|
||||
|
||||
entityitem.locX = (double) packet21pickupspawn.b / 32.0D;
|
||||
|
@ -27,7 +27,7 @@ public class CraftInventory implements org.bukkit.inventory.Inventory {
|
||||
}
|
||||
|
||||
public ItemStack getItem(int index) {
|
||||
return getInventory().getItem(index).id == 0 ? null : new CraftItemStack(getInventory().getItem(index));
|
||||
return (getInventory().getItem(index) == null || getInventory().getItem(index).id == 0) ? null : new CraftItemStack(getInventory().getItem(index));
|
||||
}
|
||||
|
||||
public ItemStack[] getContents() {
|
||||
|
Loading…
Reference in New Issue
Block a user