1
0
mirror of https://github.com/cabaletta/baritone synced 2024-12-24 07:52:54 +00:00

gotta go fast

This commit is contained in:
Leijurv 2019-01-10 18:55:55 -08:00
parent 1ad6a0d5b5
commit 5f29bb3e7f
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A

View File

@ -46,6 +46,8 @@ public class BlockStateInterface {
private Chunk prev = null;
private CachedRegion prevCached = null;
private final boolean useTheRealWorld;
private static final IBlockState AIR = Blocks.AIR.getDefaultState();
public BlockStateInterface(IPlayerContext ctx) {
@ -64,6 +66,7 @@ public class BlockStateInterface {
} else {
this.loadedChunks = worldLoaded; // this will only be used on the main thread
}
this.useTheRealWorld = !Baritone.settings().pathThroughCachedOnly.get();
if (!Minecraft.getMinecraft().isCallingFromMinecraftThread()) {
throw new IllegalStateException();
}
@ -94,7 +97,7 @@ public class BlockStateInterface {
return AIR;
}
if (!Baritone.settings().pathThroughCachedOnly.get()) {
if (useTheRealWorld) {
Chunk cached = prev;
// there's great cache locality in block state lookups
// generally it's within each movement