no point if you don't copy it, really fixes #210
This commit is contained in:
parent
2b56d68f7d
commit
943b75455b
@ -23,6 +23,7 @@ import baritone.cache.CachedRegion;
|
|||||||
import baritone.cache.WorldData;
|
import baritone.cache.WorldData;
|
||||||
import baritone.utils.accessor.IChunkProviderClient;
|
import baritone.utils.accessor.IChunkProviderClient;
|
||||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||||
|
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
@ -53,7 +54,7 @@ public class BlockStateInterface {
|
|||||||
|
|
||||||
public BlockStateInterface(World world, WorldData worldData) {
|
public BlockStateInterface(World world, WorldData worldData) {
|
||||||
this.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()) {
|
if (!Minecraft.getMinecraft().isCallingFromMinecraftThread()) {
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user