From 7a520a41ec38f32c972b448e50076bb7bf9e70ae Mon Sep 17 00:00:00 2001 From: Sparkling Comet Date: Sun, 3 Jul 2022 22:14:53 +0200 Subject: [PATCH] Fix midding static handler method --- .../framework/events/HopperShopAccessEvent.java | 9 +++++++++ .../framework/events/PlayerShopChangeEvent.java | 6 +++++- .../tradeshop/framework/events/PlayerShopCloseEvent.java | 6 +++++- .../framework/events/PlayerShopCreateEvent.java | 4 ++++ .../framework/events/PlayerShopDestroyEvent.java | 6 +++++- .../framework/events/PlayerShopInventoryOpenEvent.java | 6 +++++- .../tradeshop/framework/events/PlayerShopOpenEvent.java | 6 +++++- .../tradeshop/framework/events/TradeShopReloadEvent.java | 8 ++++---- 8 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/HopperShopAccessEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/HopperShopAccessEvent.java index 1c59ddf0..5cd8fb71 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/HopperShopAccessEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/HopperShopAccessEvent.java @@ -64,4 +64,13 @@ public void setForbidden(boolean forbidden) { public HopperDirection getItemDirection() { return dir; } + + @Override + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } } diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopChangeEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopChangeEvent.java index c12cfd1d..ef5bddec 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopChangeEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopChangeEvent.java @@ -30,11 +30,15 @@ public PlayerShopChangeEvent(Player player, Shop s, ShopChange change, ObjectHol super(player); this.shop = s; } - + @Override public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns the {@link Shop} object representing the player shop this event is about. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCloseEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCloseEvent.java index a44a0887..672c60a1 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCloseEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCloseEvent.java @@ -25,11 +25,15 @@ public PlayerShopCloseEvent(Player buyer, Shop s) { super(buyer); this.shop = s; } - + @Override public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns the {@link Shop} object representing the player shop this event is about. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCreateEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCreateEvent.java index b089e487..e5519222 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCreateEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopCreateEvent.java @@ -30,6 +30,10 @@ public PlayerShopCreateEvent(Player p, Shop shop) { public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns whether or not the event has been cancelled. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopDestroyEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopDestroyEvent.java index 7f17245d..4bb57db7 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopDestroyEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopDestroyEvent.java @@ -50,11 +50,15 @@ public PlayerShopDestroyEvent(Player p, Shop shop) { super(p); this.shop = shop; } - + @Override public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns whether or not the event has been cancelled. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopInventoryOpenEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopInventoryOpenEvent.java index d0dc9122..be471331 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopInventoryOpenEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopInventoryOpenEvent.java @@ -33,11 +33,15 @@ public PlayerShopInventoryOpenEvent(Player p, Shop s, Action action, ItemStack i super(p, action, itm, chest, chestFace); this.shop = s; } - + @Override public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns the {@link Shop} object representing the player shop this event is about. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopOpenEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopOpenEvent.java index 22b4d228..ee2661d5 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopOpenEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/PlayerShopOpenEvent.java @@ -25,11 +25,15 @@ public PlayerShopOpenEvent(Player buyer, Shop s) { super(buyer); this.shop = s; } - + @Override public HandlerList getHandlers() { return handlers; } + + public static HandlerList getHandlerList() { + return handlers; + } /** * Returns the {@link Shop} object representing the player shop this event is about. diff --git a/src/main/java/org/shanerx/tradeshop/framework/events/TradeShopReloadEvent.java b/src/main/java/org/shanerx/tradeshop/framework/events/TradeShopReloadEvent.java index db8d3f2c..49a85011 100644 --- a/src/main/java/org/shanerx/tradeshop/framework/events/TradeShopReloadEvent.java +++ b/src/main/java/org/shanerx/tradeshop/framework/events/TradeShopReloadEvent.java @@ -39,10 +39,6 @@ public class TradeShopReloadEvent extends ServerEvent { private static final HandlerList handlers = new HandlerList(); - public static HandlerList getHandlerList() { - return handlers; - } - public TradeShop plugin; public CommandSender sender; @@ -51,6 +47,10 @@ public HandlerList getHandlers() { return handlers; } + public static HandlerList getHandlerList() { + return handlers; + } + public TradeShopReloadEvent(TradeShop plugin, CommandSender sender) { super(); this.plugin = plugin;