diff --git a/src/main/java/baritone/bot/chunk/CachedWorld.java b/src/main/java/baritone/bot/chunk/CachedWorld.java index f8b2c216..d5c5c04a 100644 --- a/src/main/java/baritone/bot/chunk/CachedWorld.java +++ b/src/main/java/baritone/bot/chunk/CachedWorld.java @@ -53,7 +53,7 @@ public final class CachedWorld implements ICachedChunkAccess { @Override public final PathingBlockType getBlockType(int x, int y, int z) { - CachedRegion region = getRegion(x >> 9, z >> 9); + CachedRegion region = getOrCreateRegion(x >> 9, z >> 9); if (region != null) { return region.getBlockType(x & 511, y, z & 511); } diff --git a/src/main/java/baritone/bot/chunk/CachedWorldProvider.java b/src/main/java/baritone/bot/chunk/CachedWorldProvider.java index e5ff7509..e6062d6d 100644 --- a/src/main/java/baritone/bot/chunk/CachedWorldProvider.java +++ b/src/main/java/baritone/bot/chunk/CachedWorldProvider.java @@ -31,8 +31,6 @@ import java.nio.file.Path; import java.util.HashMap; import java.util.Map; import java.util.function.Consumer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * @author Brady @@ -42,8 +40,6 @@ public enum CachedWorldProvider implements Helper { INSTANCE; - private static final Pattern REGION_REGEX = Pattern.compile("r\\.(-?[0-9]+)\\.(-?[0-9]+)\\.bcr"); - private final Map singlePlayerWorldCache = new HashMap<>(); private CachedWorld currentWorld; @@ -68,21 +64,6 @@ public enum CachedWorldProvider implements Helper { } this.currentWorld = this.singlePlayerWorldCache.computeIfAbsent(dir.toString(), CachedWorld::new); - - try { - Files.list(dir).forEach(path -> { - String file = path.getFileName().toString(); - Matcher matcher = REGION_REGEX.matcher(file); - if (matcher.matches()) { - int rx = Integer.parseInt(matcher.group(1)); - int ry = Integer.parseInt(matcher.group(2)); - // Recognize the region for when we load from file - this.currentWorld.getOrCreateRegion(rx, ry); - } - }); - } catch (Exception ignored) {} - - this.currentWorld.load(); } // TODO: Store server worlds }