public class ColorCache
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ColorCache.Entry |
Modifier and Type | Field and Description |
---|---|
private it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<int[]> |
cache |
private java.util.concurrent.locks.ReentrantReadWriteLock |
lock |
private java.lang.ThreadLocal<ColorCache.Entry> |
threadCacheEntry |
Constructor and Description |
---|
ColorCache() |
Modifier and Type | Method and Description |
---|---|
private int[] |
getChunkCache(int chunkX,
int chunkZ) |
int |
getColor(BlockPos blockPosIn,
java.util.function.IntSupplier colorSupplier) |
void |
invalidateAll() |
void |
invalidateChunk(int chunkX,
int chunkZ) |
private final java.lang.ThreadLocal<ColorCache.Entry> threadCacheEntry
private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<int[]> cache
private final java.util.concurrent.locks.ReentrantReadWriteLock lock
public int getColor(BlockPos blockPosIn, java.util.function.IntSupplier colorSupplier)
public void invalidateChunk(int chunkX, int chunkZ)
public void invalidateAll()
private int[] getChunkCache(int chunkX, int chunkZ)