New setting "logPlayerCommands" (default true) which can be disabled to prevent player commands from being logged.
This commit is contained in:
parent
1ca93948a3
commit
a5bb25eb44
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -28,6 +28,7 @@ public class MPluginSecretPlayerListener implements Listener
|
||||
|
||||
if (p.handleCommand(event.getPlayer(), event.getMessage()))
|
||||
{
|
||||
if (p.logPlayerCommands())
|
||||
Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -40,6 +41,7 @@ public class MPluginSecretPlayerListener implements Listener
|
||||
|
||||
if (p.handleCommand(event.getPlayer(), event.getMessage()))
|
||||
{
|
||||
if (p.logPlayerCommands())
|
||||
Bukkit.getLogger().info("[PLAYER_COMMAND] "+event.getPlayer().getName()+": "+event.getMessage());
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user