@Deprecated public ExecutorService getExecutorService() { if ( service == null ) { String name = ( getDescription() == null ) ? "unknown" : getDescription().getName(); service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( name + " Pool Thread #%1$d" ) .setThreadFactory( new GroupedThreadFactory( this, name ) ).build() ); } return service; } //
/** * Gets the data folder where this plugin may store arbitrary data. It will * be a child of {@link ProxyServer#getPluginsFolder()}. * * @return the data folder of this plugin */ public final File getDataFolder() { return new File( getProxy().getPluginsFolder(), getDescription().getName() ); }
public void enablePlugins() { for ( Plugin plugin : plugins.values() ) { try { plugin.onEnable(); ProxyServer.getInstance().getLogger().log( Level.INFO, "Enabled plugin {0} version {1} by {2}", new Object[] { plugin.getDescription().getName(), plugin.getDescription().getVersion(), plugin.getDescription().getAuthor() } ); } catch ( Throwable t ) { ProxyServer.getInstance().getLogger().log( Level.WARNING, "Exception encountered when loading plugin: " + plugin.getDescription().getName(), t ); } } }
protected PluginLogger(Plugin plugin) { super( plugin.getClass().getCanonicalName(), null ); pluginName = "[" + plugin.getDescription().getName() + "] "; setParent( plugin.getProxy().getLogger() ); }
getLogger().log( Level.SEVERE, "Exception disabling plugin " + plugin.getDescription().getName(), t );
@Deprecated public ExecutorService getExecutorService() { if ( service == null ) { String name = ( getDescription() == null ) ? "unknown" : getDescription().getName(); service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( name + " Pool Thread #%1$d" ) .setThreadFactory( new GroupedThreadFactory( this, name ) ).build() ); } return service; } //
/** * Gets the plugin specific data. * This method is called using Reflection. * * @return The plugin specific data. */ public JsonObject getPluginData() { JsonObject data = new JsonObject(); String pluginName = plugin.getDescription().getName(); String pluginVersion = plugin.getDescription().getVersion(); data.addProperty("pluginName", pluginName); data.addProperty("pluginVersion", pluginVersion); JsonArray customCharts = new JsonArray(); data.add("customCharts", customCharts); return data; }
@Override public JsonObject getDump() { JsonObject platformSpecific = new JsonObject(); List<PluginInfo> plugins = new ArrayList<>(); for (Plugin p : ProxyServer.getInstance().getPluginManager().getPlugins()) plugins.add(new PluginInfo(true, p.getDescription().getName(), p.getDescription().getVersion(), p.getDescription().getMain(), Arrays.asList(p.getDescription().getAuthor()))); platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins)); platformSpecific.add("servers", GsonUtil.getGson().toJsonTree(ProtocolDetectorService.getDetectedIds())); return platformSpecific; }
/** * Gets the plugin specific data. * This method is called using Reflection. * * @return The plugin specific data. */ public JsonObject getPluginData() { JsonObject data = new JsonObject(); String pluginName = plugin.getDescription().getName(); String pluginVersion = plugin.getDescription().getVersion(); data.addProperty("pluginName", pluginName); data.addProperty("pluginVersion", pluginVersion); JsonArray customCharts = new JsonArray(); for (CustomChart customChart : charts) { // Add the data of the custom charts JsonObject chart = customChart.getRequestJsonObject(plugin.getLogger(), logFailedRequests); if (chart == null) { // If the chart is null, we skip it continue; } customCharts.add(chart); } data.add("customCharts", customCharts); return data; }
@Override public String getVersion() { return ((Plugin) getPlugin()).getDescription().getVersion(); }
/** * Gets the data folder where this plugin may store arbitrary data. It will * be a child of {@link ProxyServer#getPluginsFolder()}. * * @return the data folder of this plugin */ public final File getDataFolder() { return new File( getProxy().getPluginsFolder(), getDescription().getName() ); }
@Override public void loadLanguages() { super.loadLanguages(); String pluginName = "acf-" + manager.plugin.getDescription().getName(); addMessageBundles("acf-minecraft", pluginName, pluginName.toLowerCase()); } }
public void enablePlugins() { for ( Plugin plugin : plugins.values() ) { try { plugin.onEnable(); ProxyServer.getInstance().getLogger().log( Level.INFO, "Enabled plugin {0} version {1} by {2}", new Object[] { plugin.getDescription().getName(), plugin.getDescription().getVersion(), plugin.getDescription().getAuthor() } ); } catch ( Throwable t ) { ProxyServer.getInstance().getLogger().log( Level.WARNING, "Exception encountered when loading plugin: " + plugin.getDescription().getName(), t ); } } }
protected PluginLogger(Plugin plugin) { super( plugin.getClass().getCanonicalName(), null ); pluginName = "[" + plugin.getDescription().getName() + "] "; setParent( plugin.getProxy().getLogger() ); }
output.writeInt(BridgeProtocolConstants.VERSION); output.writeInt(BridgeProtocolConstants.VERSION); output.writeUTF(plugin.getPlugin().getDescription().getVersion());
URL url = new URL( "http://updates.codecrafter47.dyndns.eu/" + plugin. getDescription().getName() + "/version.txt"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.connect(); String runningVersion = plugin.getDescription().getVersion(); updateAvailable = compareVersions(newVersion, runningVersion);
PluginDescription description = plugin.getDescription(); String pluginName = description.getName(); boolean onlineMode = ProxyServer.getInstance().getConfigurationAdapter().getBoolean("online_mode", true); // TRUE if online mode is enabled
@EventHandler public void onDevJoin(PostLoginEvent e) { if (plugin.getPlugin().getDescription().getAuthor().equalsIgnoreCase(e.getPlayer(). getName())) { e.getPlayer().sendMessage(ChatColor.LIGHT_PURPLE + "Hello " + e. getPlayer().getName() + ", this server uses " + plugin.getPlugin(). getDescription().getName() + ", one of you incredible good plugins"); } }
getLogger().log( Level.SEVERE, "Exception disabling plugin " + plugin.getDescription().getName(), t );
private void commandStatus(CommandSender sender) { String version = BungeeTabListPlus.getInstance().getPlugin().getDescription().getVersion(); sender.sendMessage(ChatUtil.parseBBCode("&eYou are running BungeeTabListPlus version " + version));