From 57a9fc68367d7265a016bb4fa207a5c3a28f1048 Mon Sep 17 00:00:00 2001 From: Jeroen <48769316+iTwins@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:26:33 +0200 Subject: [PATCH] fix breaking sf block with not unlocked item duping contents (#3976) --- .../implementation/listeners/BlockListener.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java index 30593427ee..f5cd298116 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/listeners/BlockListener.java @@ -141,15 +141,15 @@ public void onBlockBreak(BlockBreakEvent e) { } } - if (!e.isCancelled()) { - checkForSensitiveBlockAbove(e.getPlayer(), e.getBlock(), item); + List drops = new ArrayList<>(); + if (!item.getType().isAir()) { int fortune = getBonusDropsWithFortune(item, e.getBlock()); - List drops = new ArrayList<>(); + callToolHandler(e, item, fortune, drops); + } - if (!item.getType().isAir()) { - callToolHandler(e, item, fortune, drops); - } + if (!e.isCancelled()) { + checkForSensitiveBlockAbove(e.getPlayer(), e.getBlock(), item); callBlockHandler(e, item, drops, sfItem); dropItems(e, drops);