Add proper support for escape manipulation by Actions#1047
Conversation
object-Object
left a comment
There was a problem hiding this comment.
Didn't fully review (am on a phone), but skimmed and noticed some problematic breaking changes.
| * If the iota *is* within parentheses, it will instead be added to the parenthesized list. | ||
| * Iotas can also be escaped using Consideration, but that's handled in {@link CastingVM#executeInner}. | ||
| */ | ||
| public @NotNull CastResult execute(CastingVM vm, ServerLevel world, SpellContinuation continuation) { |
There was a problem hiding this comment.
I think this is a breaking change - any addon that implements custom iota execution (and also ContinuationIota) will now execute their unescaped behaviour inside of parentheses until patched. Likely we should do the same thing as with Action (ie add an executeInParens method).
There was a problem hiding this comment.
Good catch! This has now been fixed.
| @@ -6,7 +6,7 @@ import at.petrak.hexcasting.api.casting.iota.PatternIota | |||
| import at.petrak.hexcasting.api.pigment.FrozenPigment | |||
| import net.minecraft.world.item.DyeColor | |||
|
|
|||
| class MishapTooManyCloseParens : Mishap() { | |||
There was a problem hiding this comment.
Technically renaming this class is a breaking change, though I'm not sure any addons would be using it. Would be worth at least doing a GitHub search to check.
There was a problem hiding this comment.
Based on GitHub search, the only addon that uses MishapTooManyCloseParens is HexThings - but HexThings also has a mixin to CastingVM.handleParentheses, so this PR breaks it even without the name change.
fb56cc9 to
6b605c9
Compare
Adds the
operateInParensmethod to allowActions to define custom behavior when executed inside parentheses, and removes all the hardcoded jank that was used to do this before.This enables the previously hardcoded patterns for escape manipulation (Consideration, Introspection, Retrospection, and Evanition) to be turned into normal
Actions, and also makes it possible to add new escape manipulators in addons or future updates.