package com.r3944realms.modernlifepatch.mixin;

import org.objectweb.asm.tree.ClassNode;
import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin;
import org.spongepowered.asm.mixin.extensibility.IMixinInfo;

import java.util.List;
import java.util.Set;

public class MLPMixinPlugin implements IMixinConfigPlugin {
    @Override
    public void onLoad(String s) {

    }

    @Override
    public String getRefMapperConfig() {
        return null;
    }

    @Override
    public boolean shouldApplyMixin(String s, String s1) {
        boolean isRegister = s.split("com\\.r3944realms\\.modernlifepatch\\.mixin\\.")[0].split("\\.")[0].equals("runData");
        if (isRegister) {
            return isDataGeneration();
        }
        return true;
    }

    private boolean isDataGeneration() {
        // 使用你的逻辑来检查是否在数据生成阶段
        String environment = System.getProperty("gradle.task");
        return "runData".equals(environment);
    }



    @Override
    public void acceptTargets(Set<String> set, Set<String> set1) {

    }

    @Override
    public List<String> getMixins() {
        return null;
    }

    @Override
    public void preApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

    }

    @Override
    public void postApply(String s, ClassNode classNode, String s1, IMixinInfo iMixinInfo) {

    }
}
