9
0
mirror of https://github.com/Samsuik/Sakura.git synced 2025-12-22 08:19:26 +00:00
Files
SakuraMC/patches/server/0059-Fix-doEntityDrops-gamerule-preventing-falling-blocks.patch

30 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samsuik <kfian294ma4@gmail.com>
Date: Sun, 28 Jan 2024 20:30:09 +0000
Subject: [PATCH] Fix doEntityDrops gamerule preventing falling blocks from
breaking
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 7a130dbd04b24b2905fbc2a6f9303aae7fd61fd9..ad554a9361d6b27cc9f67f72cb7473622a53be1a 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -357,10 +357,14 @@ public class FallingBlockEntity extends Entity implements me.samsuik.sakura.enti
tileentity.setChanged();
}
}
- } else if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ // Sakura start - fix the do entity drops gamerule
+ } else {
this.discard(EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
- this.callOnBrokenAfterFall(block, blockposition);
- this.spawnAtLocation((ItemLike) block);
+ if (this.dropItem && this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
+ this.callOnBrokenAfterFall(block, blockposition);
+ this.spawnAtLocation((ItemLike) block);
+ }
+ // Sakura end
}
} else {
this.discard(EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause