mirror of
https://github.com/Zrips/Jobs.git
synced 2025-02-08 08:21:41 +01:00
Now the command boost works again
This commit is contained in:
parent
47280b04d0
commit
4115bf727a
@ -101,20 +101,11 @@ public class expboost implements Cmd {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
if (one.getName().equalsIgnoreCase(args[1])) {
|
||||
one.addBoost(CurrencyType.EXP, 1.0);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
job.addBoost(CurrencyType.EXP, 1.0);
|
||||
|
||||
if (found) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.jobsboostreset", "%jobname%",
|
||||
job.getName()));
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.expboost.output.jobsboostreset", "%jobname%",
|
||||
job.getName()));
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(args[0]);
|
||||
|
@ -101,20 +101,11 @@ public class moneyboost implements Cmd {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
if (one.getName().equalsIgnoreCase(args[1])) {
|
||||
one.addBoost(CurrencyType.MONEY, 1.0);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
job.addBoost(CurrencyType.MONEY, 1.0);
|
||||
|
||||
if (found) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.jobsboostreset",
|
||||
"%jobname%", job.getName()));
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.moneyboost.output.jobsboostreset", "%jobname%",
|
||||
job.getName()));
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(args[0]);
|
||||
|
@ -101,20 +101,11 @@ public class pointboost implements Cmd {
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean found = false;
|
||||
for (Job one : Jobs.getJobs()) {
|
||||
if (one.getName().equalsIgnoreCase(args[1])) {
|
||||
one.addBoost(CurrencyType.POINTS, 1.0);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
job.addBoost(CurrencyType.POINTS, 1.0);
|
||||
|
||||
if (found) {
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.jobsboostreset",
|
||||
"%jobname%", job.getName()));
|
||||
return true;
|
||||
}
|
||||
sender.sendMessage(Jobs.getLanguage().getMessage("command.pointboost.output.jobsboostreset", "%jobname%",
|
||||
job.getName()));
|
||||
return true;
|
||||
}
|
||||
|
||||
Job job = Jobs.getJob(args[0]);
|
||||
|
@ -56,17 +56,23 @@ public class Boost {
|
||||
|
||||
public double getFinal(CurrencyType BT, boolean percent, boolean excludeExtra) {
|
||||
double r = 0D;
|
||||
|
||||
for (BoostOf one : BoostOf.values()) {
|
||||
if (!map.containsKey(one))
|
||||
continue;
|
||||
|
||||
if (excludeExtra && (one == BoostOf.NearSpawner || one == BoostOf.PetPay))
|
||||
continue;
|
||||
|
||||
if (!map.get(one).isValid())
|
||||
continue;
|
||||
|
||||
r += map.get(one).get(BT);
|
||||
}
|
||||
|
||||
if (r < -1)
|
||||
r = -1;
|
||||
if (percent)
|
||||
return (int) (r * 100);
|
||||
return r;
|
||||
|
||||
return percent ? (int) (r * 100) : r;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user