mirror of
https://github.com/songoda/EpicVouchers.git
synced 2024-11-14 22:25:29 +01:00
Made the classes (ForceRedeem, VoucherReceive, VoucherRedeem) follow the contract provided by Event properly
This commit is contained in:
parent
f27a76a583
commit
c1b57454b9
@ -8,48 +8,52 @@ import org.bukkit.event.HandlerList;
|
||||
|
||||
public class ForceRedeemEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final int amount;
|
||||
private final CommandSender sender;
|
||||
private boolean cancelled;
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final int amount;
|
||||
private final CommandSender sender;
|
||||
private boolean cancelled;
|
||||
|
||||
public ForceRedeemEvent(Player player, String voucher, int amount, CommandSender sender) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.amount = amount;
|
||||
this.sender = sender;
|
||||
this.cancelled = false;
|
||||
}
|
||||
public ForceRedeemEvent(Player player, String voucher, int amount, CommandSender sender) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.amount = amount;
|
||||
this.sender = sender;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -9,54 +9,58 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class VoucherReceiveEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final ItemStack item;
|
||||
private final int amount;
|
||||
private final CommandSender sender;
|
||||
private boolean cancelled;
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final ItemStack item;
|
||||
private final int amount;
|
||||
private final CommandSender sender;
|
||||
private boolean cancelled;
|
||||
|
||||
public VoucherReceiveEvent(Player player, String voucher, ItemStack item, int amount, CommandSender sender) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.item = item;
|
||||
this.amount = amount;
|
||||
this.sender = sender;
|
||||
this.cancelled = false;
|
||||
}
|
||||
public VoucherReceiveEvent(Player player, String voucher, ItemStack item, int amount, CommandSender sender) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.item = item;
|
||||
this.amount = amount;
|
||||
this.sender = sender;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
public CommandSender getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -8,48 +8,52 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class VoucherRedeemEvent extends Event implements Cancellable {
|
||||
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final ItemStack item;
|
||||
private final boolean manual;
|
||||
private boolean cancelled;
|
||||
private final Player player;
|
||||
private final String voucher;
|
||||
private final ItemStack item;
|
||||
private final boolean manual;
|
||||
private boolean cancelled;
|
||||
|
||||
public VoucherRedeemEvent(Player player, String voucher, ItemStack item, boolean manual) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.item = item;
|
||||
this.manual = manual;
|
||||
this.cancelled = false;
|
||||
}
|
||||
public VoucherRedeemEvent(Player player, String voucher, ItemStack item, boolean manual) {
|
||||
this.player = player;
|
||||
this.voucher = voucher;
|
||||
this.item = item;
|
||||
this.manual = manual;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
public String getVoucher() {
|
||||
return voucher;
|
||||
}
|
||||
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public boolean getManual() {
|
||||
return manual;
|
||||
}
|
||||
public boolean getManual() {
|
||||
return manual;
|
||||
}
|
||||
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
}
|
@ -141,7 +141,6 @@ 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)))
|
||||
|
Loading…
Reference in New Issue
Block a user