diff options
author | Taylor Kelly <tkelly910@gmail.com> | 2011-01-10 09:57:47 +0800 |
---|---|---|
committer | Dinner Bone <dinnerbone@dinnerbone.com> | 2011-01-10 10:29:21 +0800 |
commit | e5d7a4602952369bf6f70f00bbd4f635e02ad36b (patch) | |
tree | 033de99b9f80441351efab003b31e7f4606af170 /src/main/java/net/minecraft/server/NetServerHandler.java | |
parent | 21e7f1c4407ce04ae4d3cd883edfcf1b1bc95f18 (diff) | |
download | craftbukkit-e5d7a4602952369bf6f70f00bbd4f635e02ad36b.tar craftbukkit-e5d7a4602952369bf6f70f00bbd4f635e02ad36b.tar.gz craftbukkit-e5d7a4602952369bf6f70f00bbd4f635e02ad36b.tar.lz craftbukkit-e5d7a4602952369bf6f70f00bbd4f635e02ad36b.tar.xz craftbukkit-e5d7a4602952369bf6f70f00bbd4f635e02ad36b.zip |
-
Diffstat (limited to 'src/main/java/net/minecraft/server/NetServerHandler.java')
-rw-r--r-- | src/main/java/net/minecraft/server/NetServerHandler.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 355dc77e..87df11b4 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -233,6 +233,13 @@ public class NetServerHandler extends NetHandler e.a.b(new Packet13PlayerLookMove(d1, d2 + 1.6200000047683716D, d2, d3, f1, f2, false)); } + // CraftBukkit start + // Get position of last block hit for BlockDamageLevel.STOPPED + private int lastX; + private int lastY; + private int lastZ; + // Craftbukkit stop + public void a(Packet14BlockDig packet14blockdig) { if (packet14blockdig.e == 4) { e.L(); @@ -296,6 +303,9 @@ public class NetServerHandler extends NetHandler } } } else if (packet14blockdig.e == 2) { + // Get last block that the player hit + // Otherwise the block is a Bedrock @(0,0,0) + block = (CraftBlock) player.getWorld().getBlockAt(lastX, lastY, lastZ); BlockDamagedEvent event = new BlockDamagedEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STOPPED, player); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -326,8 +336,11 @@ public class NetServerHandler extends NetHandler e.a.b(new Packet53BlockChange(l, i1, j1, d.e)); } } + lastX = l; + lastY = i1; + lastZ = j1; // Craftbukkit stop - + d.e.B = false; } // Craftbukkit start - store the last block right clicked and what type it was |