mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 17:31:06 +01:00
Record invalid ItemInHandIndex packet
This commit is contained in:
parent
f056fad765
commit
454da93a00
1 changed files with 10 additions and 0 deletions
|
@ -549,6 +549,16 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||
}
|
||||
|
||||
public void a(Packet16BlockItemSwitch packet16blockitemswitch) {
|
||||
if (packet16blockitemswitch.a < 0 || packet16blockitemswitch.a > 8) {
|
||||
server.getLogger().severe(
|
||||
"Player " + getPlayer().getName() + "/" + getPlayer().getAddress().toString() +
|
||||
" just send an invalid ItemInHandIndex: " + packet16blockitemswitch.a +
|
||||
" - very likely a crashing exploit attempt. Recommend ban, and sending a package of joy their way."
|
||||
);
|
||||
this.d.f.a(new Packet1Login("", "", 0, 0, (byte)0));
|
||||
return;
|
||||
}
|
||||
|
||||
// CraftBukkit start
|
||||
PlayerItemHeldEvent event = new PlayerItemHeldEvent(Type.PLAYER_ITEM_HELD, getPlayer(), e.inventory.c, packet16blockitemswitch.a);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
|
Loading…
Reference in a new issue