mirror of
https://github.com/songoda/EpicVouchers.git
synced 2024-12-23 00:57:40 +01:00
Fix placeholders not being replaced (processPlaceholders already adds %%)
This commit is contained in:
parent
0826bd74d8
commit
cfc03a4790
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user