diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 94fd00cc4..3fcd9b724 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -132,14 +132,15 @@ public class InventoryListener implements Listener { @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceExtractEvent(FurnaceExtractEvent event) { - BlockState furnaceState = event.getBlock().getState(); + Block furnaceBlock = event.getBlock(); + BlockState furnaceState = furnaceBlock.getState(); if (furnaceState instanceof Furnace) { ItemStack result = ((Furnace) furnaceState).getInventory().getResult(); - if (furnaceState.hasMetadata(mcMMO.furnaceMetadataKey) && result != null && ItemUtils.isSmelted(result)) { + if (furnaceBlock.hasMetadata(mcMMO.furnaceMetadataKey) && result != null && ItemUtils.isSmelted(result)) { // We can make this assumption because we (should) be the only ones using this exact metadata - Player player = plugin.getServer().getPlayer(furnaceState.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString()); + Player player = plugin.getServer().getPlayer(furnaceBlock.getMetadata(mcMMO.furnaceMetadataKey).get(0).asString()); SmeltingManager smeltingManager = UserManager.getPlayer(player).getSmeltingManager();