summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorEvilSeph <evilseph@gmail.com>2013-12-20 23:22:39 -0500
committerEvilSeph <evilseph@gmail.com>2013-12-20 23:35:10 -0500
commite85dc5785174534714484149d33bf7ea28b2e238 (patch)
tree3516cd98269100327f071e2e9bf58720bf29cd5b /src/main
parent0136d2b31ee302b31bd4b07dba0a7ef19a972379 (diff)
downloadbukkit-e85dc5785174534714484149d33bf7ea28b2e238.tar
bukkit-e85dc5785174534714484149d33bf7ea28b2e238.tar.gz
bukkit-e85dc5785174534714484149d33bf7ea28b2e238.tar.lz
bukkit-e85dc5785174534714484149d33bf7ea28b2e238.tar.xz
bukkit-e85dc5785174534714484149d33bf7ea28b2e238.zip
Handle commandBlockOutput GameRule for Command Minecarts.
Fixes BUKKIT-5207
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/command/Command.java18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 1c235720..87c33d9c 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -10,6 +10,7 @@ import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.entity.Player;
+import org.bukkit.entity.minecart.CommandMinecart;
import org.bukkit.permissions.Permissible;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.util.StringUtil;
@@ -352,9 +353,20 @@ public abstract class Command {
public static void broadcastCommandMessage(CommandSender source, String message, boolean sendToSource) {
String result = source.getName() + ": " + message;
- if (source instanceof BlockCommandSender && ((BlockCommandSender) source).getBlock().getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) {
- Bukkit.getConsoleSender().sendMessage(result);
- return;
+ if (source instanceof BlockCommandSender) {
+ BlockCommandSender blockCommandSender = (BlockCommandSender) source;
+
+ if (blockCommandSender.getBlock().getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) {
+ Bukkit.getConsoleSender().sendMessage(result);
+ return;
+ }
+ } else if (source instanceof CommandMinecart) {
+ CommandMinecart commandMinecart = (CommandMinecart) source;
+
+ if (commandMinecart.getWorld().getGameRuleValue("commandBlockOutput").equalsIgnoreCase("false")) {
+ Bukkit.getConsoleSender().sendMessage(result);
+ return;
+ }
}
Set<Permissible> users = Bukkit.getPluginManager().getPermissionSubscriptions(Server.BROADCAST_CHANNEL_ADMINISTRATIVE);