55import com .llamalad7 .mixinextras .sugar .Local ;
66import com .mojang .serialization .DataResult ;
77import io .github .misode .packtest .LoadDiagnostics ;
8+ import io .github .misode .packtest .PackTestFileToIdConverter ;
9+ import net .minecraft .resources .FileToIdConverter ;
810import net .minecraft .resources .ResourceLocation ;
911import net .minecraft .server .packs .resources .SimpleJsonResourceReloadListener ;
1012import org .slf4j .Logger ;
@@ -30,8 +32,9 @@ private static void resourceParseError(Logger logger, String message, Object[] a
3032 LoadDiagnostics .error (LOGGER , type , ((ResourceLocation )args [0 ]).toString (), ((DataResult .Error <?>)args [2 ]).message ());
3133 }
3234
33- @ WrapOperation (method = "scanDirectory" , at = @ At (value = "INVOKE" , target = "Lorg/slf4j/Logger;error(Ljava/lang/String;[Ljava/lang/Object;)V" , remap = false ))
34- private static void resourceException (Logger logger , String message , Object [] args , Operation <Void > original , @ Local (ordinal = 0 , argsOnly = true ) String directory ) {
35+ @ WrapOperation (method = "scanDirectory(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/resources/FileToIdConverter;Lcom/mojang/serialization/DynamicOps;Lcom/mojang/serialization/Codec;Ljava/util/Map;)V" , at = @ At (value = "INVOKE" , target = "Lorg/slf4j/Logger;error(Ljava/lang/String;[Ljava/lang/Object;)V" , remap = false ))
36+ private static void resourceException (Logger logger , String message , Object [] args , Operation <Void > original , @ Local (argsOnly = true ) FileToIdConverter converter ) {
37+ String directory = ((PackTestFileToIdConverter )converter ).packtest$getPrefix ();
3538 String type = directory .replace ("_" , " " ).replace ("/" , " " );
3639 LoadDiagnostics .error (LOGGER , type , ((ResourceLocation )args [0 ]).toString (), (args [2 ]).toString ());
3740 }
0 commit comments