mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Register expansions in the ServerLoadEvent which is called after the server startup process is complete.
Fixes #103
This commit is contained in:
parent
8f600aec25
commit
16d0a4f690
@ -132,8 +132,6 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
setupOptions();
|
||||
getCommand("placeholderapi").setExecutor(new PlaceholderAPICommands(this));
|
||||
new PlaceholderListener(this);
|
||||
getLogger().info("Placeholder expansion registration initializing...");
|
||||
expansionManager.registerAllExpansions();
|
||||
if (config.checkUpdates()) {
|
||||
new UpdateChecker(this).fetch();
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.server.PluginDisableEvent;
|
||||
import org.bukkit.event.server.PluginEnableEvent;
|
||||
import org.bukkit.event.server.ServerLoadEvent;
|
||||
|
||||
|
||||
public class PlaceholderListener implements Listener {
|
||||
@ -50,6 +51,12 @@ public class PlaceholderListener implements Listener {
|
||||
Bukkit.getPluginManager().registerEvents(this, instance);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerLoad(ServerLoadEvent e) {
|
||||
plugin.getLogger().info("Placeholder expansion registration initializing...");
|
||||
plugin.getExpansionManager().registerAllExpansions();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onExpansionUnregister(ExpansionUnregisterEvent event) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user