mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 01:27:27 +00:00
getNPCTexture for ClientCache
This commit is contained in:
1 parent
6bc55e101f
commit
189692a090
3 files changed
+24
-9
No files matched your search
@@ -1,5 +1,6 @@
|
||||
package noppes.npcs.client;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.renderer.ImageData;
|
||||
import noppes.npcs.util.CacheHashMap;
|
||||
|
||||
@@ -14,4 +15,13 @@ public class ClientCacheHandler {
|
||||
return imageDataCache.get(directory).getObject();
|
||||
}
|
||||
}
|
||||
|
||||
public static ImageData getNPCTexture(String directory, boolean x64, ResourceLocation resource) {
|
||||
synchronized (imageDataCache) {
|
||||
if (!imageDataCache.containsKey(resource.getResourcePath())) {
|
||||
imageDataCache.put(resource.getResourcePath(), new CacheHashMap.CachedObject<>(new ImageData(directory, x64, resource)));
|
||||
}
|
||||
return imageDataCache.get(resource.getResourcePath()).getObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user