perhaps fix concurrent modification issues

This commit is contained in:
Leijurv
2019-08-20 15:07:36 -07:00
parent 8973b73bfa
commit ddeb2a5c14

View File

@@ -105,12 +105,14 @@ public class BaritoneAutoTest implements AbstractGameEventListener, Helper {
// to our defined starting position
if (server != null && server.getWorld(DimensionType.OVERWORLD) != null) {
if (mc.player == null) {
server.getWorld(DimensionType.OVERWORLD).setSpawnPoint(STARTING_POSITION);
server.getCommandManager().handleCommand(server.getCommandSource(), "/difficulty peaceful");
int result = server.getCommandManager().handleCommand(server.getCommandSource(), "/gamerule spawnRadius 0");
if (result != 0) {
throw new IllegalStateException(result + "");
}
server.execute(() -> {
server.getWorld(DimensionType.OVERWORLD).setSpawnPoint(STARTING_POSITION);
server.getCommandManager().handleCommand(server.getCommandSource(), "/difficulty peaceful");
int result = server.getCommandManager().handleCommand(server.getCommandSource(), "/gamerule spawnRadius 0");
if (result != 0) {
throw new IllegalStateException(result + "");
}
});
}
}