update to alpha.7

This commit is contained in:
okx-code
2018-08-23 21:29:53 +01:00
parent 32dc06cf62
commit 703342024d
14 changed files with 120 additions and 106 deletions
@@ -10,8 +10,8 @@ public enum Message {
SUCCESS_PRIVATE("rankup.success-private"),
CONFIRMATION("rankup.confirmation"),
TITLE("rankup.title"),
RANKS_HEADER("ranks.header"),
RANKS_FOOTER("ranks.footer"),
RANKS_HEADER("rankup.ranks.header"),
RANKS_FOOTER("rankup.ranks.footer"),
RANKS_COMPLETE("rankup.ranks.complete"),
RANKS_CURRENT("rankup.ranks.current"),
RANKS_INCOMPLETE("rankup.ranks.incomplete");
@@ -54,20 +54,6 @@ public class MessageBuilder {
return this;
}
public MessageBuilder replaceCost(CommandSender sender, Economy economy, Rank rank) {
Requirement money = rank.getRequirement("money");
if(money == null || economy == null) {
return this;
}
replace(Variable.MONEY, money.getAmount());
if(sender instanceof Player && rank.isInRank((Player) sender)) {
replace(Variable.MONEY_NEEDED, money.getRemaining((Player) sender));
} else {
replace(Variable.MONEY_NEEDED, money.getAmount());
}
return this;
}
/**
* Fails the MessageBuilder if the message is empty.
* if this fails, all subsequent calls to that MessageBuilder will do nothing