All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.llamalad7.mixinextras.versions.MixinVersionImpl_v0_8_3 Maven / Gradle / Ivy

package com.llamalad7.mixinextras.versions;

import com.llamalad7.mixinextras.utils.MixinInternals_v0_8_3;
import org.objectweb.asm.tree.AnnotationNode;
import org.spongepowered.asm.mixin.injection.struct.InjectionInfo;
import org.spongepowered.asm.mixin.injection.struct.MemberInfo;
import org.spongepowered.asm.mixin.injection.struct.Target;
import org.spongepowered.asm.mixin.refmap.IMixinContext;
import org.spongepowered.asm.mixin.transformer.MixinTargetContext;

import java.util.Collection;
import java.util.stream.Collectors;

@SuppressWarnings("unused")
public class MixinVersionImpl_v0_8_3 extends MixinVersionImpl_v0_8 {
    @Override
    public IMixinContext getMixin(InjectionInfo info) {
        return info.getMixin();
    }

    @Override
    public void preInject(InjectionInfo info) {
        info.preInject();
    }

    @Override
    public AnnotationNode getAnnotation(InjectionInfo info) {
        return info.getAnnotationNode();
    }

    @Override
    public Collection getTargets(InjectionInfo info) {
        MixinTargetContext mixin = (MixinTargetContext) MixinVersion.getInstance().getMixin(info);
        return MixinInternals_v0_8_3.getTargets(info).stream().map(mixin::getTargetMethod).collect(Collectors.toList());
    }

    @Override
    public MemberInfo parseMemberInfo(String targetSelector, InjectionInfo info) {
        return MemberInfo.parse(targetSelector, info);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy