From b7cc707737fa12998e7b3fb96844c300628b48f0 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Sun, 16 Sep 2018 17:58:35 -0700 Subject: [PATCH] misc cleanup 4 --- src/main/java/baritone/Settings.java | 2 +- src/main/java/baritone/cache/CachedRegion.java | 2 +- src/main/java/baritone/pathing/calc/AStarPathFinder.java | 2 +- .../java/baritone/pathing/calc/openset/LinkedListOpenSet.java | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/baritone/Settings.java b/src/main/java/baritone/Settings.java index 48dd17d8..d9c2ff40 100644 --- a/src/main/java/baritone/Settings.java +++ b/src/main/java/baritone/Settings.java @@ -414,7 +414,7 @@ public class Settings { } } } catch (IllegalAccessException e) { - throw new RuntimeException(e); + throw new IllegalStateException(e); } byLowerName = Collections.unmodifiableMap(tmpByName); allSettings = Collections.unmodifiableList(tmpAll); diff --git a/src/main/java/baritone/cache/CachedRegion.java b/src/main/java/baritone/cache/CachedRegion.java index 1e5e8ea5..1805f5ea 100644 --- a/src/main/java/baritone/cache/CachedRegion.java +++ b/src/main/java/baritone/cache/CachedRegion.java @@ -100,7 +100,7 @@ public final class CachedRegion implements IBlockTypeAccess { return res; } - final synchronized void updateCachedChunk(int chunkX, int chunkZ, CachedChunk chunk) { + public final synchronized void updateCachedChunk(int chunkX, int chunkZ, CachedChunk chunk) { this.chunks[chunkX][chunkZ] = chunk; hasUnsavedChanges = true; } diff --git a/src/main/java/baritone/pathing/calc/AStarPathFinder.java b/src/main/java/baritone/pathing/calc/AStarPathFinder.java index ddf61b7a..8868e1fe 100644 --- a/src/main/java/baritone/pathing/calc/AStarPathFinder.java +++ b/src/main/java/baritone/pathing/calc/AStarPathFinder.java @@ -116,7 +116,7 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { int chunkZ = currentNodePos.z >> 4; if (dest.x >> 4 != chunkX || dest.z >> 4 != chunkZ) { // only need to check if the destination is a loaded chunk if it's in a different chunk than the start of the movement - if (chunkProvider.getLoadedChunk(chunkX, chunkZ) == null) { + if (chunkProvider.isChunkGeneratedAt(chunkX, chunkZ)) { // see issue #106 if (cachedWorld == null || !cachedWorld.isCached(dest)) { numEmptyChunk++; diff --git a/src/main/java/baritone/pathing/calc/openset/LinkedListOpenSet.java b/src/main/java/baritone/pathing/calc/openset/LinkedListOpenSet.java index 8ff5a674..e06a9850 100644 --- a/src/main/java/baritone/pathing/calc/openset/LinkedListOpenSet.java +++ b/src/main/java/baritone/pathing/calc/openset/LinkedListOpenSet.java @@ -83,7 +83,7 @@ class LinkedListOpenSet implements IOpenSet { } public static class Node { //wrapper with next - Node nextOpen; - PathNode val; + private Node nextOpen; + private PathNode val; } }