Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Modify multiple local variables

Open IceCryptonym opened this issue 6 years ago • 1 comments

Is there a way to modify multiple local variables at once? Say I have a method that returns an array float[] fall = EntityEvents.onLivingFall(entity, distance, damageMultiplier); I would like to change the local variables to those values in the array.

IceCryptonym avatar Jan 19 '20 08:01 IceCryptonym

Not currently, though this is a good idea. It could actually be done in a similar way to how @ModifyArgs is done vs. @ModifyArg. Effectively adding a new @ModifyVariables which would be less efficient but more flexible.

Local variable detection is much improved in 0.8 so adding more local variable functionality is definitely more viable.

Mumfrey avatar Jan 20 '20 11:01 Mumfrey