58 lines
1.7 KiB
Java
58 lines
1.7 KiB
Java
package io.gitlab.jfronny.quickmath;
|
|
|
|
import io.gitlab.jfronny.quickmath.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.Objects;
|
|
import java.util.Set;
|
|
|
|
public class MixinPlugin implements IMixinConfigPlugin {
|
|
@Override
|
|
public void onLoad(String mixinPackage) {
|
|
|
|
}
|
|
|
|
@Override
|
|
public String getRefMapperConfig() {
|
|
return null;
|
|
}
|
|
|
|
@SuppressWarnings("ReferenceToMixin")
|
|
@Override
|
|
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
|
|
if (Objects.equals(mixinClassName, MathHelperMixin.class.getName()))
|
|
return Cfg.corruptGenericMath;
|
|
else if (Objects.equals(mixinClassName, MathHelperMixin2.class.getName()))
|
|
return Cfg.corruptGenericMath2;
|
|
else if (Objects.equals(mixinClassName, MixinPerlinNoiseSampler.class.getName()))
|
|
return Cfg.corruptPerlinNoise;
|
|
else if (Objects.equals(mixinClassName, MixinSimplexNoiseSampler.class.getName()))
|
|
return Cfg.corruptSimplexNoise;
|
|
else
|
|
throw new IllegalStateException("Unrecognized mixin! This should never happen");
|
|
}
|
|
|
|
@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) {
|
|
|
|
}
|
|
}
|