summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorTravis Watkins <amaranth@ubuntu.com>2012-12-05 13:36:47 -0600
committerTravis Watkins <amaranth@ubuntu.com>2012-12-05 13:37:13 -0600
commit1af83da7605ee0897c8235caa0f402449e7cd6a5 (patch)
tree9a2fc3886e57476786524b8cf556fdba7b7aba87 /src/main/java
parent09684ba9d758460806fa1e930410dc9079094a4d (diff)
downloadcraftbukkit-1af83da7605ee0897c8235caa0f402449e7cd6a5.tar
craftbukkit-1af83da7605ee0897c8235caa0f402449e7cd6a5.tar.gz
craftbukkit-1af83da7605ee0897c8235caa0f402449e7cd6a5.tar.lz
craftbukkit-1af83da7605ee0897c8235caa0f402449e7cd6a5.tar.xz
craftbukkit-1af83da7605ee0897c8235caa0f402449e7cd6a5.zip
Don't run command blocks in empty worlds. Fixes BUKKIT-3094
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/TileEntityCommand.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/TileEntityCommand.java b/src/main/java/net/minecraft/server/TileEntityCommand.java
index 82b189bc..357c5836 100644
--- a/src/main/java/net/minecraft/server/TileEntityCommand.java
+++ b/src/main/java/net/minecraft/server/TileEntityCommand.java
@@ -25,7 +25,7 @@ public class TileEntityCommand extends TileEntity implements ICommandListener {
MinecraftServer minecraftserver = MinecraftServer.getServer();
if (minecraftserver != null && minecraftserver.getEnableCommandBlock()) {
- // CraftBukkit start - handle command block as console TODO: add new CommandSender for this
+ // CraftBukkit start - handle command block as console
org.bukkit.command.SimpleCommandMap commandMap = minecraftserver.server.getCommandMap();
Joiner joiner = Joiner.on(" ");
String command = this.a;
@@ -47,6 +47,11 @@ public class TileEntityCommand extends TileEntity implements ICommandListener {
return;
}
+ // if the world has no players don't run
+ if (this.world.players.isEmpty()) {
+ return;
+ }
+
commands.add(args);
// find positions of command block syntax, if any