Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Commit

Permalink
Load JoinEvent properly on Paper
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Apr 26, 2023
1 parent 53157a7 commit 2bd59ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class JoinEvent<F> implements Listener{

private final BukkitCore<F> plugin;

public JoinEvent(BukkitCore<F> plugin){
private JoinEvent(BukkitCore<F> plugin){
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public void loadCommands(){

@Override
public void loadEvents(){
new JoinEvent(this);
new PaperPingEvent(this);
JoinEvent.init(this);
PaperPingEvent.init(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 2bd59ff

Please sign in to comment.