简体中文
事件 API
Cooking 公开 4 个同步 Bukkit 事件; 不同 fire 点的 owner 检查与覆盖范围不能互相替代
| 事件 | 触发时机 | 线程 | Cancellable | 可修改字段 | 取消/结果效果 |
|---|---|---|---|---|---|
CookingStationInteractEvent | 已识别且启用的七类工位交互, 在对应 handleInteraction 前 | 玩家/位置 owner thread | 否 | 无 | 通知事件, 不阻止工位逻辑; 并由 tracker 记录 recent station |
CookingRecipeCompleteEvent | 共享奖励出口中, 输出和 completion actions 交付前 | global-region owner thread; 无法拥有时跳过事件而继续既定奖励流 | 是 | dropResult | 取消阻止输出和 completion actions |
PlayerNutritionConsumeEvent | 支持的 vanilla/MMOItems/NeigeItems 食物来源聚合后, 营养与 source actions 应用前 | 玩家 owner thread | 是 | 无 | 阻止 EmakiCooking 营养/actions, 但不撤销底层消费行为 |
NutritionThresholdChangeEvent | single/combo 阈值的 met 状态发生边沿变化后 | 玩家 owner thread | 否 | 无 | post 通知, 不可回滚状态或动作 |
自动工位完成时 CookingRecipeCompleteEvent.getPlayer() 可为 null. dropResult 只改变输出交付方式. 两个通知/post 事件都不可取消; 非 owner 路径不会为了审计而 off-thread 发布事件