From 8ccaf3caf2b5feb312118dc22bdddcb3634b5615 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 23 Jan 2013 19:19:35 -0500 Subject: [PATCH] Fix ClassCastException --- .../java/com/gmail/nossr50/listeners/InventoryListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index 8c1cce55e..5d3f4c68a 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -57,7 +57,7 @@ public class InventoryListener implements Listener{ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceBurnEvent(FurnaceBurnEvent event) { Block furnaceBlock = event.getBlock(); - FurnaceInventory inventory = ((Furnace)furnaceBlock).getInventory(); + FurnaceInventory inventory = ((Furnace)furnaceBlock.getState()).getInventory(); if (plugin.furnaceIsTracked(furnaceBlock) && ItemChecks.isSmeltable(inventory.getSmelting())) { SmeltingManager smeltingManager = new SmeltingManager(plugin.getFurnacePlayer(furnaceBlock)); @@ -68,7 +68,7 @@ public class InventoryListener implements Listener{ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceSmeltEvent(FurnaceSmeltEvent event) { Block furnaceBlock = event.getBlock(); - FurnaceInventory inventory = ((Furnace)furnaceBlock).getInventory(); + FurnaceInventory inventory = ((Furnace)furnaceBlock.getState()).getInventory(); if (plugin.furnaceIsTracked(furnaceBlock) && ItemChecks.isSmeltable(inventory.getSmelting())) { SmeltingManager smeltingManager = new SmeltingManager(plugin.getFurnacePlayer(furnaceBlock)); @@ -79,7 +79,7 @@ public class InventoryListener implements Listener{ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) public void onFurnaceExtractEvent(FurnaceExtractEvent event) { Block furnaceBlock = event.getBlock(); - FurnaceInventory inventory = ((Furnace)furnaceBlock).getInventory(); + FurnaceInventory inventory = ((Furnace)furnaceBlock.getState()).getInventory(); if (plugin.furnaceIsTracked(furnaceBlock) && ItemChecks.isSmeltable(inventory.getSmelting())) { SmeltingManager smeltingManager = new SmeltingManager(plugin.getFurnacePlayer(furnaceBlock));