From 13111a8d1b3ecfff6216924f8ae80e584988c215 Mon Sep 17 00:00:00 2001 From: GJ Date: Thu, 28 Feb 2013 17:32:36 -0500 Subject: [PATCH] Fixed a few small bugs with Smelting. --- .../com/gmail/nossr50/listeners/InventoryListener.java | 4 ++-- .../com/gmail/nossr50/skills/smelting/SmeltingManager.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java index b5570d016..c49485bdb 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/InventoryListener.java @@ -120,7 +120,7 @@ public class InventoryListener implements Listener{ } if (Permissions.skillEnabled(player, SkillType.SMELTING)) { - SkillManagerStore.getInstance().getSmeltingManager(player.getName()).smeltProcessing(event.getSource().getType(), event.getResult()); + event.setResult(SkillManagerStore.getInstance().getSmeltingManager(player.getName()).smeltProcessing(event.getSource().getType(), event.getResult())); } } } @@ -137,7 +137,7 @@ public class InventoryListener implements Listener{ McMMOPlayer mcMMOPlayer = Users.getPlayer(event.getPlayer()); if (mcMMOPlayer.getPlayer().equals(plugin.getFurnacePlayer(furnaceBlock))) { - SkillManagerStore.getInstance().getSmeltingManager(event.getPlayer().getName()).vanillaXPBoost(event.getExpToDrop()); + event.setExpToDrop(SkillManagerStore.getInstance().getSmeltingManager(event.getPlayer().getName()).vanillaXPBoost(event.getExpToDrop())); } } } diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java index c8985a680..d44612021 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java @@ -96,14 +96,17 @@ public class SmeltingManager extends SkillManager { return (int) (burnTime * burnModifier); } - public void smeltProcessing(Material resourceType, ItemStack result) { + public ItemStack smeltProcessing(Material resourceType, ItemStack result) { Player player = getPlayer(); applyXpGain(Smelting.getResourceXp(resourceType)); if (Permissions.doubleDrops(player, skill) && SkillTools.activationSuccessful(player, skill, Smelting.secondSmeltMaxChance, Smelting.secondSmeltMaxLevel)) { - result.setAmount(result.getAmount() + 1); + ItemStack newResult = new ItemStack(result.getType(), result.getAmount() + 1); + return newResult; } + + return result; } public int vanillaXPBoost(int experience) {