diff --git a/bukkit/src/main/java/ch/andre601/advancedserverlist/bukkit/events/JoinEvent.java b/bukkit/src/main/java/ch/andre601/advancedserverlist/bukkit/events/JoinEvent.java index 1aa15768..23c27d3b 100644 --- a/bukkit/src/main/java/ch/andre601/advancedserverlist/bukkit/events/JoinEvent.java +++ b/bukkit/src/main/java/ch/andre601/advancedserverlist/bukkit/events/JoinEvent.java @@ -39,7 +39,7 @@ public class JoinEvent implements Listener{ private final BukkitCore plugin; - public JoinEvent(BukkitCore plugin){ + private JoinEvent(BukkitCore plugin){ this.plugin = plugin; Bukkit.getPluginManager().registerEvents(this, plugin); } diff --git a/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/PaperCore.java b/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/PaperCore.java index f6a9f411..14984f91 100644 --- a/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/PaperCore.java +++ b/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/PaperCore.java @@ -78,8 +78,8 @@ public void loadCommands(){ @Override public void loadEvents(){ - new JoinEvent(this); - new PaperPingEvent(this); + JoinEvent.init(this); + PaperPingEvent.init(this); } @Override diff --git a/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperPingEvent.java b/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperPingEvent.java index 7a6f5638..73d85652 100644 --- a/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperPingEvent.java +++ b/bukkit/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperPingEvent.java @@ -35,11 +35,15 @@ public class PaperPingEvent implements Listener{ private final PaperCore plugin; - public PaperPingEvent(PaperCore plugin){ + private PaperPingEvent(PaperCore plugin){ this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } + public static void init(PaperCore plugin){ + new PaperPingEvent(plugin); + } + @EventHandler public void onPaperServerListPing(PaperServerListPingEvent event){ PingEventHandler.handleEvent(new PaperEventWrapper(plugin, event));