Permalink
Browse files

Fixed a few small bugs with Smelting.

  • Loading branch information...
1 parent bbbba12 commit 13111a8d1b3ecfff6216924f8ae80e584988c215 @gmcferrin gmcferrin committed Feb 28, 2013
View
4 src/main/java/com/gmail/nossr50/listeners/InventoryListener.java
@@ -120,7 +120,7 @@ public void onFurnaceSmeltEvent(FurnaceSmeltEvent event) {
}
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 void onFurnaceExtractEvent(FurnaceExtractEvent event) {
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()));
}
}
}
View
7 src/main/java/com/gmail/nossr50/skills/smelting/SmeltingManager.java
@@ -96,14 +96,17 @@ public int fuelEfficiency(int burnTime) {
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) {

0 comments on commit 13111a8

Please sign in to comment.