mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-26 09:42:06 -07:00
Do not send update packets for saddle/body slots
The player inventory now allows setting the saddle and body equipment slot. The client menu for this however does not contain slots. As such, updating the player for such slots leads to an IOOB exception.
This commit is contained in:
@@ -77,6 +77,8 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
||||
// Paper end - Validate setItem index
|
||||
super.setItem(index, item);
|
||||
if (this.getHolder() == null) return;
|
||||
|
||||
if (index > 40) return; // Do not send update packets for saddle or body slots as the player menu does not contain these.
|
||||
ServerPlayer player = ((CraftPlayer) this.getHolder()).getHandle();
|
||||
if (player.connection == null) return;
|
||||
// PacketPlayOutSetSlot places the items differently than setItem()
|
||||
|
Reference in New Issue
Block a user