From ddeb2a5c14fbde81b0aa8d790f87c1633feab417 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 20 Aug 2019 15:07:36 -0700 Subject: [PATCH] perhaps fix concurrent modification issues --- src/main/java/baritone/utils/BaritoneAutoTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/baritone/utils/BaritoneAutoTest.java b/src/main/java/baritone/utils/BaritoneAutoTest.java index e6f08e215..e17764243 100644 --- a/src/main/java/baritone/utils/BaritoneAutoTest.java +++ b/src/main/java/baritone/utils/BaritoneAutoTest.java @@ -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 + ""); + } + }); } }