mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-11 22:29:46 +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) {
|
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) {
|
} else if (user == null) {
|
||||||
Bukkit.getLogger().log(Level.INFO, "{0} issued server command: /{1} {2}", new Object[]{cSender.getName(), commandLabel, EssentialsCommand.getFinalArg(args, 0)});
|
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 isWaterSafe();
|
||||||
|
|
||||||
boolean isSafeUsermap();
|
boolean isSafeUsermap();
|
||||||
|
|
||||||
|
boolean logCommandBlockCommands();
|
||||||
}
|
}
|
||||||
|
@ -554,6 +554,7 @@ public class Settings implements net.ess3.api.ISettings {
|
|||||||
allowOldIdSigns = _allowOldIdSigns();
|
allowOldIdSigns = _allowOldIdSigns();
|
||||||
isWaterSafe = _isWaterSafe();
|
isWaterSafe = _isWaterSafe();
|
||||||
isSafeUsermap = _isSafeUsermap();
|
isSafeUsermap = _isSafeUsermap();
|
||||||
|
logCommandBlockCommands = _logCommandBlockCommands();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _lateLoadItemSpawnBlacklist() {
|
void _lateLoadItemSpawnBlacklist() {
|
||||||
@ -1576,4 +1577,15 @@ public class Settings implements net.ess3.api.ISettings {
|
|||||||
public boolean isSafeUsermap() {
|
public boolean isSafeUsermap() {
|
||||||
return 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.
|
# You should only change this to false if you use Minecraft China.
|
||||||
safe-usermap-names: true
|
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 | #
|
# | EssentialsHome | #
|
||||||
|
Loading…
Reference in New Issue
Block a user