private void setupMetrics() { Metrics m = new Metrics(this); m.addCustomChart(new Metrics.SimplePie("using_expansion_cloud", () -> getExpansionCloud() != null ? "yes" : "no")); m.addCustomChart( new Metrics.SimplePie("using_spigot", () -> getServerVersion().isSpigot() ? "yes" : "no")); m.addCustomChart(new Metrics.AdvancedPie("expansions_used", () -> { Map<String, Integer> map = new HashMap<>(); Map<String, PlaceholderHook> p = PlaceholderAPI.getPlaceholders(); if (!p.isEmpty()) { for (PlaceholderHook hook : p.values()) { if (hook instanceof PlaceholderExpansion) { PlaceholderExpansion ex = (PlaceholderExpansion) hook; map.put(ex.getRequiredPlugin() == null ? ex.getIdentifier() : ex.getRequiredPlugin(), 1); } } } return map; })); }
((Taskable) expansion).start(); if (plugin.getExpansionCloud() != null) { CloudExpansion ce = plugin.getExpansionCloud().getCloudExpansion(expansion.getIdentifier()); if (ce != null) { ce.setHasExpansion(true);
@EventHandler public void onExpansionUnregister(ExpansionUnregisterEvent event) { if (event.getExpansion() instanceof Listener) { HandlerList.unregisterAll((Listener) event.getExpansion()); } if (event.getExpansion() instanceof Taskable) { ((Taskable) event.getExpansion()).stop(); } if (event.getExpansion() instanceof Cacheable) { ((Cacheable) event.getExpansion()).clear(); } if (plugin.getExpansionCloud() != null) { CloudExpansion ex = plugin.getExpansionCloud() .getCloudExpansion(event.getExpansion().getName()); if (ex != null) { ex.setHasExpansion(false); ex.setShouldUpdate(false); } } }
.equalsIgnoreCase("fetch")) { msg(s, "&aRefresh task started. Use &f/papi ecloud list all &ain a few!!"); plugin.getExpansionCloud().clean(); plugin.getExpansionCloud().fetch(plugin.getPlaceholderAPIConfig().cloudAllowUnverifiedExpansions()); return true; if (plugin.getExpansionCloud().getCloudExpansions().isEmpty()) { msg(s, "&7No cloud expansions are available at this time."); return true; plugin.getExpansionCloud().clean(); msg(s, "&aThe cache has been cleared!!"); return true; msg(s, "&bThere are &f" + plugin.getExpansionCloud().getCloudExpansions().size() + " &bexpansions available on the cloud.", "&7A total of &f" + plugin.getExpansionCloud().getCloudAuthorCount() + " &7authors have contributed to the expansion cloud."); if (plugin.getExpansionCloud().getToUpdateCount() > 0) { msg(s, "&eYou have &f" + plugin.getExpansionCloud().getToUpdateCount() + " &eexpansions installed that have updates available."); CloudExpansion expansion = plugin.getExpansionCloud().getCloudExpansion(args[2]); CloudExpansion expansion = plugin.getExpansionCloud().getCloudExpansion(args[2]); CloudExpansion expansion = plugin.getExpansionCloud().getCloudExpansion(args[2]); ex = plugin.getExpansionCloud().getAllInstalled();
"&fReload the config settings"); if (s.hasPermission("placeholderapi.ecloud")) { if (plugin.getExpansionCloud() == null) { Msg.msg(s, "&b/papi enablecloud", "&fEnable the expansion cloud"); return true; if (plugin.getExpansionCloud() == null) { Msg.msg(s, "&7The expansion cloud is not enabled!"); return true; return true; if (plugin.getExpansionCloud() != null) { Msg.msg(s, "&7The cloud is already enabled!"); return true; return true; if (plugin.getExpansionCloud() == null) { Msg.msg(s, "&7The cloud is already disabled!"); return true;