From 2cef6700c78e87e56c33643e6407d0714651e6a3 Mon Sep 17 00:00:00 2001 From: GJ Date: Sun, 10 Mar 2013 14:53:51 -0400 Subject: [PATCH] Just to be 100% sure this gets processed correctly. The blockstate DOES current store the metadata of the block, but I'd rather stick with using the Block every time to be absolutely certain that things are handled correctly. --- .../com/gmail/nossr50/listeners/InventoryListener.java | 7 ++++--- 1 file changed, 4 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 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();