mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-23 05:36:46 +01:00
Minor cleanup
This commit is contained in:
parent
ba4d0451ff
commit
2799bab206
@ -23,7 +23,7 @@ public class Salvage {
|
||||
public static int salvageUnlockLevel = Config.getInstance().getSalvageUnlockLevel();
|
||||
public static int anvilID = Config.getInstance().getSalvageAnvilId();
|
||||
|
||||
public static void handleSalvage(final Player player, final Location location, final ItemStack inHand) {
|
||||
public static void handleSalvage(final Player player, final Location location, final ItemStack item) {
|
||||
if (!configInstance.getSalvageEnabled()) {
|
||||
return;
|
||||
}
|
||||
@ -32,12 +32,16 @@ public class Salvage {
|
||||
final int skillLevel = Users.getPlayer(player).getProfile().getSkillLevel(SkillType.REPAIR);
|
||||
final int unlockLevel = configInstance.getSalvageUnlockLevel();
|
||||
|
||||
if (skillLevel >= unlockLevel) {
|
||||
final float currentdura = inHand.getDurability();
|
||||
if (skillLevel < unlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
|
||||
return;
|
||||
}
|
||||
|
||||
final float currentdura = item.getDurability();
|
||||
|
||||
if (currentdura == 0) {
|
||||
final int salvagedAmount = getSalvagedAmount(inHand);
|
||||
final int itemID = getSalvagedItemID(inHand);
|
||||
final int salvagedAmount = getSalvagedAmount(item);
|
||||
final int itemID = getSalvagedItemID(item);
|
||||
|
||||
player.setItemInHand(new ItemStack(Material.AIR));
|
||||
location.setY(location.getY() + 1);
|
||||
@ -50,10 +54,7 @@ public class Salvage {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.NotFullDurability"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user