sending command trees are deferred to the end of the tick.

This commit is contained in:
gnembon committed 2019-09-14 20:08:49 -03:00
1 parent 256d54fab7
commit 7e2a001be5
2 files changed
+5 -1

No files matched your search

@@ -11,6 +11,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.ServerTask;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.BaseText;
@@ -168,10 +169,13 @@ public class SettingsManager
{
return;
}
server.method_18858(new ServerTask(this.server.getTicks(), () ->
{
for (ServerPlayerEntity entityplayermp : server.getPlayerManager().getPlayerList())
{
server.getCommandManager().sendCommandTree(entityplayermp);
}
}));
}
private void loadConfigurationFromConf()
@@ -109,7 +109,7 @@ public class SpawnReporter
int rounds = spawn_tries.get(enumcreaturetype);
lst.add(Messenger.c(String.format("w %s: ", enumcreaturetype.getName()),
(cur < 0) ? "g -" : (color + " " + cur), "g / ", mobColor + " " + max,
(rounds == 1) ? "w " : String.format("fi (%d rounds/tick)", spawn_tries.get(enumcreaturetype))
(rounds == 1) ? "w " : String.format("gi (%d rounds/tick)", spawn_tries.get(enumcreaturetype))
));
}
else