Fixed a few small bugs with Smelting.

This commit is contained in:
GJ 2013-02-28 17:32:36 -05:00
parent bbbba12e95
commit 13111a8d1b
2 changed files with 7 additions and 4 deletions

View File

@ -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()));
}
}
}

View File

@ -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) {