Skip to content

事件 API

Gem 事件位于 emaki.jiuwu.craft.gem.api.event。所有事件同步发布在 actor owner thread;公开 operations 会拒绝错误线程,部分 runtime 内部入口在无法取得 ownership 时会跳过 pre 事件而继续其既定流程。

事件触发时机Cancellable可修改字段取消/结果效果路径与 operationId
GemInlayEvent校验后、开始扣费或摇点前successChance,clamp 0–100停止镶嵌service/API/GUI 等镶嵌路径;生成 operationId
GemExtractEvent校验后、扣费与移除前停止拆卸direct/API 与 held-item/GUI service 路径;生成 operationId
GemSocketOpenEvent槽位与 opener 校验后、开孔与消耗前停止开孔和 opener 消耗socket opener 的 direct/GUI 路径;包含 operationId
GemInlayCompletedEventsuccess actions 完成且 journal 到达终态后;已完成补偿的失败也可发post,不可回滚与 pre 事件共享 operationIdsuccessful=false 时读取 reasonKey
GemExtractCompletedEvent状态提交、success actions 完成且 journal COMPLETEDpost,不可回滚API/direct/held-item 等实际 commit 路径,与 pre 事件共享 operationId

Completed 事件不是“返回新装备时立即触发”:事务先返回/提交状态,再等待 action stage 和持久 journal 终态。若 actor 已离线或 owner scheduler 退役,runtime 会记录并跳过 completed event。两个 completed 事件均非 Cancellable。