mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 14:33:56 +01:00
Update client stack when block place is cancelled. Fixes BUKKIT-5284
Currently, whenever a player places a block in a protected area the equipped itemstack size on client is never updated properly since the client thinks the block was placed. The reason this happens is because ItemStack.matches returns true since the server does not decrement stack size if a BlockPlaceEvent is cancelled. To correct this on cancel we set the flag to always update the client regardless of matching.
This commit is contained in:
parent
5c115116ef
commit
4c9bf34bf3
@ -626,7 +626,9 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j());
|
if (!this.player.playerInteractManager.interact(this.player, worldserver, itemstack, i, j, k, l, packetplayinblockplace.h(), packetplayinblockplace.i(), packetplayinblockplace.j())) {
|
||||||
|
always = true; // force PacketPlayOutSetSlot to be sent to client to update ItemStack count
|
||||||
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
flag = true;
|
flag = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user