mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-11-16 07:35:32 +01:00
Merge branch 'master' of https://github.com/PlaceholderAPI/PlaceholderAPI
This commit is contained in:
commit
fc1a2af011
@ -30,6 +30,7 @@ import me.clip.placeholderapi.expansion.ExpansionManager;
|
||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||
import me.clip.placeholderapi.expansion.Version;
|
||||
import me.clip.placeholderapi.expansion.cloud.ExpansionCloudManager;
|
||||
import me.clip.placeholderapi.external.EZPlaceholderHook;
|
||||
import me.clip.placeholderapi.updatechecker.UpdateChecker;
|
||||
import me.clip.placeholderapi.util.TimeUtil;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
@ -144,9 +145,7 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
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());
|
||||
});
|
||||
alreadyRegistered.entrySet().stream().forEach(hook -> PlaceholderAPI.registerPlaceholderHook(hook.getKey(), hook.getValue()));
|
||||
}
|
||||
}
|
||||
}, 20*15);
|
||||
@ -158,6 +157,7 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
enableCloud();
|
||||
}
|
||||
setupMetrics();
|
||||
getServer().getScheduler().runTaskLater(this, this::checkHook, 20 * 30);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -186,6 +186,22 @@ public class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
+ " &aplaceholder hooks successfully registered!"));
|
||||
}
|
||||
|
||||
private void checkHook() {
|
||||
Map<String, PlaceholderHook> loaded = PlaceholderAPI.getPlaceholders();
|
||||
loaded.values().forEach(h -> {
|
||||
if (h instanceof EZPlaceholderHook) {
|
||||
String author;
|
||||
try {
|
||||
author = Bukkit.getPluginManager().getPlugin(((EZPlaceholderHook) h).getPluginName()).getDescription().getAuthors().toString();
|
||||
} catch (Exception ex) {
|
||||
author = "the author of the hook's plugin";
|
||||
}
|
||||
getLogger().warning(((EZPlaceholderHook) h).getPluginName() + " is currently using a deprecated method to hook into PlaceholderAPI. This will be disabled after the next update. " +
|
||||
"Please consult {author} and urge them to update it ASAP.".replace("{author}", author));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setupOptions() {
|
||||
booleanTrue = config.booleanTrue();
|
||||
if (booleanTrue == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user