mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-11-16 15:46:15 +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();
|
setupOptions();
|
||||||
getCommand("placeholderapi").setExecutor(new PlaceholderAPICommands(this));
|
getCommand("placeholderapi").setExecutor(new PlaceholderAPICommands(this));
|
||||||
new PlaceholderListener(this);
|
new PlaceholderListener(this);
|
||||||
getLogger().info("Placeholder expansion registration initializing...");
|
|
||||||
expansionManager.registerAllExpansions();
|
|
||||||
if (config.checkUpdates()) {
|
if (config.checkUpdates()) {
|
||||||
new UpdateChecker(this).fetch();
|
new UpdateChecker(this).fetch();
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.event.server.PluginDisableEvent;
|
import org.bukkit.event.server.PluginDisableEvent;
|
||||||
import org.bukkit.event.server.PluginEnableEvent;
|
import org.bukkit.event.server.PluginEnableEvent;
|
||||||
|
import org.bukkit.event.server.ServerLoadEvent;
|
||||||
|
|
||||||
|
|
||||||
public class PlaceholderListener implements Listener {
|
public class PlaceholderListener implements Listener {
|
||||||
@ -50,6 +51,12 @@ public class PlaceholderListener implements Listener {
|
|||||||
Bukkit.getPluginManager().registerEvents(this, instance);
|
Bukkit.getPluginManager().registerEvents(this, instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onServerLoad(ServerLoadEvent e) {
|
||||||
|
plugin.getLogger().info("Placeholder expansion registration initializing...");
|
||||||
|
plugin.getExpansionManager().registerAllExpansions();
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onExpansionUnregister(ExpansionUnregisterEvent event) {
|
public void onExpansionUnregister(ExpansionUnregisterEvent event) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user