Files
CustomNPC-Plus/src/main/java/noppes/npcs/client/ClientCache.java
T

17 lines
645 B
Java
Raw Normal View History

2023-05-30 23:41:37 -05:00
package noppes.npcs.client;
import noppes.npcs.client.renderer.customitem.ImageData;
import noppes.npcs.util.CacheHashMap;
public class ClientCache {
private static final CacheHashMap<String, CacheHashMap.CachedObject<ImageData>> imageDataCache = new CacheHashMap<>(10*60*1000);
2023-05-30 23:41:37 -05:00
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();
2023-05-30 23:41:37 -05:00
}
}
}