Extend Player Interact cancellation to cover Jigsaw blocks (#10719)

This commit is contained in:
Cross 2024-05-26 21:54:55 +01:00 committed by GitHub
parent 6649a171dc
commit 1b8cdc6d82
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View file

@ -10,7 +10,7 @@ Flower pots are also not updated on the client when interaction is cancelled, th
also resolves this.
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index f4bf927477af23365a2d4618a1634195bd2054c8..5f2dec1917f1c1c3bb69446832321f3fc21dc129 100644
index f4bf927477af23365a2d4618a1634195bd2054c8..e2d8bb349591d103606b158bc116b09d333c87ce 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -514,7 +514,11 @@ public class ServerPlayerGameMode {
@ -18,7 +18,7 @@ index f4bf927477af23365a2d4618a1634195bd2054c8..5f2dec1917f1c1c3bb69446832321f3f
// send a correcting update to the client for the block above as well, this because of replaceable blocks (such as grass, sea grass etc)
player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above()));
+ // Paper start - extend Player Interact cancellation // TODO: consider merging this into the extracted method
+ } else if (iblockdata.is(Blocks.STRUCTURE_BLOCK) || iblockdata.getBlock() instanceof net.minecraft.world.level.block.CommandBlock) {
+ } else if (iblockdata.is(Blocks.JIGSAW) || iblockdata.is(Blocks.STRUCTURE_BLOCK) || iblockdata.getBlock() instanceof net.minecraft.world.level.block.CommandBlock) {
+ player.connection.send(new net.minecraft.network.protocol.game.ClientboundContainerClosePacket(this.player.containerMenu.containerId));
}
+ // Paper end - extend Player Interact cancellation