mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
Changed placeholders to register 1 tick after server startup.
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
<groupId>me.clip</groupId>
|
||||
<artifactId>placeholderapi</artifactId>
|
||||
|
||||
<version>2.10.1</version>
|
||||
<version>2.10.1-DEV-${BUILD_NUMBER}</version>
|
||||
<name>PlaceholderAPI</name>
|
||||
<description>An awesome placeholder provider!</description>
|
||||
<url>http://extendedclip.com</url>
|
||||
|
@@ -137,18 +137,15 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
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...");
|
||||
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
||||
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
||||
getExpansionManager().registerAllExpansions();
|
||||
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
||||
alreadyRegistered.entrySet().stream().forEach(hook -> PlaceholderAPI.registerPlaceholderHook(hook.getKey(), hook.getValue()));
|
||||
}
|
||||
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||
getLogger().info("Placeholder expansion registration initializing...");
|
||||
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
||||
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
||||
getExpansionManager().registerAllExpansions();
|
||||
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
||||
alreadyRegistered.forEach(PlaceholderAPI::registerPlaceholderHook);
|
||||
}
|
||||
}, 20*15);
|
||||
}, 1);
|
||||
}
|
||||
if (config.checkUpdates()) {
|
||||
new UpdateChecker(this).fetch();
|
||||
|
Reference in New Issue
Block a user