mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 05:04:43 +02:00
Cleanup formatting.
This commit is contained in:
@ -224,7 +224,7 @@ public class Repair {
|
||||
}
|
||||
|
||||
if(repairAmount <= 0 || repairAmount > 32767)
|
||||
repairAmount = 32767;
|
||||
repairAmount = 32767;
|
||||
|
||||
durability -= repairAmount;
|
||||
|
||||
@ -248,11 +248,11 @@ public class Repair {
|
||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
||||
|
||||
int randomChance = 100;
|
||||
int chance = (int) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * (double) skillLevel);
|
||||
int chance = (int) (((double) MAX_CHANCE / (double) MAX_BONUS_LEVEL) * skillLevel);
|
||||
if (skillLevel >= MAX_BONUS_LEVEL) chance = MAX_CHANCE;
|
||||
|
||||
if (player.hasPermission("mcmmo.perks.lucky.repair")) randomChance = (int) (randomChance * 0.75);
|
||||
|
||||
|
||||
if (chance > random.nextInt(randomChance) && permInstance.repairBonus(player)){
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.FeltEasy"));
|
||||
return true;
|
||||
|
@ -29,27 +29,27 @@ public class Salvage {
|
||||
}
|
||||
|
||||
if(player.getGameMode() == GameMode.SURVIVAL) {
|
||||
final PlayerProfile profile = Users.getProfile(player);
|
||||
final int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
|
||||
final int unlockLevel = configInstance.getSalvageUnlockLevel();
|
||||
final PlayerProfile profile = Users.getProfile(player);
|
||||
final int skillLevel = profile.getSkillLevel(SkillType.REPAIR);
|
||||
final int unlockLevel = configInstance.getSalvageUnlockLevel();
|
||||
|
||||
if (skillLevel >= unlockLevel) {
|
||||
final float currentdura = inHand.getDurability();
|
||||
if (skillLevel >= unlockLevel) {
|
||||
final float currentdura = inHand.getDurability();
|
||||
|
||||
if (currentdura == 0) {
|
||||
final int salvagedAmount = getSalvagedAmount(inHand);
|
||||
final int itemID = getSalvagedItemID(inHand);
|
||||
if (currentdura == 0) {
|
||||
final int salvagedAmount = getSalvagedAmount(inHand);
|
||||
final int itemID = getSalvagedItemID(inHand);
|
||||
|
||||
player.setItemInHand(new ItemStack(0));
|
||||
location.setY(location.getY() + 1);
|
||||
Misc.dropItem(location, new ItemStack(itemID, salvagedAmount));
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.SalvageSuccess"));
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.NotFullDurability"));
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
|
||||
}
|
||||
player.setItemInHand(new ItemStack(0));
|
||||
location.setY(location.getY() + 1);
|
||||
Misc.dropItem(location, new ItemStack(itemID, salvagedAmount));
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.SalvageSuccess"));
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.NotFullDurability"));
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptSalvage"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,12 +38,12 @@ public class SimpleRepairable implements Repairable {
|
||||
|
||||
@Override
|
||||
public RepairItemType getRepairItemType() {
|
||||
return repairItemType;
|
||||
return repairItemType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RepairMaterialType getRepairMaterialType() {
|
||||
return repairMaterialType;
|
||||
return repairMaterialType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user