misc. changes (check description)

rename SECONDS to SECONDS_LEFT, and add SECONDS.
add %rankup_rank_money_left_<rank>% placeholder
add permission requirement
This commit is contained in:
okx-code
2018-09-02 20:11:07 +01:00
parent 82078dd31b
commit e8d24a434a
12 changed files with 96 additions and 68 deletions
@@ -58,9 +58,12 @@ public class MessageBuilder {
return this;
}
public MessageBuilder replaceFromTo(Prestige prestige) {
replace(Variable.FROM, prestige.getFrom());
replace(Variable.TO, prestige.getTo());
public MessageBuilder replaceFromTo(Rank rank) {
if(rank instanceof Prestige) {
Prestige prestige = (Prestige) rank;
replace(Variable.FROM, prestige.getFrom());
replace(Variable.TO, prestige.getTo());
}
return this;
}
@@ -17,7 +17,8 @@ public enum Variable {
AMOUNT_NEEDED,
PERCENT_DONE,
PERCENT_LEFT,
SECONDS;
SECONDS,
SECONDS_LEFT;
public String replace(String message, String value, String type) {
Pattern pattern = Pattern.compile("\\{" + type + "_" + this + "}", Pattern.CASE_INSENSITIVE);