3333@ StableAPI (since = "0.10.2" )
3434public final class MixinInfo {
3535 @ StableAPI .Expose
36- public static final MixinBootstrapperType mixinBootstrapper = detect ();
36+ public static final MixinBootstrapperType mixinBootstrapper ;
37+
38+ static {
39+ MixinInfoCompatCompanion .mixinInfoClassLoaded = true ;
40+ mixinBootstrapper = detect ();
41+ }
3742
3843 @ StableAPI .Expose
3944 public static boolean isMixinsInstalled () {
@@ -68,6 +73,11 @@ public static boolean isGasStation() {
6873 return mixinBootstrapper == MixinBootstrapperType .GasStation ;
6974 }
7075
76+ @ StableAPI .Expose (since = "0.10.15" )
77+ public static boolean isUniMixin () {
78+ return mixinBootstrapper == MixinBootstrapperType .UniMixin ;
79+ }
80+
7181 @ StableAPI .Expose
7282 public static MixinBootstrapperType bootstrapperType () {
7383 return mixinBootstrapper ;
@@ -97,6 +107,11 @@ public static boolean isClassPresentSafe(String clazz) {
97107 private static MixinBootstrapperType detect () {
98108 if (!isClassPresentSafe ("org.spongepowered.asm.launch.MixinBootstrap" ))
99109 return MixinBootstrapperType .None ;
110+ for (val candidate : MixinInfoCompatCompanion .UNIMIXIN_CANDIDATES ) {
111+ if (isClassPresentSafe (candidate )) {
112+ return MixinBootstrapperType .UniMixin ;
113+ }
114+ }
100115 if (isClassPresentSafe ("com.falsepattern.gasstation.GasStation" ))
101116 return MixinBootstrapperType .GasStation ;
102117 if (isClassPresentSafe ("ru.timeconqueror.spongemixins.core.SpongeMixinsCore" ))
@@ -115,6 +130,7 @@ public enum MixinBootstrapperType {
115130 @ StableAPI .Expose SpongeMixins ,
116131 @ StableAPI .Expose Grimoire ,
117132 @ StableAPI .Expose MixinBooterLegacy ,
118- @ StableAPI .Expose Other
133+ @ StableAPI .Expose Other ,
134+ @ StableAPI .Expose (since = "0.10.15" ) UniMixin
119135 }
120136}
0 commit comments