mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 09:08:01 +01:00
Implement toggle for command block logging (#2599)
Just a simple config toggle for whether or not command block commands should be logged. closes #1153, closes #162 --- * Add toggle for command block logs * update setting name
This commit is contained in:
parent
ff9f712d65
commit
95f2852cf3
@ -487,7 +487,9 @@ public class Essentials extends JavaPlugin implements net.ess3.api.IEssentials {
|
||||
}
|
||||
|
||||
if (bSenderBlock != null) {
|
||||
Bukkit.getLogger().log(Level.INFO, "CommandBlock at {0},{1},{2} issued server command: /{3} {4}", new Object[]{bSenderBlock.getX(), bSenderBlock.getY(), bSenderBlock.getZ(), commandLabel, EssentialsCommand.getFinalArg(args, 0)});
|
||||
if (getSettings().logCommandBlockCommands()) {
|
||||
Bukkit.getLogger().log(Level.INFO, "CommandBlock at {0},{1},{2} issued server command: /{3} {4}", new Object[]{bSenderBlock.getX(), bSenderBlock.getY(), bSenderBlock.getZ(), commandLabel, EssentialsCommand.getFinalArg(args, 0)});
|
||||
}
|
||||
} else if (user == null) {
|
||||
Bukkit.getLogger().log(Level.INFO, "{0} issued server command: /{1} {2}", new Object[]{cSender.getName(), commandLabel, EssentialsCommand.getFinalArg(args, 0)});
|
||||
}
|
||||
|
@ -330,4 +330,6 @@ public interface ISettings extends IConf {
|
||||
boolean isWaterSafe();
|
||||
|
||||
boolean isSafeUsermap();
|
||||
|
||||
boolean logCommandBlockCommands();
|
||||
}
|
||||
|
@ -554,6 +554,7 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
allowOldIdSigns = _allowOldIdSigns();
|
||||
isWaterSafe = _isWaterSafe();
|
||||
isSafeUsermap = _isSafeUsermap();
|
||||
logCommandBlockCommands = _logCommandBlockCommands();
|
||||
}
|
||||
|
||||
void _lateLoadItemSpawnBlacklist() {
|
||||
@ -1576,4 +1577,15 @@ public class Settings implements net.ess3.api.ISettings {
|
||||
public boolean isSafeUsermap() {
|
||||
return isSafeUsermap;
|
||||
}
|
||||
|
||||
private boolean logCommandBlockCommands;
|
||||
|
||||
private boolean _logCommandBlockCommands() {
|
||||
return config.getBoolean("log-command-block-commands", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean logCommandBlockCommands() {
|
||||
return logCommandBlockCommands;
|
||||
}
|
||||
}
|
||||
|
@ -568,6 +568,10 @@ is-water-safe: false
|
||||
# You should only change this to false if you use Minecraft China.
|
||||
safe-usermap-names: true
|
||||
|
||||
# Should Essentials output logs when a command block executes a command?
|
||||
# Example: CommandBlock at <x>,<y>,<z> issued server command: /<command>
|
||||
log-command-block-commands: true
|
||||
|
||||
############################################################
|
||||
# +------------------------------------------------------+ #
|
||||
# | EssentialsHome | #
|
||||
|
Loading…
Reference in New Issue
Block a user