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

com.llamalad7.mixinextras.injector.ModifyExpressionValue 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 tweak the resultant value of a
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeInvoke method call},
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeFieldAccess field get},
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeConstant constant} or
 * {@link org.spongepowered.asm.mixin.injection.points.BeforeNew object instantiation}.
 * 

* Your handler method receives the expression's resultant value (optionally followed by the enclosing method's * parameters), and should return the adjusted value: *

 * {@code private (static) ExpressionType handler(ExpressionType original)}
 * 
* This chains when used by multiple people, unlike * {@link org.spongepowered.asm.mixin.injection.Redirect @Redirect} and * {@link org.spongepowered.asm.mixin.injection.ModifyConstant @ModifyConstant}. *

* 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 ModifyExpressionValue { 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