diff options
Diffstat (limited to 'patches/server/0625-fix-cancelling-block-falling-causing-client-desync.patch')
-rw-r--r-- | patches/server/0625-fix-cancelling-block-falling-causing-client-desync.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/server/0625-fix-cancelling-block-falling-causing-client-desync.patch b/patches/server/0625-fix-cancelling-block-falling-causing-client-desync.patch new file mode 100644 index 0000000000..e68d092a83 --- /dev/null +++ b/patches/server/0625-fix-cancelling-block-falling-causing-client-desync.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Trigary <[email protected]> +Date: Sat, 27 Mar 2021 11:13:30 +0100 +Subject: [PATCH] fix cancelling block falling causing client desync + + +diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +index e74a87336b47611fa29df4cd3d272fb08b91630b..0c94b4cb6ee0c3dffe0b67a2291d0160ae0ef96f 100644 +--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java ++++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +@@ -128,8 +128,18 @@ public class FallingBlockEntity extends Entity { + + if (this.time++ == 0) { + blockposition = this.blockPosition(); +- if (this.level.getBlockState(blockposition).is(block) && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) { +- this.level.removeBlock(blockposition, false); ++ // Paper start - fix cancelling block falling causing client desync ++ if (this.level.getBlockState(blockposition).is(block)) { ++ if (CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) { ++ if (this.level.getBlockState(blockposition).is(block)) { //if listener didn't update the block ++ ((ServerLevel) level).getChunkSource().blockChanged(blockposition); ++ } ++ this.discard(); ++ return; ++ } else { ++ this.level.removeBlock(blockposition, false); ++ } ++ // Paper end - fix cancelling block falling causing client desync + } else if (!this.level.isClientSide) { + this.discard(); + return; |