Archiviert
13
0

Don't run command blocks in empty worlds. Fixes BUKKIT-3094

Dieser Commit ist enthalten in:
Travis Watkins 2012-12-05 13:36:47 -06:00
Ursprung 09684ba9d7
Commit 1af83da760

Datei anzeigen

@ -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