-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
For instance in the following expression:
if (random.nextFloat() < (this.level().getDifficulty == Difficulty.HARD ? 0.05F : 0.01F)) {is it possible to modify the return values of each branch of the ternary, or else the ultimate result of the whole expression?
It seems impossible to match a ternary expression directly given that ? is a wildcard in the Expression DSL, unless I use an Injector and point at the right offset, which seems overly brittle and exactly the kind of thing ModifyExpressionValue was created to solve.
This functionality also seems broadly useful, given that the ternary expression is quite a common pattern (in the Minecraft source, at the very least).
Metadata
Metadata
Assignees
Labels
No labels