From 6c5f438099f78c6fbad1a5f1e29d86f8b656bbd6 Mon Sep 17 00:00:00 2001 From: draycia Date: Wed, 29 Apr 2020 01:06:53 -0700 Subject: [PATCH 1/2] Use logger instead of sysout --- src/main/java/com/gmail/nossr50/config/AdvancedConfig.java | 2 +- .../com/gmail/nossr50/listeners/InteractionManager.java | 2 +- src/main/java/com/gmail/nossr50/mcMMO.java | 2 +- .../com/gmail/nossr50/worldguard/WorldGuardManager.java | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java index dccd1a4c8..296d95cff 100644 --- a/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java +++ b/src/main/java/com/gmail/nossr50/config/AdvancedConfig.java @@ -796,7 +796,7 @@ public class AdvancedConfig extends AutoUpdateConfigLoader { } //Invalid Color - System.out.println("[mcMMO] " + configColor + " is an invalid color value"); + mcMMO.p.getLogger().warning(configColor + " is an invalid color value"); return ChatColor.WHITE; } diff --git a/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java b/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java index 43705073a..0a25c37b3 100644 --- a/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java +++ b/src/main/java/com/gmail/nossr50/listeners/InteractionManager.java @@ -54,7 +54,7 @@ public class InteractionManager { if(subSkillNameMap.get(lowerCaseName) == null) subSkillNameMap.put(lowerCaseName, abstractSubSkill); - System.out.println("[mcMMO] registered subskill: "+ abstractSubSkill.getConfigKeyName()); + mcMMO.p.getLogger().info("Registered subskill: "+ abstractSubSkill.getConfigKeyName()); } /** diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 74a7b7aa7..706c9e7ee 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -560,7 +560,7 @@ public class mcMMO extends JavaPlugin { if(CoreSkillsConfig.getInstance().isPrimarySkillEnabled(PrimarySkillType.ACROBATICS)) { - System.out.println("[mcMMO]" + " enabling Acrobatics Skills"); + getLogger().info("Enabling Acrobatics Skills"); //TODO: Should do this differently Roll roll = new Roll(); diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index cf4d83d15..30c59f89f 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.worldguard; +import com.gmail.nossr50.mcMMO; import com.sk89q.worldedit.bukkit.BukkitAdapter; import com.sk89q.worldedit.bukkit.BukkitPlayer; import com.sk89q.worldguard.WorldGuard; @@ -93,17 +94,17 @@ public class WorldGuardManager { registry.register(WorldGuardFlags.MCMMO_ENABLE_WG_FLAG); registry.register(WorldGuardFlags.MCMMO_XP_WG_FLAG); registry.register(WorldGuardFlags.MCMMO_HARDCORE_WG_FLAG); - System.out.println("mcMMO has registered WG flags successfully!"); + mcMMO.p.getLogger().info("Registered WG flags successfully!"); } catch (FlagConflictException e) { e.printStackTrace(); - System.out.println("mcMMO has failed to register WG flags!"); + mcMMO.p.getLogger().warning("Failed to register WG flags!"); // some other plugin registered a flag by the same name already. // you may want to re-register with a different name, but this // could cause issues with saved flags in region files. it's better // to print a message to let the server admin know of the conflict } } catch (NoClassDefFoundError e) { - System.out.println("[mcMMO] Could not register WG Flags!"); //Don't use the Logger here + mcMMO.p.getLogger().warning("Could not register WG Flags!"); //Don't use the Logger here } } From 25389429aec4e19cba56e96d99d41c6d3111acbf Mon Sep 17 00:00:00 2001 From: draycia Date: Wed, 29 Apr 2020 01:10:55 -0700 Subject: [PATCH 2/2] Don't use the Logger here --- .../java/com/gmail/nossr50/worldguard/WorldGuardManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java index 30c59f89f..51ccc8605 100644 --- a/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java +++ b/src/main/java/com/gmail/nossr50/worldguard/WorldGuardManager.java @@ -104,7 +104,7 @@ public class WorldGuardManager { // to print a message to let the server admin know of the conflict } } catch (NoClassDefFoundError e) { - mcMMO.p.getLogger().warning("Could not register WG Flags!"); //Don't use the Logger here + System.out.println("[mcMMO] Could not register WG Flags!"); //Don't use the Logger here } }