diff --git a/src/fr/neatmonster/nocheatplus/NoCheatPlus.java b/src/fr/neatmonster/nocheatplus/NoCheatPlus.java index 1e781abf..d9660247 100644 --- a/src/fr/neatmonster/nocheatplus/NoCheatPlus.java +++ b/src/fr/neatmonster/nocheatplus/NoCheatPlus.java @@ -52,8 +52,8 @@ import fr.neatmonster.nocheatplus.permissions.PermissionUtil.CommandProtectionEn import fr.neatmonster.nocheatplus.permissions.Permissions; import fr.neatmonster.nocheatplus.players.DataManager; import fr.neatmonster.nocheatplus.utilities.BlockProperties; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; import fr.neatmonster.nocheatplus.utilities.LagMeasureTask; +import fr.neatmonster.nocheatplus.utilities.LogUtil; import fr.neatmonster.nocheatplus.utilities.TickTask; import fr.neatmonster.nocheatplus.utilities.Updates; @@ -218,7 +218,7 @@ public class NoCheatPlus extends JavaPlugin implements Listener, NoCheatPlusAPI if (listener instanceof IHaveMethodOrder){ // TODO: Might log the order too, might prevent registration ? // TODO: Alternative: queue listeners and register after startup (!) - CheckUtils.logWarning("[NoCheatPlus] Listener demands registration order, but listeners are not managed: " + listener.getClass().getName()); + LogUtil.logWarning("[NoCheatPlus] Listener demands registration order, but listeners are not managed: " + listener.getClass().getName()); } } } @@ -283,9 +283,9 @@ public class NoCheatPlus extends JavaPlugin implements Listener, NoCheatPlusAPI listenerManager.setRegisterDirectly(false); listenerManager.clear(); - // Tell the server administrator the we finished unloading NoCheatPlus. - CheckUtils.logInfo("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled."); - } + // Tell the server administrator the we finished unloading NoCheatPlus. + LogUtil.logInfo("[NoCheatPlus] Version " + pdfFile.getVersion() + " is disabled."); + } /** * Does not undo 100%, but restore old permission, permission-message, label (unlikely to be changed), permission default. @@ -442,10 +442,10 @@ public class NoCheatPlus extends JavaPlugin implements Listener, NoCheatPlusAPI } }); } - - // Tell the server administrator that we finished loading NoCheatPlus now. - CheckUtils.logInfo("[NoCheatPlus] Version " + getDescription().getVersion() + " is enabled."); - } + + // Tell the server administrator that we finished loading NoCheatPlus now. + LogUtil.logInfo("[NoCheatPlus] Version " + getDescription().getVersion() + " is enabled."); + } // public void onPlayerJoinLow(final PlayerJoinEvent event) { // /* diff --git a/src/fr/neatmonster/nocheatplus/actions/ActionFactory.java b/src/fr/neatmonster/nocheatplus/actions/ActionFactory.java index 988c23f4..5e579c3e 100644 --- a/src/fr/neatmonster/nocheatplus/actions/ActionFactory.java +++ b/src/fr/neatmonster/nocheatplus/actions/ActionFactory.java @@ -9,7 +9,7 @@ import fr.neatmonster.nocheatplus.actions.types.CancelAction; import fr.neatmonster.nocheatplus.actions.types.CommandAction; import fr.neatmonster.nocheatplus.actions.types.DummyAction; import fr.neatmonster.nocheatplus.actions.types.LogAction; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /* * MMP"""""""MM dP oo MM""""""""`M dP @@ -98,7 +98,7 @@ public class ActionFactory { } list.setActions(vl, createActions(def.split("\\s+"))); } catch (final Exception e) { - CheckUtils.logWarning("[NoCheatPlus] Couldn't parse action definition 'vl:" + s + "'."); + LogUtil.logWarning("[NoCheatPlus] Couldn't parse action definition 'vl:" + s + "'."); } } @@ -121,7 +121,7 @@ public class ActionFactory { try { actions.add(createAction(def)); } catch (final IllegalArgumentException e) { - CheckUtils.logWarning("[NoCheatPlus] Failed to create action: " + e.getMessage()); + LogUtil.logWarning("[NoCheatPlus] Failed to create action: " + e.getMessage()); actions.add(new DummyAction(def)); } } @@ -152,7 +152,7 @@ public class ActionFactory { delay = Integer.parseInt(parts[1]); repeat = Integer.parseInt(parts[2]); } catch (final Exception e) { - CheckUtils.logWarning("[NoCheatPlus] Couldn't parse details of command '" + definition + LogUtil.logWarning("[NoCheatPlus] Couldn't parse details of command '" + definition + "', will use default values instead."); delay = 0; repeat = 0; @@ -189,7 +189,7 @@ public class ActionFactory { toChat = parts[3].contains("i"); toFile = parts[3].contains("f"); } catch (final Exception e) { - CheckUtils.logWarning("[NoCheatPlus] Couldn't parse details of log action '" + definition + LogUtil.logWarning("[NoCheatPlus] Couldn't parse details of log action '" + definition + "', will use default values instead."); e.printStackTrace(); delay = 0; diff --git a/src/fr/neatmonster/nocheatplus/actions/types/CommandAction.java b/src/fr/neatmonster/nocheatplus/actions/types/CommandAction.java index 90bdcd1c..16a37254 100644 --- a/src/fr/neatmonster/nocheatplus/actions/types/CommandAction.java +++ b/src/fr/neatmonster/nocheatplus/actions/types/CommandAction.java @@ -4,7 +4,7 @@ import org.bukkit.Bukkit; import org.bukkit.command.CommandException; import fr.neatmonster.nocheatplus.checks.ViolationData; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /* * MM'""""'YMM dP @@ -54,7 +54,7 @@ public class CommandAction extends ActionWithParameters { try { Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), command); } catch (final CommandException e) { - CheckUtils.logWarning("[NoCheatPlus] Failed to execute the command '" + command + "': " + e.getMessage() + LogUtil.logWarning("[NoCheatPlus] Failed to execute the command '" + command + "': " + e.getMessage() + ", please check if everything is setup correct."); } catch (final Exception e) { // I don't care in this case, your problem if your command fails. diff --git a/src/fr/neatmonster/nocheatplus/actions/types/LogAction.java b/src/fr/neatmonster/nocheatplus/actions/types/LogAction.java index ae820211..b67b76b0 100644 --- a/src/fr/neatmonster/nocheatplus/actions/types/LogAction.java +++ b/src/fr/neatmonster/nocheatplus/actions/types/LogAction.java @@ -10,6 +10,7 @@ import fr.neatmonster.nocheatplus.config.ConfigFile; import fr.neatmonster.nocheatplus.config.ConfigManager; import fr.neatmonster.nocheatplus.permissions.Permissions; import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /* * M""MMMMMMMM MMP"""""""MM dP oo @@ -77,7 +78,7 @@ public class LogAction extends ActionWithParameters { otherPlayer.sendMessage(ChatColor.RED + "NCP: " + ChatColor.WHITE + CheckUtils.replaceColors(message)); if (toConsole && configurationFile.getBoolean(ConfPaths.LOGGING_CONSOLE)) - CheckUtils.logInfo("[NoCheatPlus] " + CheckUtils.removeColors(message)); + LogUtil.logInfo("[NoCheatPlus] " + CheckUtils.removeColors(message)); if (toFile && configurationFile.getBoolean(ConfPaths.LOGGING_FILE)) CheckUtils.fileLogger.info(CheckUtils.removeColors(message)); } diff --git a/src/fr/neatmonster/nocheatplus/checks/AsyncCheck.java b/src/fr/neatmonster/nocheatplus/checks/AsyncCheck.java index 8de08287..5d81346d 100644 --- a/src/fr/neatmonster/nocheatplus/checks/AsyncCheck.java +++ b/src/fr/neatmonster/nocheatplus/checks/AsyncCheck.java @@ -3,7 +3,7 @@ package fr.neatmonster.nocheatplus.checks; import org.bukkit.entity.Player; import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; public abstract class AsyncCheck extends Check { @@ -17,7 +17,7 @@ public abstract class AsyncCheck extends Check { if (!type.isEnabled(player) || type.hasCachedPermission(player)) return false; } catch (final Exception e) { - CheckUtils.scheduleOutput(e); + LogUtil.scheduleLogSevere(e); } return !NCPExemptionManager.isExempted(player, type); } diff --git a/src/fr/neatmonster/nocheatplus/checks/chat/Text.java b/src/fr/neatmonster/nocheatplus/checks/chat/Text.java index 66cfb39d..f2af9ef9 100644 --- a/src/fr/neatmonster/nocheatplus/checks/chat/Text.java +++ b/src/fr/neatmonster/nocheatplus/checks/chat/Text.java @@ -20,6 +20,7 @@ import fr.neatmonster.nocheatplus.command.INotifyReload; import fr.neatmonster.nocheatplus.config.ConfigFile; import fr.neatmonster.nocheatplus.config.ConfigManager; import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /** * Some alternative more or less advanced analysis methods. @@ -293,7 +294,7 @@ public class Text extends AsyncCheck implements INotifyReload{ debugParts.add("Normal: min=" + CheckUtils.fdec3.format(cc.textFreqNormMin) +", weight=" + CheckUtils.fdec3.format(cc.textFreqNormWeight) + " => accumulated=" + CheckUtils.fdec3.format(accumulated)); debugParts.add("Short-term: min=" + CheckUtils.fdec3.format(cc.textFreqShortTermMin) +", weight=" + CheckUtils.fdec3.format(cc.textFreqShortTermWeight) + " => accumulated=" + CheckUtils.fdec3.format(shortTermAccumulated)); debugParts.add("vl: " + CheckUtils.fdec3.format(data.textVL)); - CheckUtils.scheduleOutputJoined(debugParts, " | "); + LogUtil.scheduleLogInfo(debugParts, " | "); debugParts.clear(); } diff --git a/src/fr/neatmonster/nocheatplus/checks/combined/CombinedConfig.java b/src/fr/neatmonster/nocheatplus/checks/combined/CombinedConfig.java index 5d4229c6..f35bdb32 100644 --- a/src/fr/neatmonster/nocheatplus/checks/combined/CombinedConfig.java +++ b/src/fr/neatmonster/nocheatplus/checks/combined/CombinedConfig.java @@ -20,6 +20,7 @@ import fr.neatmonster.nocheatplus.config.ConfigFile; import fr.neatmonster.nocheatplus.config.ConfigManager; import fr.neatmonster.nocheatplus.permissions.Permissions; import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; public class CombinedConfig extends ACheckConfig { @@ -81,7 +82,7 @@ public class CombinedConfig extends ACheckConfig { } catch (final Exception e){ error = true; - CheckUtils.logWarning("[NoCheatPlus] Bad damage cause (combined.invulnerable.ignore): " + input); + LogUtil.logWarning("[NoCheatPlus] Bad damage cause (combined.invulnerable.ignore): " + input); } } // Read modifiers for causes. @@ -99,11 +100,11 @@ public class CombinedConfig extends ACheckConfig { } catch (final Exception e){ error = true; - CheckUtils.logWarning("[NoCheatPlus] Bad damage cause (combined.invulnerable.modifiers): " + input); + LogUtil.logWarning("[NoCheatPlus] Bad damage cause (combined.invulnerable.modifiers): " + input); } } invulnerableModifierDefault = defaultMod; - if (error) CheckUtils.logInfo("[NoCheatPlus] Damage causes can be: " + CheckUtils.join(Arrays.asList(DamageCause.values()), ", ")); + if (error) LogUtil.logInfo("[NoCheatPlus] Damage causes can be: " + CheckUtils.join(Arrays.asList(DamageCause.values()), ", ")); invulnerableTriggerAlways = config.getBoolean(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_ALWAYS); invulnerableTriggerFallDistance = config.getBoolean(ConfPaths.COMBINED_INVULNERABLE_TRIGGERS_FALLDISTANCE); yawRate = config.getInt(ConfPaths.COMBINED_YAWRATE_RATE); diff --git a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 07a6b0ab..6402878d 100644 --- a/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -46,6 +46,7 @@ import fr.neatmonster.nocheatplus.permissions.Permissions; import fr.neatmonster.nocheatplus.utilities.BlockCache; import fr.neatmonster.nocheatplus.utilities.BlockProperties; import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; import fr.neatmonster.nocheatplus.utilities.PlayerLocation; /* @@ -492,7 +493,7 @@ public class MovingListener implements Listener { if (!restored){ // TODO: correct the location ? NoCheatPlus.denyLogin(player.getName(), 24L * 60L * 60L * 1000L); - CheckUtils.logSevere("[NCP] could not restore location for " + player.getName() + " deny login for 24 hours"); + LogUtil.logSevere("[NCP] could not restore location for " + player.getName() + " deny login for 24 hours"); } // TODO: reset the bounding box of the player ? CheckUtils.onIllegalMove(player); diff --git a/src/fr/neatmonster/nocheatplus/command/actions/BanCommand.java b/src/fr/neatmonster/nocheatplus/command/actions/BanCommand.java index cc227ff5..20201c58 100644 --- a/src/fr/neatmonster/nocheatplus/command/actions/BanCommand.java +++ b/src/fr/neatmonster/nocheatplus/command/actions/BanCommand.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import fr.neatmonster.nocheatplus.NoCheatPlus; import fr.neatmonster.nocheatplus.command.DelayableCommand; import fr.neatmonster.nocheatplus.permissions.Permissions; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; public class BanCommand extends DelayableCommand { @@ -41,7 +41,7 @@ public class BanCommand extends DelayableCommand { player.kickPlayer(reason); OfflinePlayer offlinePlayer = Bukkit.getServer().getOfflinePlayer(name); offlinePlayer.setBanned(true); - CheckUtils.logInfo("[NoCheatPlus] (" + sender.getName() + ") Banned " + offlinePlayer.getName() + " : " + reason); + LogUtil.logInfo("[NoCheatPlus] (" + sender.getName() + ") Banned " + offlinePlayer.getName() + " : " + reason); } } diff --git a/src/fr/neatmonster/nocheatplus/command/actions/KickCommand.java b/src/fr/neatmonster/nocheatplus/command/actions/KickCommand.java index 7e671515..d7d53fc6 100644 --- a/src/fr/neatmonster/nocheatplus/command/actions/KickCommand.java +++ b/src/fr/neatmonster/nocheatplus/command/actions/KickCommand.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Player; import fr.neatmonster.nocheatplus.NoCheatPlus; import fr.neatmonster.nocheatplus.command.DelayableCommand; import fr.neatmonster.nocheatplus.permissions.Permissions; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; public class KickCommand extends DelayableCommand { @@ -38,7 +38,7 @@ public class KickCommand extends DelayableCommand { Player player = Bukkit.getPlayerExact(name); if (player == null) return; player.kickPlayer(reason); - CheckUtils.logInfo("[NoCheatPlus] (" + sender.getName() + ") Kicked " + player.getName() + " : " + reason); + LogUtil.logInfo("[NoCheatPlus] (" + sender.getName() + ") Kicked " + player.getName() + " : " + reason); } } diff --git a/src/fr/neatmonster/nocheatplus/command/actions/TempKickCommand.java b/src/fr/neatmonster/nocheatplus/command/actions/TempKickCommand.java index a840d49f..698566c5 100644 --- a/src/fr/neatmonster/nocheatplus/command/actions/TempKickCommand.java +++ b/src/fr/neatmonster/nocheatplus/command/actions/TempKickCommand.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Player; import fr.neatmonster.nocheatplus.NoCheatPlus; import fr.neatmonster.nocheatplus.command.DelayableCommand; import fr.neatmonster.nocheatplus.permissions.Permissions; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; public class TempKickCommand extends DelayableCommand { @@ -51,6 +51,6 @@ public class TempKickCommand extends DelayableCommand { NoCheatPlus.denyLogin(name, duration); if (player == null) return; player.kickPlayer(reason); - CheckUtils.logInfo("[NoCheatPlus] (" + sender.getName() + ") Kicked " + player.getName() + " for " + duration/60000 +" minutes: " + reason); + LogUtil.logInfo("[NoCheatPlus] (" + sender.getName() + ") Kicked " + player.getName() + " for " + duration/60000 +" minutes: " + reason); } } diff --git a/src/fr/neatmonster/nocheatplus/event/GenericListener.java b/src/fr/neatmonster/nocheatplus/event/GenericListener.java index 0da3d6e7..2e28dc0e 100644 --- a/src/fr/neatmonster/nocheatplus/event/GenericListener.java +++ b/src/fr/neatmonster/nocheatplus/event/GenericListener.java @@ -14,7 +14,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.EventExecutor; import org.bukkit.plugin.Plugin; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /** * listener registered for one event only. Allows to delegate to other registered listeners. @@ -87,7 +87,7 @@ public class GenericListener implements Listener, EventExecutor } @Override - public final void execute(final Listener listener, final Event event){ + public void execute(final Listener listener, final Event event){ if (!clazz.isAssignableFrom(event.getClass())){ // Strange but true. return; @@ -102,15 +102,25 @@ public class GenericListener implements Listener, EventExecutor if (!isCancellable || !entry.ignoreCancelled || !cancellable.isCancelled()) entry.method.invoke(entry.listener, event); } catch (Throwable t) { // IllegalArgumentException IllegalAccessException InvocationTargetException - final EventException e = new EventException(t, "GenericListener<" + clazz.getName() +"> @" + priority +" encountered an exception for " + entry.listener.getClass().getName() + " with method " + entry.method.toGenericString()); - // TODO: log it / more details! - if (event.isAsynchronous()) CheckUtils.scheduleOutput(e); - else CheckUtils.logSevere(e); + onError(entry, event, t); } } } + private void onError(final MethodEntry entry, final Event event, final Throwable t) { + final String descr = "GenericListener<" + clazz.getName() +"> @" + priority +" encountered an exception for " + entry.listener.getClass().getName() + " with method " + entry.method.toGenericString(); + try{ + final EventException e = new EventException(t, descr); + // TODO: log it / more details! + if (event.isAsynchronous()) LogUtil.scheduleLogSevere(e); + else LogUtil.logSevere(e); + } + catch (Throwable t2){ + LogUtil.scheduleLogSevere("Could not log exception: " + descr); + } + } + public void register(Plugin plugin) { if (registered) return; Bukkit.getPluginManager().registerEvent(clazz, this, priority, this, plugin, false); diff --git a/src/fr/neatmonster/nocheatplus/event/ListenerManager.java b/src/fr/neatmonster/nocheatplus/event/ListenerManager.java index b3166bca..ae0d87cd 100644 --- a/src/fr/neatmonster/nocheatplus/event/ListenerManager.java +++ b/src/fr/neatmonster/nocheatplus/event/ListenerManager.java @@ -16,7 +16,7 @@ import org.bukkit.plugin.Plugin; import fr.neatmonster.nocheatplus.components.ComponentWithName; import fr.neatmonster.nocheatplus.event.GenericListener.MethodEntry; import fr.neatmonster.nocheatplus.event.GenericListener.MethodEntry.MethodOrder; -import fr.neatmonster.nocheatplus.utilities.CheckUtils; +import fr.neatmonster.nocheatplus.utilities.LogUtil; /** * This class allows to register event-listeners which will all be called form within one event handler per event+priority combination.
@@ -135,17 +135,17 @@ public class ListenerManager { try{ method.setAccessible(true); } catch (SecurityException e){ - CheckUtils.logWarning("[ListenerManager] Can not set method accessible: " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); + LogUtil.logWarning("[ListenerManager] Can not set method accessible: " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); } } Class[] argTypes = method.getParameterTypes(); if (argTypes.length != 1){ - CheckUtils.logWarning("[ListenerManager] Bad method signature (number of arguments not 1): " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); + LogUtil.logWarning("[ListenerManager] Bad method signature (number of arguments not 1): " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); continue; } Class eventType = argTypes[0]; if (!Event.class.isAssignableFrom(eventType)){ - CheckUtils.logWarning("[ListenerManager] Bad method signature (argument does not extend Event): " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); + LogUtil.logWarning("[ListenerManager] Bad method signature (argument does not extend Event): " + method.toGenericString() +" registered in " + clazz.getName()+ ", ignoring it!"); continue; } Class checkedEventType = eventType.asSubclass(Event.class); diff --git a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java index 13fa19bb..bbbb2618 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java +++ b/src/fr/neatmonster/nocheatplus/utilities/BlockProperties.java @@ -531,8 +531,8 @@ public class BlockProperties { public static void dumpBlocks(boolean all) { List missing = new LinkedList(); if (all) { - CheckUtils.logInfo("[NoCheatPlus] Dump block properties for fastbreak check:"); - CheckUtils.logInfo("--- Present entries -------------------------------"); + LogUtil.logInfo("[NoCheatPlus] Dump block properties for fastbreak check:"); + LogUtil.logInfo("--- Present entries -------------------------------"); } for (int i = 0; i < blocks.length; i++){ String mat; @@ -548,13 +548,13 @@ public class BlockProperties { if (mat.equals("?")) continue; missing.add("* MISSING "+i + "(" + mat +") "); } - else if (all) CheckUtils.logInfo(i + ": (" + mat + ") " + blocks[i].toString()); + else if (all) LogUtil.logInfo(i + ": (" + mat + ") " + blocks[i].toString()); } if (!missing.isEmpty()){ Bukkit.getLogger().warning("[NoCheatPlus] The block breaking data is incomplete, default to allow instant breaking:"); - CheckUtils.logWarning("--- Missing entries -------------------------------"); + LogUtil.logWarning("--- Missing entries -------------------------------"); for (String spec : missing){ - CheckUtils.logWarning(spec); + LogUtil.logWarning(spec); } } } @@ -1016,7 +1016,7 @@ public class BlockProperties { // Ignore passable. for (final String input : config.getStringList(pathPrefix + ConfPaths.SUB_IGNOREPASSABLE)){ final Integer id = ConfigFile.parseTypeId(input); - if (id == null || id < 0 || id >= 4096) CheckUtils.logWarning("[NoCheatplus] Bad block id (" + pathPrefix + ConfPaths.SUB_IGNOREPASSABLE + "): " + input); + if (id == null || id < 0 || id >= 4096) LogUtil.logWarning("[NoCheatplus] Bad block id (" + pathPrefix + ConfPaths.SUB_IGNOREPASSABLE + "): " + input); else blockFlags[id] |= F_IGN_PASSABLE; } } diff --git a/src/fr/neatmonster/nocheatplus/utilities/LagMeasureTask.java b/src/fr/neatmonster/nocheatplus/utilities/LagMeasureTask.java index b08c2902..2de482ca 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/LagMeasureTask.java +++ b/src/fr/neatmonster/nocheatplus/utilities/LagMeasureTask.java @@ -41,7 +41,7 @@ public class LagMeasureTask implements Runnable { try { Bukkit.getServer().getScheduler().cancelTask(instance.lagMeasureTaskId); } catch (final Exception e) { - CheckUtils.logWarning("[NoCheatPlus] Couldn't cancel LagMeasureTask: " + e.getMessage() + "."); + LogUtil.logWarning("[NoCheatPlus] Couldn't cancel LagMeasureTask: " + e.getMessage() + "."); } instance.lagMeasureTaskId = -1; } @@ -98,9 +98,9 @@ public class LagMeasureTask implements Runnable { // Show the debug messages. if (ConfigManager.getConfigFile().getBoolean(ConfPaths.LOGGING_DEBUG)) if (oldStatus != skipCheck && skipCheck) - CheckUtils.logInfo("[NoCheatPlus] Detected server lag, some checks will not work."); + LogUtil.logInfo("[NoCheatPlus] Detected server lag, some checks will not work."); else if (oldStatus != skipCheck && !skipCheck) - CheckUtils.logInfo("[NoCheatPlus] Server lag seems to have stopped, reenabling checks."); + LogUtil.logInfo("[NoCheatPlus] Server lag seems to have stopped, reenabling checks."); final long time = System.currentTimeMillis(); lastInGameSecondDuration = time - lastInGameSecondTime; diff --git a/src/fr/neatmonster/nocheatplus/utilities/Stats.java b/src/fr/neatmonster/nocheatplus/utilities/Stats.java index f475df89..d2f6a827 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/Stats.java +++ b/src/fr/neatmonster/nocheatplus/utilities/Stats.java @@ -81,7 +81,7 @@ public final class Stats { if ( ts > tsStats+periodStats){ tsStats = ts; // print out stats ! - CheckUtils.logInfo(getStatsStr()); + LogUtil.logInfo(getStatsStr()); } } } diff --git a/src/fr/neatmonster/nocheatplus/utilities/TickTask.java b/src/fr/neatmonster/nocheatplus/utilities/TickTask.java index b1f9c5fa..9a3ea273 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/TickTask.java +++ b/src/fr/neatmonster/nocheatplus/utilities/TickTask.java @@ -177,7 +177,7 @@ public class TickTask implements Runnable { if (!delayedActions.isEmpty()) executeActions(); if (!permissionUpdates.isEmpty()) updatePermissions(); if (timeLast > time) { - CheckUtils.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history..."); + LogUtil.logSevere("[NoCheatPlus] System time ran backwards (" + timeLast + "->" + time + "), clear all data and history..."); DataManager.clearData(CheckType.ALL); } timeLast = time;