aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2021-11-12 18:28:08 -0800
committerGitHub <[email protected]>2021-11-12 18:28:08 -0800
commitdb0bff9c6ad42eefa22b094bb92df9bf3bc8ec66 (patch)
tree25a086ea1963426dc7a5fe206dbd15bfaa2f5464 /patches
parentf8992ee9b5b3baef4ad6ada0492a1bbd54f65ff8 (diff)
downloadPaper-db0bff9c6ad42eefa22b094bb92df9bf3bc8ec66.tar.gz
Paper-db0bff9c6ad42eefa22b094bb92df9bf3bc8ec66.zip
Call onRemove logic for breakNaturally (#6854)
Diffstat (limited to 'patches')
-rw-r--r--patches/server/0843-Call-onRemove-logic-for-breakNaturally.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/server/0843-Call-onRemove-logic-for-breakNaturally.patch b/patches/server/0843-Call-onRemove-logic-for-breakNaturally.patch
new file mode 100644
index 0000000000..4db123eba9
--- /dev/null
+++ b/patches/server/0843-Call-onRemove-logic-for-breakNaturally.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Sun, 31 Oct 2021 14:49:43 -0700
+Subject: [PATCH] Call onRemove logic for breakNaturally
+
+
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+index 5154cfffc414e1f6039e55f1a256bbaacb56bc55..6f01af8cc3f9ed4d2eaa3304990ca33f8692a453 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+@@ -513,8 +513,14 @@ public class CraftBlock implements Block {
+ if (triggerEffect) world.levelEvent(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.world.level.block.Block.getId(block.defaultBlockState())); // Paper
+ result = true;
+ }
++ // Paper start
++ net.minecraft.world.level.block.state.BlockState newBlockState = Blocks.AIR.defaultBlockState();
++ if (this.world instanceof net.minecraft.world.level.Level level) {
++ iblockdata.onRemove(level, position, newBlockState, false);
++ }
++ // Paper end
+
+- return this.setTypeAndData(Blocks.AIR.defaultBlockState(), true) && result;
++ return this.setTypeAndData(newBlockState, true) && result; // Paper
+ }
+
+ @Override