PatchModifyCallback

Game-side return-side decision callback, SAM-converted from a Kotlin lambda: Patches.modify("...", "...") { key, self, args, returned, thrown -> ... }. Runs on whatever thread the patched method runs on — cheap and non-blocking is the contract.

Fires after the body, on BOTH exit paths. Assigning a return value does not suppress a pending exception: a throwing method still throws, and the substitute is discarded.

See also

for the head-side decision

Functions

Link copied to clipboard
abstract fun modify(key: String, self: Any, args: Array<Any>, returned: Any, thrown: Throwable): PatchDecision
Called as the patched method leaves, on both exit paths.