mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
Don't run command blocks in empty worlds. Fixes BUKKIT-3094
This commit is contained in:
parent
09684ba9d7
commit
1af83da760
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue