Update tile entity on client on cancelled block break. Fixes BUKKIT-2935
When a client tries to break a block it assumes it has done so unless told otherwise by the server. This means the client also wipes out any tile entity data it has for the block as well. We do not send this data when updating the client so clients lose things like text on signs, skull type, etc when they aren't allowed to break the block.
This commit is contained in:
@@ -279,6 +279,11 @@ public class ItemInWorldManager {
|
||||
if (event.isCancelled()) {
|
||||
// Let the client know the block still exists
|
||||
((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 false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user