2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2021-11-24 13:30:55 +01:00
|
|
|
index a8a9cbcece45c3480120cb2fa0fa03523a87d317..e74a87336b47611fa29df4cd3d272fb08b91630b 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
|
2021-11-24 13:30:55 +01:00
|
|
|
@@ -110,6 +110,11 @@ public class FallingBlockEntity extends Entity {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void tick() {
|
|
|
|
+ // Paper start - fix sand duping
|
2021-06-14 10:37:14 +02:00
|
|
|
+ if (this.isRemoved()) {
|
2021-06-11 14:02:28 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end - fix sand duping
|
|
|
|
if (this.blockState.isAir()) {
|
2021-06-14 10:37:14 +02:00
|
|
|
this.discard();
|
2021-11-24 13:30:55 +01:00
|
|
|
} else if (this.level.isClientSide && this.removeAtMillis > 0L) {
|
|
|
|
@@ -137,6 +142,12 @@ public class FallingBlockEntity extends Entity {
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
|
|
|
|
|
|
+ // Paper start - fix sand duping
|
2021-06-14 10:37:14 +02:00
|
|
|
+ if (this.isRemoved()) {
|
2021-06-11 14:02:28 +02:00
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end - fix sand duping
|
|
|
|
+
|
|
|
|
// Paper start - Configurable EntityFallingBlock height nerf
|
|
|
|
if (this.level.paperConfig.fallingBlockHeightNerf != 0 && this.getY() > this.level.paperConfig.fallingBlockHeightNerf) {
|
|
|
|
if (this.dropItem && this.level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
|