@@ -0,0 +1,862 @@
+package techcable.minecraft.npclib.util;%0A%0Aimport com.google.common.cache.Cache;%0Aimport com.google.common.cache.CacheBuilder;%0Aimport com.google.common.cache.CacheLoader;%0A%0Aimport lombok.*;%0A%0A@Getter%0Apublic class EasyCache%3CK, V%3E %7B%0A    private final Cache%3CK, V%3E backing;%0A    public EasyCache(Loader%3CK, V%3E loader) %7B%0A        backing = CacheBuilder.newBuilder().weakKeys().weakValues().build(new LoaderCacheLoader(loader));%0A    %7D%0A    %0A    public V get(K key) %7B%0A        return backing.getUnchecked(key);%0A    %7D%0A    %0A    public static interface Loader%3CK, V%3E %7B%0A        public V load(K key);%0A    %7D%0A    %0A    @RequiredArgsConstructor%0A    @Getter%0A    private static class LoaderCacheLoader%3CK, V%3E implements CacheLoader %7B%0A        private final Loader%3CK, V%3E backing;%0A        %0A        @Override%0A        public V load(K key) %7B%0A            return backing.load(key);%0A        %7D%0A    %7D%0A%7D

Add Easy Cache