mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 11:44:42 +02:00
Cleanup formatting.
This commit is contained in:
@ -36,13 +36,13 @@ public class AcrobaticsCommand extends SkillCommand {
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
// DODGE
|
||||
if(skillValue >= dodgeMaxBonusLevel) dodgeChance = df.format(dodgeChanceMax);
|
||||
else dodgeChance = df.format(((double) dodgeChanceMax / (double) dodgeMaxBonusLevel) * (double) skillValue);
|
||||
else dodgeChance = df.format(((double) dodgeChanceMax / (double) dodgeMaxBonusLevel) * skillValue);
|
||||
// ROLL
|
||||
if(skillValue >= rollMaxBonusLevel) rollChance = df.format(rollChanceMax);
|
||||
else rollChance = df.format(((double) rollChanceMax / (double) rollMaxBonusLevel) * (double) skillValue);
|
||||
else rollChance = df.format(((double) rollChanceMax / (double) rollMaxBonusLevel) * skillValue);
|
||||
// GRACEFULROLL
|
||||
if(skillValue >= gracefulRollMaxBonusLevel) gracefulRollChance = df.format(gracefulRollChanceMax);
|
||||
else gracefulRollChance = df.format(((double) gracefulRollChanceMax / (double) gracefulRollMaxBonusLevel) * (double) skillValue);
|
||||
else gracefulRollChance = df.format(((double) gracefulRollChanceMax / (double) gracefulRollMaxBonusLevel) * skillValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -59,10 +59,10 @@ public class AcrobaticsCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected void effectsDisplay() {
|
||||
if (player.hasPermission("mcmmo.perks.lucky.acrobatics")) {
|
||||
String perkPrefix = ChatColor.RED + "[mcMMO Perks] ";
|
||||
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { "Acrobatics" }) }));
|
||||
}
|
||||
if (player.hasPermission("mcmmo.perks.lucky.acrobatics")) {
|
||||
String perkPrefix = ChatColor.RED + "[mcMMO Perks] ";
|
||||
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { "Acrobatics" }) }));
|
||||
}
|
||||
|
||||
if (canRoll) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1") }));
|
||||
|
@ -39,17 +39,17 @@ public class ArcheryCommand extends SkillCommand {
|
||||
protected void dataCalculations() {
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
// SkillShot
|
||||
double bonus = (int)((double) skillValue / (double) skillShotIncreaseLevel) * (double) skillShotIncreasePercentage;
|
||||
double bonus = (int)((double) skillValue / (double) skillShotIncreaseLevel) * skillShotIncreasePercentage;
|
||||
if (bonus > skillShotBonusMax) skillShotBonus = percent.format(skillShotBonusMax);
|
||||
else skillShotBonus = percent.format(bonus);
|
||||
|
||||
|
||||
// Daze
|
||||
if(skillValue >= dazeMaxBonusLevel) dazeChance = df.format(dazeBonusMax);
|
||||
else dazeChance = df.format(((double) dazeBonusMax / (double) dazeMaxBonusLevel) * (double) skillValue);
|
||||
else dazeChance = df.format(((double) dazeBonusMax / (double) dazeMaxBonusLevel) * skillValue);
|
||||
|
||||
// Retrieve
|
||||
if(skillValue >= retrieveMaxBonusLevel) retrieveChance = df.format(retrieveBonusMax);
|
||||
else retrieveChance = df.format(((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * (double) skillValue);
|
||||
else retrieveChance = df.format(((double) retrieveBonusMax / (double) retrieveMaxBonusLevel) * skillValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -66,10 +66,10 @@ public class ArcheryCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected void effectsDisplay() {
|
||||
if (player.hasPermission("mcmmo.perks.lucky.archery")) {
|
||||
String perkPrefix = ChatColor.RED + "[mcMMO Perks] ";
|
||||
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { "Archery" }) }));
|
||||
}
|
||||
if (player.hasPermission("mcmmo.perks.lucky.archery")) {
|
||||
String perkPrefix = ChatColor.RED + "[mcMMO Perks] ";
|
||||
player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { "Archery" }) }));
|
||||
}
|
||||
|
||||
if (canSkillShot) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1") }));
|
||||
|
@ -12,7 +12,7 @@ import com.gmail.nossr50.util.Misc;
|
||||
|
||||
public class AxesCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
|
||||
private String critChance;
|
||||
private String bonusDamage;
|
||||
private String impactDamage;
|
||||
@ -24,7 +24,7 @@ public class AxesCommand extends SkillCommand {
|
||||
private double critMaxChance = advancedConfig.getAxesCriticalChance();
|
||||
private int critMaxBonusLevel = advancedConfig.getAxesCriticalMaxBonusLevel();
|
||||
private int greaterImpactIncreaseLevel = advancedConfig.getArmorImpactIncreaseLevel();
|
||||
// private double greaterImpactModifier = advancedConfig.getGreaterImpactModifier();
|
||||
// private double greaterImpactModifier = advancedConfig.getGreaterImpactModifier();
|
||||
private int abilityLengthIncreaseLevel = advancedConfig.getAbilityLength();
|
||||
|
||||
private boolean canSkullSplitter;
|
||||
@ -47,9 +47,9 @@ public class AxesCommand extends SkillCommand {
|
||||
greaterImpactDamage = "2";
|
||||
|
||||
if (skillValue >= critMaxBonusLevel) critChance = df.format(critMaxChance);
|
||||
else critChance = String.valueOf(((double) critMaxChance / (double) critMaxBonusLevel) * (double) skillCheck);
|
||||
else critChance = String.valueOf((critMaxChance / critMaxBonusLevel) * skillCheck);
|
||||
if (skillValue >= bonusDamageAxesMaxBonusLevel) bonusDamage = String.valueOf(bonusDamageAxesBonusMax);
|
||||
else bonusDamage = String.valueOf((double) skillValue / ((double) bonusDamageAxesMaxBonusLevel / (double) bonusDamageAxesBonusMax));
|
||||
else bonusDamage = String.valueOf(skillValue / ((double) bonusDamageAxesMaxBonusLevel / (double) bonusDamageAxesBonusMax));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,7 +11,7 @@ import com.gmail.nossr50.skills.gathering.Fishing;
|
||||
public class FishingCommand extends SkillCommand {
|
||||
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
|
||||
private int lootTier;
|
||||
private String magicChance;
|
||||
private int shakeUnlockLevel;
|
||||
@ -30,10 +30,10 @@ public class FishingCommand extends SkillCommand {
|
||||
@Override
|
||||
protected void dataCalculations() {
|
||||
lootTier = Fishing.getFishingLootTier(profile);
|
||||
magicChance = percent.format((double) lootTier / 15D);
|
||||
magicChance = percent.format(lootTier / 15D);
|
||||
int dropChance = Fishing.getShakeChance(lootTier);
|
||||
if (player.hasPermission("mcmmo.perks.lucky.fishing")) {
|
||||
dropChance = (int) ((double) dropChance * 1.25D);
|
||||
dropChance = (int) (dropChance * 1.25D);
|
||||
}
|
||||
shakeChance = String.valueOf(dropChance);
|
||||
|
||||
|
@ -12,7 +12,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public class HerbalismCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
|
||||
private String greenTerraLength;
|
||||
private String greenThumbChance;
|
||||
private String greenThumbStage;
|
||||
@ -28,7 +28,7 @@ public class HerbalismCommand extends SkillCommand {
|
||||
private int greenThumbMaxLevel = advancedConfig.getGreenThumbMaxLevel();
|
||||
private double doubleDropsMaxBonus = advancedConfig.getHerbalismDoubleDropsChanceMax();
|
||||
private int doubleDropsMaxLevel = advancedConfig.getHerbalismDoubleDropsMaxLevel();
|
||||
|
||||
|
||||
private boolean canGreenTerra;
|
||||
private boolean canGreenThumbWheat;
|
||||
private boolean canGreenThumbBlocks;
|
||||
@ -50,13 +50,13 @@ public class HerbalismCommand extends SkillCommand {
|
||||
//GREEN THUMB
|
||||
if(skillValue >= greenThumbStageMaxLevel) greenThumbStage = "4";
|
||||
else greenThumbStage = String.valueOf((double) skillValue / (double) greenThumbStageChange);
|
||||
|
||||
|
||||
|
||||
|
||||
if(skillValue >= greenThumbMaxLevel) greenThumbChance = String.valueOf(greenThumbMaxBonus);
|
||||
else greenThumbChance = String.valueOf(((double) greenThumbMaxBonus / (double) greenThumbMaxLevel) * (double) skillValue);
|
||||
else greenThumbChance = String.valueOf((greenThumbMaxBonus / greenThumbMaxLevel) * skillValue);
|
||||
//DOUBLE DROPS
|
||||
if(skillValue >= doubleDropsMaxLevel) doubleDropChance = df.format(doubleDropsMaxBonus);
|
||||
else doubleDropChance = df.format(((double) doubleDropsMaxBonus / (double) doubleDropsMaxLevel) * (double) skillValue);
|
||||
else doubleDropChance = df.format((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -48,8 +48,8 @@ public class MiningCommand extends SkillCommand {
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
superBreakerLength = String.valueOf(2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel));
|
||||
if(skillValue >= doubleDropsMaxLevel) doubleDropChance = df.format(doubleDropsMaxBonus);
|
||||
else doubleDropChance = df.format(((double) doubleDropsMaxBonus / (double) doubleDropsMaxLevel) * (double) skillValue);
|
||||
|
||||
else doubleDropChance = df.format((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||
|
||||
if (skillValue >= blastMiningRank8) {
|
||||
blastMiningRank = "8";
|
||||
blastDamageDecrease = "100.00%";
|
||||
|
@ -64,10 +64,10 @@ public class RepairCommand extends SkillCommand {
|
||||
salvageLevel = Config.getInstance().getSalvageUnlockLevel();
|
||||
|
||||
if(skillValue >= repairMasteryMaxBonusLevel) repairMasteryBonus = df.format(repairMasteryChanceMax);
|
||||
else repairMasteryBonus = df.format(((double) repairMasteryChanceMax / (double) repairMasteryMaxBonusLevel) * (double) skillValue);
|
||||
else repairMasteryBonus = df.format(((double) repairMasteryChanceMax / (double) repairMasteryMaxBonusLevel) * skillValue);
|
||||
|
||||
if(skillValue >= superRepairMaxBonusLevel) superRepairChance = df.format(superRepairChanceMax);
|
||||
else superRepairChance = df.format(((double) superRepairChanceMax / (double) superRepairMaxBonusLevel) * (double) skillValue);
|
||||
else superRepairChance = df.format(((double) superRepairChanceMax / (double) superRepairMaxBonusLevel) * skillValue);
|
||||
|
||||
arcaneForgingRank = Repair.getArcaneForgingRank(profile);
|
||||
}
|
||||
@ -85,7 +85,7 @@ public class RepairCommand extends SkillCommand {
|
||||
canRepairString = permInstance.stringRepair(player);
|
||||
canRepairLeather = permInstance.leatherRepair(player);
|
||||
canRepairWood = permInstance.woodRepair(player);
|
||||
arcaneBypass = permInstance.arcaneBypass(player);
|
||||
arcaneBypass = permInstance.arcaneBypass(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -11,7 +11,7 @@ import com.gmail.nossr50.locale.LocaleLoader;
|
||||
|
||||
public class SwordsCommand extends SkillCommand {
|
||||
AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
|
||||
|
||||
|
||||
private String counterAttackChance;
|
||||
private String bleedLength;
|
||||
private String bleedChance;
|
||||
@ -38,16 +38,16 @@ public class SwordsCommand extends SkillCommand {
|
||||
protected void dataCalculations() {
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
serratedStrikesLength = String.valueOf(2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel));
|
||||
|
||||
|
||||
if (skillValue >= bleedMaxLevel) bleedLength = String.valueOf(bleedMaxTicks);
|
||||
else bleedLength = String.valueOf(bleedBaseTicks);
|
||||
|
||||
if(skillValue >= bleedMaxLevel) bleedChance = df.format(bleedChanceMax);
|
||||
else bleedChance = df.format(((double) bleedChanceMax / (double) bleedMaxLevel) * (double) skillValue);
|
||||
|
||||
else bleedChance = df.format(((double) bleedChanceMax / (double) bleedMaxLevel) * skillValue);
|
||||
|
||||
if(skillValue >= counterMaxLevel) counterAttackChance = df.format(counterChanceMax);
|
||||
else counterAttackChance = df.format(((double) counterChanceMax / (double) counterMaxLevel) * (double) skillValue);
|
||||
|
||||
else counterAttackChance = df.format(((double) counterChanceMax / (double) counterMaxLevel) * skillValue);
|
||||
|
||||
serratedStrikesLength = String.valueOf(serratedBleedTicks);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class TamingCommand extends SkillCommand {
|
||||
private int thickFurUnlock = advancedConfig.getThickFurUnlock();
|
||||
private int shockProofUnlock = advancedConfig.getShockProofUnlock();
|
||||
private int sharpenedClawUnlock = advancedConfig.getSharpenedClawsUnlock();
|
||||
|
||||
|
||||
private boolean canBeastLore;
|
||||
private boolean canGore;
|
||||
private boolean canSharpenedClaws;
|
||||
@ -40,8 +40,8 @@ public class TamingCommand extends SkillCommand {
|
||||
protected void dataCalculations() {
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
if(skillValue >= goreMaxLevel) goreChance = df.format(goreChanceMax);
|
||||
else goreChance = df.format(((double) goreChanceMax / (double) goreMaxLevel) * (double) skillValue);
|
||||
}
|
||||
else goreChance = df.format(((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void permissionsCheck() {
|
||||
|
@ -39,10 +39,10 @@ public class UnarmedCommand extends SkillCommand {
|
||||
berserkLength = String.valueOf(2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel));
|
||||
|
||||
if(skillValue >= disarmMaxLevel) disarmChance = df.format(disarmChanceMax);
|
||||
else disarmChance = df.format(((double) disarmChanceMax / (double) disarmMaxLevel) * (double) skillValue);
|
||||
|
||||
else disarmChance = df.format(((double) disarmChanceMax / (double) disarmMaxLevel) * skillValue);
|
||||
|
||||
if(skillValue >= deflectMaxLevel) deflectChance = df.format(deflectChanceMax);
|
||||
else deflectChance = df.format(((double) deflectChanceMax / (double) deflectMaxLevel) * (double) skillValue);
|
||||
else deflectChance = df.format(((double) deflectChanceMax / (double) deflectMaxLevel) * skillValue);
|
||||
|
||||
if (skillValue >= 250) ironArmBonus = String.valueOf(ironArmMaxBonus);
|
||||
else ironArmBonus = String.valueOf(3 + ((double) skillValue / (double) ironArmIncreaseLevel));
|
||||
|
@ -19,7 +19,7 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
private double doubleDropsMaxBonus = advancedConfig.getWoodcuttingDoubleDropChance();
|
||||
private int doubleDropsMaxLevel = advancedConfig.getWoodcuttingDoubleDropMaxLevel();
|
||||
private int leafBlowUnlock = advancedConfig.getLeafBlowUnlockLevel();
|
||||
|
||||
|
||||
private boolean canTreeFell;
|
||||
private boolean canLeafBlow;
|
||||
private boolean canDoubleDrop;
|
||||
@ -35,7 +35,7 @@ public class WoodcuttingCommand extends SkillCommand {
|
||||
|
||||
treeFellerLength = String.valueOf(2 + (int) ((double) skillValue / (double) abilityLengthIncreaseLevel));
|
||||
if(skillValue >= doubleDropsMaxLevel) doubleDropChance = df.format(doubleDropsMaxBonus);
|
||||
else doubleDropChance = df.format(((double) doubleDropsMaxBonus / (double) doubleDropsMaxLevel) * (double) skillValue);
|
||||
else doubleDropChance = df.format((doubleDropsMaxBonus / doubleDropsMaxLevel) * skillValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user