mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-01 16:19:53 +01:00
Fixed a few small bugs with Smelting.
This commit is contained in:
parent
bbbba12e95
commit
13111a8d1b
@ -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()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user