33
33
@ StableAPI (since = "0.10.2" )
34
34
public final class MixinInfo {
35
35
@ 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
+ }
37
42
38
43
@ StableAPI .Expose
39
44
public static boolean isMixinsInstalled () {
@@ -68,6 +73,11 @@ public static boolean isGasStation() {
68
73
return mixinBootstrapper == MixinBootstrapperType .GasStation ;
69
74
}
70
75
76
+ @ StableAPI .Expose (since = "0.10.15" )
77
+ public static boolean isUniMixin () {
78
+ return mixinBootstrapper == MixinBootstrapperType .UniMixin ;
79
+ }
80
+
71
81
@ StableAPI .Expose
72
82
public static MixinBootstrapperType bootstrapperType () {
73
83
return mixinBootstrapper ;
@@ -97,6 +107,11 @@ public static boolean isClassPresentSafe(String clazz) {
97
107
private static MixinBootstrapperType detect () {
98
108
if (!isClassPresentSafe ("org.spongepowered.asm.launch.MixinBootstrap" ))
99
109
return MixinBootstrapperType .None ;
110
+ for (val candidate : MixinInfoCompatCompanion .UNIMIXIN_CANDIDATES ) {
111
+ if (isClassPresentSafe (candidate )) {
112
+ return MixinBootstrapperType .UniMixin ;
113
+ }
114
+ }
100
115
if (isClassPresentSafe ("com.falsepattern.gasstation.GasStation" ))
101
116
return MixinBootstrapperType .GasStation ;
102
117
if (isClassPresentSafe ("ru.timeconqueror.spongemixins.core.SpongeMixinsCore" ))
@@ -115,6 +130,7 @@ public enum MixinBootstrapperType {
115
130
@ StableAPI .Expose SpongeMixins ,
116
131
@ StableAPI .Expose Grimoire ,
117
132
@ StableAPI .Expose MixinBooterLegacy ,
118
- @ StableAPI .Expose Other
133
+ @ StableAPI .Expose Other ,
134
+ @ StableAPI .Expose (since = "0.10.15" ) UniMixin
119
135
}
120
136
}
0 commit comments