private void updateConfiguration() { if (config != null && config.getModificationCount() != configExpectedMod) { configExpectedMod = config.getModificationCount(); // Update the debug flag protocolManager.setDebug(config.isDebug()); } }
public Statistics(ProtocolLib plugin) throws IOException { metrics = new Metrics(plugin); metrics.logFailedRequests(plugin.getProtocolConfig().isDebug()); // Determine who is using this library addPluginUserGraph(metrics); }
@Override public void run() { if (command) { sender.sendMessage(ChatColor.YELLOW + "[ProtocolLib] " + updater.getResult()); String remoteVersion = updater.getRemoteVersion(); if (remoteVersion != null) { sender.sendMessage(ChatColor.YELLOW + "Remote version: " + remoteVersion); sender.sendMessage(ChatColor.YELLOW + "Current version: " + plugin.getDescription().getVersion()); } } else if (updater.shouldNotify() || config.isDebug()) { sender.sendMessage(ChatColor.YELLOW + "[ProtocolLib] " + updater.getResult()); } updater.removeListener(this); updateFinished(); } };
@Override public void run() { try { String version = getSpigotVersion(); remoteVersion = version; if (versionCheck(version)) { result = UpdateResult.SPIGOT_UPDATE_AVAILABLE; } else { result = UpdateResult.NO_UPDATE; } } catch (Throwable ex) { if (ProtocolLibrary.getConfig().isDebug()) { ProtocolLibrary.getErrorReporter().reportDetailed( SpigotUpdater.this, Report.newBuilder(REPORT_CANNOT_UPDATE_PLUGIN).error(ex).callerParam(this)); } else { // People don't care // plugin.getLogger().log(Level.WARNING, "Failed to check for updates: " + ex); } ProtocolLibrary.disableUpdates(); } finally { // Invoke the listeners on the main thread for (Runnable listener : listeners) { plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, listener); } } } }
checkScriptStatus(); if (!config.isDebug()) { sender.sendMessage(ChatColor.RED + "Debug mode must be enabled in the configuration first!"); return true;
if (config.isDebug()) { logger.warning("Debug mode is enabled!");