Fix placeholders not being replaced (processPlaceholders already adds %%)

This commit is contained in:
Vrontis 2019-08-11 21:04:05 +00:00 committed by Stefano
parent 0826bd74d8
commit cfc03a4790
2 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,7 @@ public class EfCommand extends BaseCommand {
@Description("List all available vouchers.")
public void onList(CommandSender sender) {
instance.getLocale().getMessage("command.list.list")
.processPlaceholder("%list%", String.join(", ", instance.getVouchers().keySet()))
.processPlaceholder("list", String.join(", ", instance.getVouchers().keySet()))
.sendPrefixedMessage(sender);
}

View File

@ -143,15 +143,15 @@ public class Voucher {
public void give(CommandSender sender, List<Player> players, int amount) {
String giveMessage = instance.getLocale().getMessage("command.give.send")
.processPlaceholder("%player%", players.size() == 1 ? players.get(0).getName() : "everyone")
.processPlaceholder("%voucher%", Matcher.quoteReplacement(getName(true)))
.processPlaceholder("%amount%", String.valueOf(amount)).getPrefixedMessage();
.processPlaceholder("player", players.size() == 1 ? players.get(0).getName() : "everyone")
.processPlaceholder("voucher", Matcher.quoteReplacement(getName(true)))
.processPlaceholder("amount", String.valueOf(amount)).getPrefixedMessage();
for (Player player : players) {
String receiveMessage = instance.getLocale().getMessage("command.give.receive")
.processPlaceholder("%voucher%", Matcher.quoteReplacement(getName(true)))
.processPlaceholder("%player%", player.getName())
.processPlaceholder("%amount%", String.valueOf(amount)).getPrefixedMessage();
.processPlaceholder("voucher", Matcher.quoteReplacement(getName(true)))
.processPlaceholder("player", player.getName())
.processPlaceholder("amount", String.valueOf(amount)).getPrefixedMessage();
VoucherReceiveEvent event = new VoucherReceiveEvent(player, getName(true), toItemStack(amount), amount, sender);
Bukkit.getServer().getPluginManager().callEvent(event);