mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 02:35:49 +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.
This commit is contained in:
parent
6952ad1e59
commit
82c8cf4234
1 changed files with 5 additions and 0 deletions
|
@ -118,6 +118,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;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
|
Loading…
Reference in a new issue