New setting "logPlayerCommands" (default true) which can be disabled to prevent player commands from being logged.
This commit is contained in:
parent
a999f50966
commit
d7f5ee581e
@ -89,6 +89,7 @@ public class Conf
|
|||||||
public static boolean logLandClaims = true;
|
public static boolean logLandClaims = true;
|
||||||
public static boolean logLandUnclaims = true;
|
public static boolean logLandUnclaims = true;
|
||||||
public static boolean logMoneyTransactions = true;
|
public static boolean logMoneyTransactions = true;
|
||||||
|
public static boolean logPlayerCommands = true;
|
||||||
|
|
||||||
public static boolean homesEnabled = true;
|
public static boolean homesEnabled = true;
|
||||||
public static boolean homesMustBeInClaimedTerritory = true;
|
public static boolean homesMustBeInClaimedTerritory = true;
|
||||||
|
@ -164,6 +164,12 @@ public class P extends MPlugin
|
|||||||
Conf.save();
|
Conf.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean logPlayerCommands()
|
||||||
|
{
|
||||||
|
return Conf.logPlayerCommands;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly)
|
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly)
|
||||||
{
|
{
|
||||||
|
@ -170,6 +170,12 @@ public abstract class MPlugin extends JavaPlugin
|
|||||||
// COMMAND HANDLING
|
// 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)
|
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly)
|
||||||
{
|
{
|
||||||
boolean noSlash = true;
|
boolean noSlash = true;
|
||||||
|
@ -28,7 +28,8 @@ public class MPluginSecretPlayerListener implements Listener
|
|||||||
|
|
||||||
if (p.handleCommand(event.getPlayer(), event.getMessage()))
|
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);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,7 +41,8 @@ public class MPluginSecretPlayerListener implements Listener
|
|||||||
|
|
||||||
if (p.handleCommand(event.getPlayer(), event.getMessage()))
|
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);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user