3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-22 14:28:09 +01:00

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(); MinecraftServer minecraftserver = MinecraftServer.getServer();
if (minecraftserver != null && minecraftserver.getEnableCommandBlock()) { 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(); org.bukkit.command.SimpleCommandMap commandMap = minecraftserver.server.getCommandMap();
Joiner joiner = Joiner.on(" "); Joiner joiner = Joiner.on(" ");
String command = this.a; String command = this.a;
@ -47,6 +47,11 @@ public class TileEntityCommand extends TileEntity implements ICommandListener {
return; return;
} }
// if the world has no players don't run
if (this.world.players.isEmpty()) {
return;
}
commands.add(args); commands.add(args);
// find positions of command block syntax, if any // find positions of command block syntax, if any