Made the classes (ForceRedeem, VoucherReceive, VoucherRedeem) follow the contract provided by Event properly

This commit is contained in:
theone1000 2019-09-16 20:43:21 -06:00
parent f27a76a583
commit c1b57454b9
4 changed files with 119 additions and 108 deletions

View File

@ -52,4 +52,8 @@ public class ForceRedeemEvent extends Event implements Cancellable {
return handlers; return handlers;
} }
public static HandlerList getHandlerList() {
return handlers;
}
} }

View File

@ -59,4 +59,8 @@ public class VoucherReceiveEvent extends Event implements Cancellable {
return handlers; return handlers;
} }
public static HandlerList getHandlerList() {
return handlers;
}
} }

View File

@ -52,4 +52,8 @@ public class VoucherRedeemEvent extends Event implements Cancellable {
return handlers; return handlers;
} }
public static HandlerList getHandlerList() {
return handlers;
}
} }

View File

@ -141,7 +141,6 @@ public class Voucher {
} }
public void give(CommandSender sender, List<Player> players, int amount) { public void give(CommandSender sender, List<Player> players, int amount) {
String giveMessage = instance.getLocale().getMessage("command.give.send") String giveMessage = instance.getLocale().getMessage("command.give.send")
.processPlaceholder("player", players.size() == 1 ? players.get(0).getName() : "everyone") .processPlaceholder("player", players.size() == 1 ? players.get(0).getName() : "everyone")
.processPlaceholder("voucher", Matcher.quoteReplacement(getName(true))) .processPlaceholder("voucher", Matcher.quoteReplacement(getName(true)))