dont construct one unlesss we need to
This commit is contained in:
parent
826f3788d0
commit
0d15225b1d
16
src/main/java/baritone/cache/CachedChunk.java
vendored
16
src/main/java/baritone/cache/CachedChunk.java
vendored
@ -143,9 +143,13 @@ public final class CachedChunk {
|
|||||||
this.heightMap = new int[256];
|
this.heightMap = new int[256];
|
||||||
this.specialBlockLocations = specialBlockLocations;
|
this.specialBlockLocations = specialBlockLocations;
|
||||||
this.cacheTimestamp = cacheTimestamp;
|
this.cacheTimestamp = cacheTimestamp;
|
||||||
this.special = new Int2ObjectOpenHashMap<>();
|
if (specialBlockLocations.isEmpty()) {
|
||||||
|
this.special = null;
|
||||||
|
} else {
|
||||||
|
this.special = new Int2ObjectOpenHashMap<>();
|
||||||
|
setSpecial();
|
||||||
|
}
|
||||||
calculateHeightMap();
|
calculateHeightMap();
|
||||||
setSpecial();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final void setSpecial() {
|
private final void setSpecial() {
|
||||||
@ -170,9 +174,11 @@ public final class CachedChunk {
|
|||||||
}*/
|
}*/
|
||||||
return overview[internalPos];
|
return overview[internalPos];
|
||||||
}
|
}
|
||||||
String str = special.get(index);
|
if (special != null) {
|
||||||
if (str != null) {
|
String str = special.get(index);
|
||||||
return ChunkPacker.stringToBlock(str).getDefaultState();
|
if (str != null) {
|
||||||
|
return ChunkPacker.stringToBlock(str).getDefaultState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == PathingBlockType.SOLID && y == 127 && dimension == -1) {
|
if (type == PathingBlockType.SOLID && y == 127 && dimension == -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user