- patch placeholders
- fix an error if you have setup ranks incorrectly
This commit is contained in:
okx-code
2020-09-23 17:20:55 +01:00
parent 598962592b
commit 2bb17a0b71
4 changed files with 179 additions and 172 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ plugins {
}
group 'sh.okx'
version '3.9'
version '3.9.1'
repositories {
mavenCentral()
@@ -12,7 +12,9 @@ public class Rankup extends Rank {
String next = section.getString("next");
String rank = section.getString("rank");
if (next != null && next.isEmpty()) {
if (next == null || next.isEmpty()) {
plugin.getLogger().warning("Having a final rank (for example: \"Z: rank: 'Z'\") from 3.4.2 or earlier should no longer be used.\n"
+ "It is safe to just delete the final rank " + section.getName() + "");
plugin.getLogger().warning("Rankup section '" + section.getName() + "' has a blank 'next' field, will be ignored.");
return null;
}
@@ -30,5 +30,10 @@ public abstract class ProgressiveRequirement extends Requirement {
return Math.max(0, (multiplier * getTotal(player)) - getProgress(player));
}
@Override
public double getTotal(Player player) {
return getValueDouble();
}
public abstract double getProgress(Player player);
}
@@ -99,6 +99,6 @@ public abstract class Requirement implements Cloneable {
public abstract Requirement clone();
public double getTotal(Player player) {
return getValueDouble();
return 1;
}
}