2021-11-13 02:28:08 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
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
2021-11-25 08:10:26 +00:00
index 808bdd0e8d6b679c2eee87c3078a4c3dbcd08b8b..2da1609c42bc85f173ed56767933bcafd5f0422e 100644
2021-11-13 02:28:08 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
2021-11-25 08:10:26 +00:00
@@ -516,8 +516,14 @@ public class CraftBlock implements Block {
2021-11-13 02:28:08 +00:00
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