3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-16 21:10:17 +01:00

Update tile entity when interact event is cancelled.

If a plugin cancels a PlayerInteractEvent when left clicking a block the
client may have removed this block if they are in creative mode or if the
block breaks in a single hit. In this case, we need to update the client's
tile entity as well as telling it the block still exists.
Dieser Commit ist enthalten in:
Travis Watkins 2012-11-16 13:46:52 -06:00
Ursprung 6952ad1e59
Commit 82c8cf4234

Datei anzeigen

@ -118,6 +118,11 @@ public class ItemInWorldManager {
if (event.isCancelled()) { if (event.isCancelled()) {
// Let the client know the block still exists // Let the client know the block still exists
((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world)); ((EntityPlayer) this.player).netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, this.world));
// Update any tile entity data for this block
TileEntity tileentity = this.world.getTileEntity(i, j, k);
if (tileentity != null) {
this.player.netServerHandler.sendPacket(tileentity.getUpdatePacket());
}
return; return;
} }
// CraftBukkit end // CraftBukkit end