13
0
geforkt von Mirrors/Paper

Fixed players attempting to attack item entities - This fixes BUKKIT-341

Dieser Commit ist enthalten in:
Nathan Adams 2012-01-14 13:27:15 +00:00
Ursprung d5438c30b9
Commit 3d31c27864

Datei anzeigen

@ -922,10 +922,15 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (itemInHand != null && itemInHand.count <= -1) { if (itemInHand != null && itemInHand.count <= -1) {
this.player.updateInventory(this.player.activeContainer); this.player.updateInventory(this.player.activeContainer);
} }
// CraftBukkit end
} else if (packet7useentity.c == 1) { } else if (packet7useentity.c == 1) {
if (entity instanceof EntityItem) {
disconnect("Attacking an item is not permitted");
System.out.println("Player " + player.name + " tried to attack an item entity, so I have disconnected them for exploiting.");
return;
}
this.player.f(entity); this.player.f(entity);
// CraftBukkit start - update the client if the item is an infinite one
if (itemInHand != null && itemInHand.count <= -1) { if (itemInHand != null && itemInHand.count <= -1) {
this.player.updateInventory(this.player.activeContainer); this.player.updateInventory(this.player.activeContainer);
} }