Fix empty block on interact (#583)

This commit is contained in:
Cody 2022-01-10 14:35:31 -06:00 committed by GitHub
parent 2633609ccd
commit 517d6a3b7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,10 +92,11 @@ public class BlockPlacementListener {
final Point placementPosition = blockPosition.add(offsetX, offsetY, offsetZ);
if (!canPlaceBlock) {
// Send a block change with AIR as block to keep the client in sync,
// Send a block change with the real block in the instance to keep the client in sync,
// using refreshChunk results in the client not being in sync
// after rapid invalid block placements
player.getPlayerConnection().sendPacket(new BlockChangePacket(placementPosition, Block.AIR));
final Block block = instance.getBlock(placementPosition);
player.getPlayerConnection().sendPacket(new BlockChangePacket(placementPosition, block));
return;
}