From 77a7623003612cd76e1bee6b74ccd54e6eeab4a8 Mon Sep 17 00:00:00 2001 From: ceze88 Date: Fri, 15 Dec 2023 12:24:30 +0100 Subject: [PATCH] Fix items not dropping in some versions --- .../com/craftaro/epicfurnaces/listeners/BlockListeners.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/craftaro/epicfurnaces/listeners/BlockListeners.java b/src/main/java/com/craftaro/epicfurnaces/listeners/BlockListeners.java index e56adc5..bc77f03 100644 --- a/src/main/java/com/craftaro/epicfurnaces/listeners/BlockListeners.java +++ b/src/main/java/com/craftaro/epicfurnaces/listeners/BlockListeners.java @@ -110,6 +110,7 @@ public class BlockListeners implements Listener { } Furnace furnace = this.plugin.getFurnaceManager().getFurnace(block); + org.bukkit.block.Furnace state = (org.bukkit.block.Furnace) block.getState(); if (furnace == null) { return; @@ -126,8 +127,10 @@ public class BlockListeners implements Listener { : block.getType(), level, furnace.getUses()); // By canceling the event, we destroy any chance of items dropping from the furnace. This fixes the problem. - //furnace.dropItems(); No need to drop items. dropItemNaturally() will drop the items inside the furnace + furnace.dropItems(); + //Clear furnace inventory before destroying it to make sure no items duplicated + state.getInventory().clear(); event.getBlock().setType(Material.AIR); event.getBlock().getLocation().getWorld().dropItemNaturally(event.getBlock().getLocation(), item); }