Revert BlockStateInterface changes because jurv wurv sad

This commit is contained in:
Brady 2018-09-24 18:55:57 -05:00
parent 6ec6ff4596
commit b575f54977
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 7 additions and 7 deletions

View File

@ -31,7 +31,7 @@ import java.nio.file.Path;
*/
public class WorldData implements IWorldData {
private final CachedWorld cache;
public final CachedWorld cache;
private final Waypoints waypoints;
//public final MapData map;
public final Path directory;

View File

@ -18,7 +18,7 @@
package baritone.utils;
import baritone.Baritone;
import baritone.api.cache.ICachedRegion;
import baritone.cache.CachedRegion;
import baritone.cache.WorldData;
import baritone.cache.WorldProvider;
import net.minecraft.block.Block;
@ -36,7 +36,7 @@ import net.minecraft.world.chunk.Chunk;
public class BlockStateInterface implements Helper {
private static Chunk prev = null;
private static ICachedRegion prevCached = null;
private static CachedRegion prevCached = null;
private static IBlockState AIR = Blocks.AIR.getDefaultState();
@ -70,13 +70,13 @@ public class BlockStateInterface implements Helper {
}
// same idea here, skip the Long2ObjectOpenHashMap.get if at all possible
// except here, it's 512x512 tiles instead of 16x16, so even better repetition
ICachedRegion cached = prevCached;
CachedRegion cached = prevCached;
if (cached == null || cached.getX() != x >> 9 || cached.getZ() != z >> 9) {
WorldData world = WorldProvider.INSTANCE.getCurrentWorld();
if (world == null) {
return AIR;
}
ICachedRegion region = world.getCachedWorld().getRegion(x >> 9, z >> 9);
CachedRegion region = world.cache.getRegion(x >> 9, z >> 9);
if (region == null) {
return AIR;
}
@ -100,7 +100,7 @@ public class BlockStateInterface implements Helper {
prev = prevChunk;
return true;
}
ICachedRegion prevRegion = prevCached;
CachedRegion prevRegion = prevCached;
if (prevRegion != null && prevRegion.getX() == x >> 9 && prevRegion.getZ() == z >> 9) {
return prevRegion.isCached(x & 511, z & 511);
}
@ -108,7 +108,7 @@ public class BlockStateInterface implements Helper {
if (world == null) {
return false;
}
prevRegion = world.getCachedWorld().getRegion(x >> 9, z >> 9);
prevRegion = world.cache.getRegion(x >> 9, z >> 9);
if (prevRegion == null) {
return false;
}