PacketSample/README.md

17 lines
822 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 给屑颜的留言
该插件使用 PaperSpigot 在 1.18 中提供的 paperweight-userdev 工具包进行开发Gradle 任务 runServer 可用于直接在Idea内启动简易服务端用于插件测试。
## `cc.maxmc.sample.packet`
该部分为数据包拦截原理,我做的简易实现,实际开发过程中建议使用`ProtocolLib/TabooLib`等成熟数据包收发框架进行处理
## `cc.maxmc.sample.listener`
该部分为聊天信息截取在Paper中该数据包
`net.minecraft.network.protocol.game.ClientboundChatPacket#getMessage` 用于发送系统信息(主要为TranslateKey)
`net.minecraft.network.protocol.game.ClientboundChatPacket.adventure$message` 用于发送玩家聊天信息
`net.minecraft.network.protocol.game.ClientboundChatPacket.components` **可能**用于插件发送消息