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

com.llamalad7.mixinextras.injector.wrapmethod.WrapMethodInjectionPoint Maven / Gradle / Ivy

package com.llamalad7.mixinextras.injector.wrapmethod;

import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.InsnList;
import org.spongepowered.asm.mixin.injection.InjectionPoint;

import java.util.Collection;

class WrapMethodInjectionPoint extends InjectionPoint {
    @Override
    public boolean checkPriority(int targetPriority, int ownerPriority) {
        return true;
    }

    @Override
    public boolean find(String desc, InsnList insns, Collection nodes) {
        if (insns.size() == 0) {
            throw new UnsupportedOperationException("Cannot use @WrapMethod on an abstract method!");
        }
        return nodes.add(insns.getFirst());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy