mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
ClientCache renamed to ClientCacheHandler, moved ImageData into the client package.
This commit is contained in:
1 parent
118d79f3ad
commit
f5e4d702b1
6 files changed
+17
-46
No files matched your search
@@ -0,0 +1,17 @@
|
||||
package noppes.npcs.client;
|
||||
|
||||
import noppes.npcs.client.renderer.ImageData;
|
||||
import noppes.npcs.util.CacheHashMap;
|
||||
|
||||
public class ClientCacheHandler {
|
||||
private static final CacheHashMap<String, CacheHashMap.CachedObject<ImageData>> imageDataCache = new CacheHashMap<>(10*60*1000);
|
||||
|
||||
public static ImageData getImageData(String directory) {
|
||||
synchronized (imageDataCache) {
|
||||
if (!imageDataCache.containsKey(directory)) {
|
||||
imageDataCache.put(directory, new CacheHashMap.CachedObject<>(new ImageData(directory)));
|
||||
}
|
||||
return imageDataCache.get(directory).getObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user