Search in sources :

Example 1 with ChunkCacheRec

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);
}
Also used : ChunkCacheRec(org.dynmap.common.chunk.GenericChunkCache.ChunkCacheRec) DynIntHashMap(org.dynmap.utils.DynIntHashMap)

Example 2 with ChunkCacheRec

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);
}
Also used : ChunkCacheRec(org.dynmap.common.chunk.GenericChunkCache.ChunkCacheRec)

Aggregations

ChunkCacheRec (org.dynmap.common.chunk.GenericChunkCache.ChunkCacheRec)2 DynIntHashMap (org.dynmap.utils.DynIntHashMap)1