dont construct one unlesss we need to
This commit is contained in:
parent
826f3788d0
commit
0d15225b1d
@ -143,10 +143,14 @@ 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;
|
||||||
|
if (specialBlockLocations.isEmpty()) {
|
||||||
|
this.special = null;
|
||||||
|
} else {
|
||||||
this.special = new Int2ObjectOpenHashMap<>();
|
this.special = new Int2ObjectOpenHashMap<>();
|
||||||
calculateHeightMap();
|
|
||||||
setSpecial();
|
setSpecial();
|
||||||
}
|
}
|
||||||
|
calculateHeightMap();
|
||||||
|
}
|
||||||
|
|
||||||
private final void setSpecial() {
|
private final void setSpecial() {
|
||||||
for (Map.Entry<String, List<BlockPos>> entry : specialBlockLocations.entrySet()) {
|
for (Map.Entry<String, List<BlockPos>> entry : specialBlockLocations.entrySet()) {
|
||||||
@ -170,10 +174,12 @@ public final class CachedChunk {
|
|||||||
}*/
|
}*/
|
||||||
return overview[internalPos];
|
return overview[internalPos];
|
||||||
}
|
}
|
||||||
|
if (special != null) {
|
||||||
String str = special.get(index);
|
String str = special.get(index);
|
||||||
if (str != null) {
|
if (str != null) {
|
||||||
return ChunkPacker.stringToBlock(str).getDefaultState();
|
return ChunkPacker.stringToBlock(str).getDefaultState();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (type == PathingBlockType.SOLID && y == 127 && dimension == -1) {
|
if (type == PathingBlockType.SOLID && y == 127 && dimension == -1) {
|
||||||
return Blocks.BEDROCK.getDefaultState();
|
return Blocks.BEDROCK.getDefaultState();
|
||||||
|
Loading…
Reference in New Issue
Block a user