WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
This repository was archived by the owner on Apr 9, 2024. It is now read-only.

Commit 2bd59ff

Browse files
committed
Load JoinEvent properly on Paper
1 parent 53157a7 commit 2bd59ff

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

bukkit/src/main/java/ch/andre601/advancedserverlist/bukkit/events/JoinEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public class JoinEvent<F> implements Listener{
3939

4040
private final BukkitCore<F> plugin;
4141

42-
public JoinEvent(BukkitCore<F> plugin){
42+
private JoinEvent(BukkitCore<F> plugin){
4343
this.plugin = plugin;
4444
Bukkit.getPluginManager().registerEvents(this, plugin);
4545
}

bukkit/src/main/java/ch/andre601/advancedserverlist/paper/PaperCore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public void loadCommands(){
7878

7979
@Override
8080
public void loadEvents(){
81-
new JoinEvent(this);
82-
new PaperPingEvent(this);
81+
JoinEvent.init(this);
82+
PaperPingEvent.init(this);
8383
}
8484

8585
@Override

bukkit/src/main/java/ch/andre601/advancedserverlist/paper/events/PaperPingEvent.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ public class PaperPingEvent implements Listener{
3535

3636
private final PaperCore plugin;
3737

38-
public PaperPingEvent(PaperCore plugin){
38+
private PaperPingEvent(PaperCore plugin){
3939
this.plugin = plugin;
4040
plugin.getServer().getPluginManager().registerEvents(this, plugin);
4141
}
4242

43+
public static void init(PaperCore plugin){
44+
new PaperPingEvent(plugin);
45+
}
46+
4347
@EventHandler
4448
public void onPaperServerListPing(PaperServerListPingEvent event){
4549
PingEventHandler.handleEvent(new PaperEventWrapper(plugin, event));

0 commit comments

Comments
 (0)