From 943b75455b8759f4d7774afa6fb3d0563ba7b051 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 25 Nov 2018 12:13:49 -0800 Subject: [PATCH] no point if you don't copy it, really fixes #210 --- src/main/java/baritone/utils/BlockStateInterface.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/baritone/utils/BlockStateInterface.java b/src/main/java/baritone/utils/BlockStateInterface.java index b6b264d0..96493e00 100644 --- a/src/main/java/baritone/utils/BlockStateInterface.java +++ b/src/main/java/baritone/utils/BlockStateInterface.java @@ -23,6 +23,7 @@ import baritone.cache.CachedRegion; import baritone.cache.WorldData; import baritone.utils.accessor.IChunkProviderClient; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; +import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; @@ -53,7 +54,7 @@ public class BlockStateInterface { public BlockStateInterface(World world, WorldData worldData) { this.worldData = worldData; - this.loadedChunks = ((IChunkProviderClient) world.getChunkProvider()).loadedChunks(); + this.loadedChunks = new Long2ObjectOpenHashMap<>(((IChunkProviderClient) world.getChunkProvider()).loadedChunks()); // make a copy that we can safely access from another thread if (!Minecraft.getMinecraft().isCallingFromMinecraftThread()) { throw new IllegalStateException(); }