mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Check if server supports ServerLoadEvent and if so register the listener, if not delay registration of placeholders for 15 seconds.
This commit is contained in:
parent
1e25f35aac
commit
a741f35139
@ -132,6 +132,18 @@ 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);
|
||||||
|
try {
|
||||||
|
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
||||||
|
new ServerLoadEventListener(this);
|
||||||
|
} catch (ExceptionInInitializerError | ClassNotFoundException exception) {
|
||||||
|
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
getLogger().info("Placeholder expansion registration initializing...");
|
||||||
|
getExpansionManager().registerAllExpansions();
|
||||||
|
}
|
||||||
|
}, 20*15);
|
||||||
|
}
|
||||||
if (config.checkUpdates()) {
|
if (config.checkUpdates()) {
|
||||||
new UpdateChecker(this).fetch();
|
new UpdateChecker(this).fetch();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user