Add warning if Mixin did not get initialized

This commit is contained in:
makamys committed 2023-03-28 20:59:13 +02:00
1 parent e1b148d5c7
commit ff22e0a7b6
1 file changed
+7
@@ -29,6 +29,7 @@ public class SanityCheck {
checkConcerningJars(warnings);
checkMixinContainer(warnings);
checkMixinHasInitialized(warnings);
if(!warnings.isEmpty()) {
// Any throwables we throw here will get caught, so all we can do is warn.
@@ -44,6 +45,12 @@ public class SanityCheck {
}
}
private static void checkMixinHasInitialized(List<String> warnings) {
if(!Launch.blackboard.containsKey("mixin.initialised")) {
warnings.add("Mixin has not been initialized! If this is a dev environment, make sure org.spongepowered.asm.launch.MixinTweaker was added via the --tweakClass program argument.");
}
}
private static void checkMixinContainer(List<String> warnings) {
String mixinCoreJarName = getJarName(SanityCheck.class.getResource("/io/github/legacymoddingmc/unimixins/mixin/MixinCore.class"));
String mixinTweakerJarName = getJarName(SanityCheck.class.getResource("/org/spongepowered/asm/launch/MixinTweaker.class"));