Paper/patches/server/0437-Fix-sand-duping.patch

38 Zeilen
1.7 KiB
Diff

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
index 08defb76e73a5f9121bf405c86a3c4c750ab1933..46102c28d10b11ecbafd3dda2de66982eaed8a00 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
@@ -126,6 +126,11 @@ public class FallingBlockEntity extends Entity {
2021-06-11 14:02:28 +02:00
@Override
public void tick() {
+ // Paper start - fix sand duping
+ if (this.isRemoved()) {
2021-06-11 14:02:28 +02:00
+ return;
+ }
+ // Paper end - fix sand duping
if (this.blockState.isAir()) {
this.discard();
2022-03-01 06:43:03 +01:00
} else {
@@ -138,6 +143,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
+ 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)) {