aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0382-Fix-sand-duping.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0382-Fix-sand-duping.patch')
-rw-r--r--patches/server/0382-Fix-sand-duping.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/patches/server/0382-Fix-sand-duping.patch b/patches/server/0382-Fix-sand-duping.patch
new file mode 100644
index 0000000000..955e201da1
--- /dev/null
+++ b/patches/server/0382-Fix-sand-duping.patch
@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Fri, 12 Jun 2020 13:33:19 -0700
+Subject: [PATCH] Fix sand duping
+
+If the falling block dies during teleportation (entity#move), then we need
+to detect that by placing a check after the move.
+
+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 e2f90b822f25bf100eaba0cf4518849f788ee2fa..67875e854d66b62c36fcca455f02f5abf3ebfdb3 100644
+--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
++++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+@@ -131,6 +131,11 @@ public class FallingBlockEntity extends Entity {
+
+ @Override
+ public void tick() {
++ // Paper start - fix sand duping
++ if (this.isRemoved()) {
++ return;
++ }
++ // Paper end - fix sand duping
+ if (this.blockState.isAir()) {
+ this.discard();
+ } else {
+@@ -142,6 +147,11 @@ public class FallingBlockEntity extends Entity {
+ }
+
+ this.move(MoverType.SELF, this.getDeltaMovement());
++ // Paper start - fix sand duping
++ if (this.isRemoved()) {
++ return;
++ }
++ // Paper end - fix sand duping
+ // Paper start - Configurable falling blocks height nerf
+ if (this.level().paperConfig().fixes.fallingBlockHeightNerf.test(v -> this.getY() > v)) {
+ if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {