Closed KingContaria closed 1 year ago
Did you have a specific use-case in mind for this? I don't currently have any plans to add it because it would add an awful lot of complexity for me and I'm a firm believer that it's never the best way to do things.
I am trying to use ModifyExpressionValue to transform
boolean bl = blockHitResult.getBlockPos().equals(blockPos);
to
boolean bl = blockHitResult.getBlockPos().equals(blockPos) && blockHitResult.getType() != HitResult.Type.MISS;
and capturing the blockHitResult seemed like the cleanest way to do that.
I know could do some obscure solutions like modifying the getBlockPos instead to return some blockpos thats never equal to blockPos
when my condition is wrong with @WrapOperation
but it seems like a less readable/straight forward solution
if you don't want to add localcapture tho i can resort to that so it wouldn't be too big a deal, i just liked it because of the readability mainly
what exactly is so bad about localcapture anyway i never really understood?
This should be covered by sugar, correct?
Yep, was just about to comment that lol
working very nicely! :)
Hi, since its possible to get the enclosing methods parameters, i was wondering if you'd consider also adding localcapture to
@ModifyExpressionValue
?