MCPcopy Create free account
hub / github.com/cabaletta/baritone / CachedChunk

Method CachedChunk

src/main/java/baritone/cache/CachedChunk.java:157–177  ·  view source on GitHub ↗
(int x, int z, int height, BitSet data, BlockState[] overview, Map<String, List<BlockPos>> specialBlockLocations, long cacheTimestamp)

Source from the content-addressed store, hash-verified

155 public final long cacheTimestamp;
156
157 CachedChunk(int x, int z, int height, BitSet data, BlockState[] overview, Map<String, List<BlockPos>> specialBlockLocations, long cacheTimestamp) {
158 this.size = size(height);
159 this.sizeInBytes = sizeInBytes(size);
160 validateSize(data);
161
162 this.x = x;
163 this.z = z;
164 this.height = height;
165 this.data = data;
166 this.overview = overview;
167 this.heightMap = new int[256];
168 this.specialBlockLocations = specialBlockLocations;
169 this.cacheTimestamp = cacheTimestamp;
170 if (specialBlockLocations.isEmpty()) {
171 this.special = null;
172 } else {
173 this.special = new Int2ObjectOpenHashMap<>();
174 setSpecial();
175 }
176 calculateHeightMap();
177 }
178
179 public static int size(int dimension_height) {
180 return 2 * 16 * 16 * dimension_height;

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.95
sizeInBytesMethod · 0.95
validateSizeMethod · 0.95
setSpecialMethod · 0.95
calculateHeightMapMethod · 0.95
isEmptyMethod · 0.65

Tested by

no test coverage detected