package makamys.neodymium; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; import org.spongepowered.asm.lib.tree.ClassNode; import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; import org.spongepowered.asm.mixin.extensibility.IMixinInfo; import makamys.neodymium.config.Config; import makamys.neodymium.util.OFUtil; public class MixinConfigPlugin implements IMixinConfigPlugin { @Override public void onLoad(String mixinPackage) { Config.reloadConfig(); } @Override public String getRefMapperConfig() { return null; } @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { return true; } @Override public void acceptTargets(Set myTargets, Set otherTargets) {} @Override public List getMixins() { List mixins = new ArrayList<>(); mixins.addAll(Arrays.asList( "MixinRenderGlobal", "MixinWorldRenderer", "MixinTessellator")); if (OFUtil.isOptiFinePresent()) { System.out.println("Detected OptiFine"); mixins.add("MixinRenderGlobal_OptiFine"); mixins.add("MixinGameSettings_OptiFine"); } if(Config.replaceOpenGLSplash) { mixins.add("MixinGuiMainMenu"); } return mixins; } @Override public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} @Override public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) {} }