diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index 07c3d311..9ed968c6 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -100,6 +100,7 @@ public class Conf public static boolean logLandClaims = true; public static boolean logLandUnclaims = true; public static boolean logMoneyTransactions = true; + public static boolean logPlayerCommands = true; public static boolean homesEnabled = true; public static boolean homesMustBeInClaimedTerritory = true; diff --git a/src/com/massivecraft/factions/P.java b/src/com/massivecraft/factions/P.java index d0926510..b68554ec 100644 --- a/src/com/massivecraft/factions/P.java +++ b/src/com/massivecraft/factions/P.java @@ -172,6 +172,12 @@ public class P extends MPlugin Conf.save(); } + @Override + public boolean logPlayerCommands() + { + return Conf.logPlayerCommands; + } + @Override public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly) { diff --git a/src/com/massivecraft/factions/zcore/MPlugin.java b/src/com/massivecraft/factions/zcore/MPlugin.java index b16c42c7..77faa3f5 100644 --- a/src/com/massivecraft/factions/zcore/MPlugin.java +++ b/src/com/massivecraft/factions/zcore/MPlugin.java @@ -167,6 +167,12 @@ public abstract class MPlugin extends JavaPlugin // COMMAND HANDLING // -------------------------------------------- // + // can be overridden by P method, to provide option + public boolean logPlayerCommands() + { + return true; + } + public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly) { boolean noSlash = true; diff --git a/src/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java b/src/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java index 1fab4ccd..d60f4b9a 100644 --- a/src/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java +++ b/src/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java @@ -28,7 +28,8 @@ public class MPluginSecretPlayerListener implements Listener if (p.handleCommand(event.getPlayer(), event.getMessage())) { - Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage()); + if (p.logPlayerCommands()) + Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage()); event.setCancelled(true); } } @@ -40,7 +41,8 @@ public class MPluginSecretPlayerListener implements Listener if (p.handleCommand(event.getPlayer(), event.getMessage())) { - Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage()); + if (p.logPlayerCommands()) + Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage()); event.setCancelled(true); } }