diff options
author | Erik Broes <erikbroes@grum.nl> | 2011-03-24 22:42:23 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2011-03-24 22:42:23 +0100 |
commit | 69d5132df4ffeb59ac4fa182e7b267092fc76546 (patch) | |
tree | e60c3bf37a416a0c8753751e8cb653e67e1c87b6 /src/main/java/net/minecraft/server/ItemInWorldManager.java | |
parent | d6c3fe23e57068ae3e562a2b4a60f5542a4492fe (diff) | |
download | craftbukkit-69d5132df4ffeb59ac4fa182e7b267092fc76546.tar craftbukkit-69d5132df4ffeb59ac4fa182e7b267092fc76546.tar.gz craftbukkit-69d5132df4ffeb59ac4fa182e7b267092fc76546.tar.lz craftbukkit-69d5132df4ffeb59ac4fa182e7b267092fc76546.tar.xz craftbukkit-69d5132df4ffeb59ac4fa182e7b267092fc76546.zip |
Reset blocks faster clientside
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemInWorldManager.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemInWorldManager.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index 1c2dc575..7cd5f3a1 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -78,6 +78,13 @@ public class ItemInWorldManager { // Handle hitting a block float toolDamage = Block.byId[l].a(this.a); + if (event.useItemInHand() == Event.Result.DENY) { + // If we 'insta destroyed' then the client needs to be informed. + if (toolDamage > 1.0f) { + ((EntityPlayer) this.a).a.b((Packet) (new Packet53BlockChange(i, j, k, this.b))); + } + return; + } BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.a, i, j, k, this.a.inventory.b(), toolDamage >= 1.0f); if (blockEvent.isCancelled()) { @@ -117,6 +124,10 @@ public class ItemInWorldManager { this.o = this.d; } } + // CraftBukkit start -- force blockreset to client + } else { + ((EntityPlayer) this.a).a.b((Packet) (new Packet53BlockChange(i, j, k, this.b))); + // CraftBukkit end } this.c = 0.0F; |