summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/command/defaults/SayCommand.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/command/defaults/SayCommand.java b/src/main/java/org/bukkit/command/defaults/SayCommand.java
index 5cfc2374..d9d6a8ac 100644
--- a/src/main/java/org/bukkit/command/defaults/SayCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/SayCommand.java
@@ -3,6 +3,7 @@ package org.bukkit.command.defaults;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
+import org.bukkit.command.ConsoleCommandSender;
public class SayCommand extends VanillaCommand {
public SayCommand() {
@@ -20,8 +21,18 @@ public class SayCommand extends VanillaCommand {
return false;
}
- Bukkit.getLogger().info("[" + sender.getName() + "] " + args[1]);
- Bukkit.broadcastMessage("[Server] " + args[1]);
+ String message = "";
+
+ for (int i = 0; i < args.length; i++) {
+ if (i > 0) message += " ";
+ message += args[i];
+ }
+
+ if (!(sender instanceof ConsoleCommandSender)) {
+ Bukkit.getLogger().info("[" + sender.getName() + "] " + message);
+ }
+
+ Bukkit.broadcastMessage("[Server] " + message);
return true;
}