mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 21:19:00 +01:00
SPIGOT-980: Fix NPE when setting items of offline players
This commit is contained in:
parent
76c834a849
commit
d432434fd8
@ -38,6 +38,7 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||||||
public void setItem(int index, ItemStack item) {
|
public void setItem(int index, ItemStack item) {
|
||||||
super.setItem(index, item);
|
super.setItem(index, item);
|
||||||
EntityPlayer player = ((CraftPlayer) this.getHolder()).getHandle();
|
EntityPlayer player = ((CraftPlayer) this.getHolder()).getHandle();
|
||||||
|
if (player.playerConnection == null) return;
|
||||||
// PacketPlayOutSetSlot places the items differently than setItem()
|
// PacketPlayOutSetSlot places the items differently than setItem()
|
||||||
//
|
//
|
||||||
// Between, and including, index 9 (the first index outside of the hotbar) and index 35 (the last index before
|
// Between, and including, index 9 (the first index outside of the hotbar) and index 35 (the last index before
|
||||||
|
Loading…
Reference in New Issue
Block a user