diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-06-19 13:58:38 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-19 13:58:38 -0400 |
commit | 7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d (patch) | |
tree | 41c9d1f358e5df24f11042f50e5809e3d4515fd5 /src/main/java/net/minecraft/server/NetServerHandler.java | |
parent | cb7b82d452817ea5a1d404d380d5e919bf35fe96 (diff) | |
download | craftbukkit-7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d.tar craftbukkit-7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d.tar.gz craftbukkit-7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d.tar.lz craftbukkit-7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d.tar.xz craftbukkit-7ac53dfc8bdd67cd20fbe1f9a675d7f1ab1e9b6d.zip |
Fixed NPEs in infinite item loss fix
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 52d0995c..451d9978 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -858,6 +858,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { WorldServer worldserver = this.minecraftServer.a(this.player.dimension); Entity entity = worldserver.getEntity(packet7useentity.target); + ItemStack itemInHand = this.player.inventory.getItemInHand(); if (entity != null && this.player.e(entity) && this.player.g(entity) < 36.0D) { if (packet7useentity.c == 0) { @@ -870,14 +871,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit end this.player.c(entity); // CraftBukkit start - update the client if the item is an infinite one - if (this.player.inventory.getItemInHand().count <= -1) { + if (itemInHand != null && itemInHand.count <= -1) { this.player.a(this.player.activeContainer); } // CraftBukkit end } else if (packet7useentity.c == 1) { this.player.d(entity); // CraftBukkit start - update the client if the item is an infinite one - if (this.player.inventory.getItemInHand().count <= -1) { + if (itemInHand != null && itemInHand.count <= -1) { this.player.a(this.player.activeContainer); } // CraftBukkit end |