top.hendrixshen.magiclib.impl.malilib.MixinPredicates Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magiclib-malilib-extra-1.19.2-fabric Show documentation
Show all versions of magiclib-malilib-extra-1.19.2-fabric Show documentation
Unleash Magic Enhancement Malilib.
package top.hendrixshen.magiclib.impl.malilib;
import org.objectweb.asm.tree.ClassNode;
import top.hendrixshen.magiclib.api.mixin.MixinPredicate;
//#if FABRIC_LIKE
import top.hendrixshen.magiclib.MagicLib;
import top.hendrixshen.magiclib.libs.org.semver4j.Semver;
//#endif
public class MixinPredicates {
// Workaround for SemVer4j bug!
public static class Malilib_0_11_4 implements MixinPredicate {
@Override
public boolean test(ClassNode classNode) {
//#if FABRIC_LIKE
String malilibVer = MagicLib.getInstance().getCurrentPlatform().getModVersion("malilib");
if ("?".equals(malilibVer)) {
return false;
}
String[] split = malilibVer.split("-");
Semver semver = Semver.coerce(split[0]);
if (semver == null) {
return false;
}
return semver.satisfies("<0.11.4");
//#else
//$$ return false;
//#endif
}
}
}