Hex Casting

Hex Casting

7M Downloads

Add `@Throws(Mishap::class)` to `Action#operate` and similar subclass methods

object-Object opened this issue ยท 0 comments

commented

Describe the feature

As per the Kotlin docs, Kotlin code needs to use the @Throws annotation to allow Java code to throw/catch exceptions in some cases. Adding @Throws(Mishap::class) to Action#operate, SpellAction#execute, etc would make it easier for Java addons to throw mishaps without resorting to scuffed workarounds.

Note that we apparently already did this for Operator and OperatorBasic:

@Throws(Mishap::class)
abstract fun operate(env: CastingEnvironment, image: CastingImage, continuation: SpellContinuation): OperationResult

Additional context

No response