diff options
author | Taylor Kelly <tkelly910@gmail.com> | 2011-01-10 11:00:53 +0800 |
---|---|---|
committer | Dinner Bone <dinnerbone@dinnerbone.com> | 2011-01-10 11:05:41 +0800 |
commit | 750cc107ae2b9b3c473e91ee651b10f6f46cb763 (patch) | |
tree | ac0d8a9bd10ca5aa1d70bf0d359cdb97cfdab091 /src/main/java | |
parent | c6d80df80d061fd9931d09c16388446a99619404 (diff) | |
download | craftbukkit-750cc107ae2b9b3c473e91ee651b10f6f46cb763.tar craftbukkit-750cc107ae2b9b3c473e91ee651b10f6f46cb763.tar.gz craftbukkit-750cc107ae2b9b3c473e91ee651b10f6f46cb763.tar.lz craftbukkit-750cc107ae2b9b3c473e91ee651b10f6f46cb763.tar.xz craftbukkit-750cc107ae2b9b3c473e91ee651b10f6f46cb763.zip |
Fixed NPE
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 87df11b4..c9a3a2a1 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -282,9 +282,13 @@ public class NetServerHandler extends NetHandler // Craftbukkit start CraftBlock block = (CraftBlock) player.getWorld().getBlockAt(l, i1, j1); - int blockID = block.getTypeID(); - float damage = Block.m[blockID].a(player.getHandle()); //Get amount of damage going to block - + int blockID = 0; + float damage = 0; + if(block != null) { + blockID = block.getTypeID(); + damage = Block.m[blockID].a(player.getHandle()); //Get amount of damage going to block + } + if (packet14blockdig.e == 0) { if (i2 > 16 || flag) { if(blockID > 0) { |