diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-14 18:12:59 +0000 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2012-01-14 18:12:59 +0000 |
commit | dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb (patch) | |
tree | 9e5586d82da2ca84c6403f8cc6d39d1c8517a757 | |
parent | 2ab160e484fb064eed4c423ca8363a475a2da868 (diff) | |
download | craftbukkit-dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb.tar craftbukkit-dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb.tar.gz craftbukkit-dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb.tar.lz craftbukkit-dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb.tar.xz craftbukkit-dfbcd36ab7b0f7e8d26ca256b789509f0fc5a6fb.zip |
Fixed a further exploit with players attacking more things that they shouldn't.
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPlayer.java | 2 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index b9ca7d37..a141c7f0 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -648,7 +648,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.deathTicks = 0; effects.clear(); this.activeContainer = this.defaultContainer; - this.lastSentExp = -1; // lastSentExp. Find line: "if (this.expTotal != this.XXXX) {" + this.lastSentExp = -1; if(this.keepLevel) { this.exp = exp; } else { diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index ecdad7da..9f98355e 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -923,9 +923,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.player.updateInventory(this.player.activeContainer); } } 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."); + if ((entity instanceof EntityItem) || (entity instanceof EntityExperienceOrb) || (entity instanceof EntityArrow)) { + String type = entity.getClass().getSimpleName(); + disconnect("Attacking an " + type + " is not permitted"); + System.out.println("Player " + player.name + " tried to attack an " + type + ", so I have disconnected them for exploiting."); return; } |