Skip to content

Commit

Permalink
Extend Player Interact cancellation to cover Jigsaw blocks (#10719)
Browse files Browse the repository at this point in the history
  • Loading branch information
eteryi committed May 26, 2024
1 parent 6649a17 commit 1b8cdc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions patches/server/0172-Extend-Player-Interact-cancellation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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 {

// 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
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0934-Dont-resend-blocks-on-interactions.patch
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In general, the client now has an acknowledgment system which will prevent block
It should be noted that this system does not yet support block entities, so those still need to resynced when needed.

diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index cef3a64b5e6c4d34ed079078420078a7adfcd574..3dff328c5e4456aae291a8dec82766681f49af06 100644
index dd78a1685bd841577aa9d5010fffda1468901baf..c5f3ba82b3ded415ff4bffc9eabf9526695e1ba7 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -202,7 +202,7 @@ public class ServerPlayerGameMode {
Expand Down Expand Up @@ -124,7 +124,7 @@ index cef3a64b5e6c4d34ed079078420078a7adfcd574..3dff328c5e4456aae291a8dec8276668
- player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above()));
+ //player.connection.send(new ClientboundBlockUpdatePacket(world, blockposition.above())); // Paper - Don't resync blocks
// 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));
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
index 6d494b80ae002aea00afa44adf83dad1ae5bbbc1..49557d6f22c5725c663a231deab019d4f6fe95fa 100644
Expand Down

0 comments on commit 1b8cdc6

Please sign in to comment.