Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

[NewContent] 命令 #12

Open
SeraphJACK opened this issue Mar 27, 2020 · 3 comments
Open

[NewContent] 命令 #12

SeraphJACK opened this issue Mar 27, 2020 · 3 comments
Assignees

Comments

@SeraphJACK
Copy link
Contributor

虽然 Brigadier 已经有了翻译好的文档,但是一些细节可能还是要说明一下:

  • 自定义 ArgumentType 并注册
  • ArgumentType 的序列化、反序列化
  • 客户端命令的实现思路(?)
@3TUSK 3TUSK self-assigned this Apr 6, 2020
@3TUSK
Copy link
Member

3TUSK commented Apr 6, 2020

jack 在找人当接盘侠,行吧我来。

@3TUSK
Copy link
Member

3TUSK commented Apr 6, 2020

备忘:客户端命令实现思路

  1. 订阅 ClientChatEvent
  2. 自己搓一个 CommandDispatcher<?>
  3. 拦截所有的客户端聊天信息,以 / 开头的统统先过一遍自己搓的 CommandDispatcher,parse 失败的命令再放行给服务器。否则取消事件。

@SeraphJACK
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants