15
15
public class QuiltPlatformMinimal extends FabricPlatform {
16
16
public static final QuiltPlatformMinimal INSTANCE = new QuiltPlatformMinimal ();
17
17
18
- private static final boolean isQFAPIPresent = FabricLoader .getInstance ().isModLoaded ("quilted_fabric_api" );
19
- private static final String GROUP_PACK_CLASS = "org.quiltmc.qsl.resource.loader.api.GroupResourcePack" ;
18
+ private static final boolean isQslModulePresent = FabricLoader .getInstance ().isModLoaded ("quilt_resource_loader" );
20
19
private static final @ Nullable Class <?> GROUP_PACK_RESOURCES ;
21
20
private static final @ Nullable MethodHandle GET_GROUP_PACK_PACKS ;
22
21
23
22
static {
24
23
Class <?> clazz ;
25
24
try {
26
- clazz = FabricPlatform .class .getClassLoader (). loadClass ( GROUP_PACK_CLASS );
25
+ clazz = Class . forName ( "org.quiltmc.qsl.resource.loader.api.GroupPack" , false , FabricPlatform .class .getClassLoader ());
27
26
} catch (ClassNotFoundException e ) {
28
27
clazz = null ;
29
28
}
@@ -35,15 +34,13 @@ public class QuiltPlatformMinimal extends FabricPlatform {
35
34
var lookup = MethodHandles .lookup ();
36
35
MethodHandle getter ;
37
36
try {
38
- var privateLookup = MethodHandles .privateLookupIn (clazz , lookup );
39
- @ SuppressWarnings ("rawtypes" ) Class <List > listClazz = List .class ;
40
- getter = privateLookup .findVirtual (clazz , "getPacks" , MethodType .methodType (listClazz ));
37
+ getter = lookup .findVirtual (clazz , "getPacks" , MethodType .methodType (List .class ));
41
38
} catch (IllegalAccessException | NoSuchMethodException e ) {
42
39
getter = null ;
43
40
}
44
41
GET_GROUP_PACK_PACKS = getter ;
45
42
}
46
- if (GROUP_PACK_RESOURCES == null || GET_GROUP_PACK_PACKS == null && isQFAPIPresent ) {
43
+ if (( GROUP_PACK_RESOURCES == null || GET_GROUP_PACK_PACKS == null ) && isQslModulePresent ) {
47
44
DynamicAssetGenerator .LOGGER .error ("On quilt but could not find quilt class/field to unwrap grouped resources - Dynamic Asset Generator may not work right!" );
48
45
}
49
46
}
0 commit comments