Use the DecimalFormatter from SkillCommand

Why didn't I do this in the first place..
This commit is contained in:
TfT_02
2013-01-11 19:07:00 +01:00
parent 08592cbacf
commit db95085b26
31 changed files with 757 additions and 790 deletions

View File

@ -1,7 +1,5 @@
package com.gmail.nossr50.commands.skills;
import java.text.DecimalFormat;
import org.bukkit.ChatColor;
import com.gmail.nossr50.commands.SkillCommand;
@ -41,13 +39,12 @@ public class TamingCommand extends SkillCommand {
@Override
protected void dataCalculations() {
DecimalFormat df = new DecimalFormat("0.0");
float goreChanceF;
if (skillValue >= goreMaxLevel) goreChanceF = (goreChanceMax);
else goreChanceF = (float) (((double) goreChanceMax / (double) goreMaxLevel) * skillValue);
goreChance = df.format(goreChanceF);
if (goreChanceF + goreChanceF * 0.3333D >= 100D) goreChanceLucky = df.format(100D);
else goreChanceLucky = df.format(goreChanceF + goreChanceF * 0.3333D);
goreChance = percent.format(goreChanceF / 100D);
if (goreChanceF + goreChanceF * 0.3333D >= 100D) goreChanceLucky = percent.format(1D);
else goreChanceLucky = percent.format((goreChanceF + goreChanceF * 0.3333D) / 100D);
}
@Override