13
0
geforkt von Mirrors/Paper

Reset blocks faster clientside

Dieser Commit ist enthalten in:
Erik Broes 2011-03-24 22:42:23 +01:00
Ursprung d6c3fe23e5
Commit 69d5132df4

Datei anzeigen

@ -78,6 +78,13 @@ public class ItemInWorldManager {
// Handle hitting a block // Handle hitting a block
float toolDamage = Block.byId[l].a(this.a); 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); BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.a, i, j, k, this.a.inventory.b(), toolDamage >= 1.0f);
if (blockEvent.isCancelled()) { if (blockEvent.isCancelled()) {
@ -117,6 +124,10 @@ public class ItemInWorldManager {
this.o = this.d; 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; this.c = 0.0F;