11package org .embeddedt .modernfix .common .mixin .perf .resourcepacks ;
22
33import net .minecraft .server .packs .PackLocationInfo ;
4- import net .minecraft .server .packs .PackResources ;
5- import net .minecraft .server .packs .PackType ;
64import net .minecraft .server .packs .PathPackResources ;
75import org .embeddedt .modernfix .resources .ICachingResourcePack ;
86import org .embeddedt .modernfix .resources .PackResourcesCacheEngine ;
9- import org .embeddedt .modernfix .util .PackTypeHelper ;
107import org .spongepowered .asm .mixin .Final ;
118import org .spongepowered .asm .mixin .Mixin ;
129import org .spongepowered .asm .mixin .Shadow ;
1310import org .spongepowered .asm .mixin .injection .At ;
1411import org .spongepowered .asm .mixin .injection .Inject ;
15- import org .spongepowered .asm .mixin .injection .Redirect ;
1612import org .spongepowered .asm .mixin .injection .callback .CallbackInfo ;
17- import org .spongepowered .asm .mixin .injection .callback .CallbackInfoReturnable ;
1813
19- import java .nio .file .Files ;
20- import java .nio .file .LinkOption ;
2114import java .nio .file .Path ;
22- import java .util .Objects ;
23- import java .util .Set ;
2415
2516@ Mixin (value = PathPackResources .class , priority = 1100 )
2617public abstract class PathPackResourcesMixin implements ICachingResourcePack {
@@ -48,6 +39,8 @@ public void invalidateCache() {
4839 this .cacheEngine = null ;
4940 }
5041
42+ /*
43+
5144 @Inject(method = "getNamespaces", at = @At("HEAD"), cancellable = true)
5245 private void useCacheForNamespaces(PackType type, CallbackInfoReturnable<Set<String>> cir) {
5346 PackResourcesCacheEngine engine = cacheEngine;
@@ -67,10 +60,6 @@ private boolean useCacheForExistence(Path path, LinkOption[] options, String[] o
6760 return this.generateResourceCache().hasResource(originalPaths);
6861 }
6962
70- /**
71- * @author embeddedt
72- * @reason Use cached listing of mod resources
73- */
7463 @Inject(method = "listResources", at = @At("HEAD"), cancellable = true)
7564 private void fastGetResources(PackType type, String namespace, String path, PackResources.ResourceOutput resourceOutput, CallbackInfo ci)
7665 {
@@ -79,4 +68,6 @@ private void fastGetResources(PackType type, String namespace, String path, Pack
7968 ci.cancel();
8069 this.generateResourceCache().collectResources(type, namespace, path.split("/"), Integer.MAX_VALUE, resourceOutput);
8170 }
71+
72+ */
8273}
0 commit comments