geforkt von Mirrors/Paper
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:
Ursprung
6952ad1e59
Commit
82c8cf4234
@ -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
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren