ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] plugin.getName(), plugin.getVersion(), plugin.getAuthor() } ); } catch ( Throwable t )
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 ); } } }
@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; }
ProxyServer.getInstance().getLogger().log( Level.INFO, "Loaded plugin {0} version {1} by {2}", new Object[] plugin.getName(), plugin.getVersion(), plugin.getAuthor() } ); } catch ( Throwable t )
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 ); } } }
@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"); } }