mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-29 04:18:02 +01:00
Changed placeholders to register 1 tick after server startup.
This commit is contained in:
parent
fc1a2af011
commit
9a2fb89e43
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
<groupId>me.clip</groupId>
|
<groupId>me.clip</groupId>
|
||||||
<artifactId>placeholderapi</artifactId>
|
<artifactId>placeholderapi</artifactId>
|
||||||
|
|
||||||
<version>2.10.1</version>
|
<version>2.10.1-DEV-${BUILD_NUMBER}</version>
|
||||||
<name>PlaceholderAPI</name>
|
<name>PlaceholderAPI</name>
|
||||||
<description>An awesome placeholder provider!</description>
|
<description>An awesome placeholder provider!</description>
|
||||||
<url>http://extendedclip.com</url>
|
<url>http://extendedclip.com</url>
|
||||||
|
@ -137,18 +137,15 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
|||||||
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
Class.forName("org.bukkit.event.server.ServerLoadEvent");
|
||||||
new ServerLoadEventListener(this);
|
new ServerLoadEventListener(this);
|
||||||
} catch (ExceptionInInitializerError | ClassNotFoundException exception) {
|
} catch (ExceptionInInitializerError | ClassNotFoundException exception) {
|
||||||
Bukkit.getScheduler().runTaskLater(this, new Runnable() {
|
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||||
@Override
|
getLogger().info("Placeholder expansion registration initializing...");
|
||||||
public void run() {
|
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
||||||
getLogger().info("Placeholder expansion registration initializing...");
|
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
||||||
//fetch any hooks that may have registered externally onEnable first otherwise they will be lost
|
getExpansionManager().registerAllExpansions();
|
||||||
final Map<String, PlaceholderHook> alreadyRegistered = PlaceholderAPI.getPlaceholders();
|
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
||||||
getExpansionManager().registerAllExpansions();
|
alreadyRegistered.forEach(PlaceholderAPI::registerPlaceholderHook);
|
||||||
if (alreadyRegistered != null && !alreadyRegistered.isEmpty()) {
|
|
||||||
alreadyRegistered.entrySet().stream().forEach(hook -> PlaceholderAPI.registerPlaceholderHook(hook.getKey(), hook.getValue()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}, 20*15);
|
}, 1);
|
||||||
}
|
}
|
||||||
if (config.checkUpdates()) {
|
if (config.checkUpdates()) {
|
||||||
new UpdateChecker(this).fetch();
|
new UpdateChecker(this).fetch();
|
||||||
|
Loading…
Reference in New Issue
Block a user