PaperSpigot-Parent/CraftBukkit-Patches/0038-Allow-Disabling-of-Command-Logging.patch

43 lines
1.7 KiB
Diff

From 3a11fb5f840dedcf08ea38c90debb9db7f737ad8 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Fri, 21 Jun 2013 18:01:29 +1000
Subject: [PATCH] Allow Disabling of Command Logging
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index cf5fb7e..8e80ab5 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -923,7 +923,12 @@ public class PlayerConnection implements PacketPlayInListener {
}
try {
- this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit
+ // Spigot Start
+ if ( org.spigotmc.SpigotConfig.logCommands )
+ {
+ this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage()); // CraftBukkit
+ }
+ // Spigot end
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
org.bukkit.craftbukkit.SpigotTimings.playerCommandTimer.stopTiming(); // Spigot
return;
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 6a37636..837fcc9 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -136,4 +136,10 @@ public class SpigotConfig
{
commands.put( "tps", new TicksPerSecondCommand( "tps" ) );
}
+
+ public static boolean logCommands;
+ private static void logCommands()
+ {
+ logCommands = getBoolean( "commands.log", true );
+ }
}
--
1.8.3.2