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

com.llamalad7.mixinextras.utils.MixinInternals_v0_8_3 Maven / Gradle / Ivy

package com.llamalad7.mixinextras.utils;

import org.objectweb.asm.tree.MethodNode;
import org.spongepowered.asm.mixin.injection.struct.InjectionInfo;

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

public class MixinInternals_v0_8_3 {
    private static final InternalField> INJECTION_INFO_SELECTED_TARGETS
            = InternalField.of(InjectionInfo.class, "targets");
    private static final InternalField SELECTED_TARGET_METHOD
            = InternalField.of("org.spongepowered.asm.mixin.injection.struct.InjectionInfo$SelectedTarget", "method");

    public static Collection getTargets(InjectionInfo info) {
        return INJECTION_INFO_SELECTED_TARGETS.get(info).stream().map(SELECTED_TARGET_METHOD::get).collect(Collectors.toList());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy