2021-06-15 04:59:31 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Trigary <trigary0@gmail.com>
|
|
|
|
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
|
2021-06-17 23:39:36 +02:00
|
|
|
index 5d89acffe7df54b79733bebba342ea694339ac4b..edc6126d45b0cf1918c5722c34ea6fea977ed293 100644
|
2021-06-15 04:59:31 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
|
|
@@ -119,8 +119,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 {
|
2021-06-17 23:39:36 +02:00
|
|
|
+ this.level.removeBlock(blockposition, false);
|
2021-06-15 04:59:31 +02:00
|
|
|
+ }
|
|
|
|
+ // Paper end - fix cancelling block falling causing client desync
|
|
|
|
} else if (!this.level.isClientSide) {
|
|
|
|
this.discard();
|
|
|
|
return;
|