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

com.llamalad7.mixinextras.injector.ModifyReceiver Maven / Gradle / Ivy

Go to download

Companion library to Mixin with lots of features to improve the compatibility and concision of your mixins!

There is a newer version: 0.5.0-beta.4
Show newest version
package com.llamalad7.mixinextras.injector;

import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Slice;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Allows you to modify the receiver of a non-static
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeInvoke method call} or
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeFieldAccess field get/set}.
 * 

* Your handler method receives the targeted instruction's arguments (optionally followed by the enclosing method's * parameters), and should return the adjusted receiver for the operation. *

* * * * * * * * * * * * * * * * * * * * *
Targeted operationHandler signature
Non-static method callprivate (static) ReceiverType handler(ReceiverType original, <params of the * original call>)
super. method callprivate (static) ThisClass handler(ThisClass original, <params of the original * call>)
Non-static field getprivate (static) ReceiverType handler(ReceiverType original)
Non-static field writeprivate (static) ReceiverType handler(ReceiverType original, FieldType newValue) *
* This chains when used by multiple people, unlike * {@link org.spongepowered.asm.mixin.injection.Redirect @Redirect}. *

* If you never use the {@code original} then you risk other people's changes being silently ignored. *

* See the wiki article for more info. */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface ModifyReceiver { String[] method(); At[] at(); Slice[] slice() default {}; boolean remap() default true; int require() default -1; int expect() default 1; int allow() default -1; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy