use of org.dynmap.common.chunk.GenericChunkCache.ChunkCacheRec in project dynmap by webbukkit.
the class GenericMapChunkCache method prepChunkSnapshot.
// Prep snapshot and add to cache
private void prepChunkSnapshot(DynmapChunk chunk, GenericChunk ss) {
DynIntHashMap tileData = new DynIntHashMap();
ChunkCacheRec ssr = new ChunkCacheRec();
ssr.ss = ss;
ssr.tileData = tileData;
cache.putSnapshot(dw.getName(), chunk.x, chunk.z, ssr);
}
use of org.dynmap.common.chunk.GenericChunkCache.ChunkCacheRec in project dynmap by webbukkit.
the class GenericMapChunkCache method tryChunkCache.
private boolean tryChunkCache(DynmapChunk chunk, boolean vis) {
/* Check if cached chunk snapshot found */
GenericChunk ss = null;
ChunkCacheRec ssr = cache.getSnapshot(dw.getName(), chunk.x, chunk.z);
if (ssr != null) {
ss = ssr.ss;
if (!vis) {
if (hidestyle == HiddenChunkStyle.FILL_STONE_PLAIN) {
ss = getStone();
} else if (hidestyle == HiddenChunkStyle.FILL_OCEAN) {
ss = getOcean();
} else {
ss = getEmpty();
;
}
}
int idx = (chunk.x - x_min) + (chunk.z - z_min) * x_dim;
snaparray[idx] = ss;
}
return (ssr != null);
}
Aggregations