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 { public class WorldData implements IWorldData {
private final CachedWorld cache; public final CachedWorld cache;
private final Waypoints waypoints; private final Waypoints waypoints;
//public final MapData map; //public final MapData map;
public final Path directory; public final Path directory;

View File

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