Unicopia/src/main/java/com/minelittlepony/unicopia/UnicopiaMixinPlugin.java

62 lines
2.1 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia;
import java.util.List;
import java.util.Set;
import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;
import net.fabricmc.loader.api.FabricLoader;
public class UnicopiaMixinPlugin implements IMixinConfigPlugin {
private static final String MIXIN_PACKAGE = "com.minelittlepony.unicopia.mixin";
@Override
public void onLoad(String mixinPackage) { }
@Override
public String getRefMapperConfig() {
return null;
}
@Override
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
if (mixinClassName.startsWith(MIXIN_PACKAGE)) {
if (mixinClassName.indexOf("sodium") != -1) {
return FabricLoader.getInstance().isModLoaded("sodium");
}
if (mixinClassName.indexOf("trinkets") != -1) {
return FabricLoader.getInstance().isModLoaded("trinkets");
}
2023-09-08 14:02:42 +02:00
if (mixinClassName.indexOf("seasons") != -1) {
return FabricLoader.getInstance().isModLoaded("seasons");
}
2023-09-11 00:28:53 +02:00
if (mixinClassName.indexOf("ad_astra") != -1) {
return FabricLoader.getInstance().isModLoaded("ad_astra");
}
if (mixinClassName.indexOf("minelp") != -1) {
return FabricLoader.getInstance().isModLoaded("minelp");
}
if (mixinClassName.indexOf("forgified") != -1) {
return FabricLoader.getInstance().isModLoaded("connectormod");
}
}
return true;
}
@Override
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) { }
@Override
public List<String> getMixins() {
return null;
}
@Override
public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { }
@Override
public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { }
}