Update to 1.20
- Remove some devenv mods that are not updated yet - Replace lib39 with fletchingtable for automixins - Use non kotlin entrypoints - Make use of DrawContext in a bunch of places
This commit is contained in:
@@ -18,25 +18,49 @@
|
||||
|
||||
package moe.nea.firmament.init;
|
||||
|
||||
import com.unascribed.lib39.core.api.AutoMixin;
|
||||
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;
|
||||
|
||||
// TODO: replace AutoMixin with KSP plugin?
|
||||
public class MixinPlugin extends AutoMixin {
|
||||
public class MixinPlugin implements IMixinConfigPlugin {
|
||||
|
||||
@Override
|
||||
public void onLoad(String mixinPackage) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRefMapperConfig() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
|
||||
if (!Boolean.getBoolean("firmament.debug") && mixinClassName.contains("devenv.")) {
|
||||
return false;
|
||||
}
|
||||
return super.shouldApplyMixin(targetClassName, mixinClassName);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void acceptTargets(Set<String> myTargets, Set<String> otherTargets) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getMixins() {
|
||||
var autoDiscoveredMixins = super.getMixins();
|
||||
autoDiscoveredMixins.removeIf(it -> !shouldApplyMixin(null, it));
|
||||
return autoDiscoveredMixins;
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user