Repository navigation
增加玩家与单位的交互冷却 - #121
Merged
Merged
增加玩家与单位的交互冷却#121
Conversation
- 新增 Settings.interact-cooldown,左右键共用、按玩家计算,0 表示关闭 - 在 TraitCommand 等 MONITOR 监听之前取消过快的交互事件 - 澄清 visible-distance 单位为格
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
玩家快速连点 NPC 时,TraitCommand 绑定的命令会被连续触发,所以加了一个可配置的交互冷却。
新增 Settings.interact-cooldown(毫秒),左右键共用、按玩家计算,0 为关闭。事件监听放在 LOWEST,在 TraitCommand 等 MONITOR 监听之前就把过快的交互取消。顺带补充了 visible-distance 的注释,说明单位是格。
已在 1.12.2 服务端测试过,交互冷却没有问题。
另外可以考虑要不要在冷却未结束时给玩家一条文字提示。