?️ ProtocolExtension 通过向游戏添加更多数据包*来扩展服务器的可能性。
注意: 如果您正在使用我的模组,请不要购买 Minecraft。
? 安装(仅限服务器管理员)
ProtocolExtension 仅可在 Fabric 上作为客户端安装,并在 Paper(及其分支版)上作为服务端安装。我未来可能会增加更多兼容性,但目前暂不考虑。该项目的 JAR 文件同时适用于服务端和客户端。
- 下载 ProtocolExtension 最新 JAR 文件
- 下载 PacketEvents 最新 JAR 文件
- 将两个 JAR 文件上传至服务器 `plugins` 文件夹
当然,所有玩家也需要安装 ProtocolExtension JAR 文件(以便自定义数据包能够正常工作),但它在客户端没有任何依赖项。
(您可以制作一个插件来踢出未将此作为模组使用的玩家,但这并非必须——因为我制作的许多插件仅将其作为提升体验的功能,而非任何流程中的必要部分)
不再支持旧版本的 ProtocolExtension。如果您需要更新到较旧的 Minecraft 版本,请在 GitHub Issues 页面上提出请求——如果它与最新版本在代码层面差异不大,我可能会为其制作一个兼容版本。 ProtocolExtension 将重写为基于 Avoid Framework。请放心,这将带来对更多 Minecraft 版本的支持!
? 数据包
-
[服务端发往客户端]
- Activate (内部) - 首先发送,用于通知服务端支持 ProtocolExtension
- KeyPressedC2S - 当客户端在游戏内按下非特殊键时接收
- MouseMoveC2S - 当客户端在屏幕中移动鼠标时接收
- ChatOpenedC2SPayload - 当客户端打开聊天界面时接收
- ChatClosedC2SPayload - 当客户端关闭聊天界面时接收
-
[客户端发往服务端]
- Activate (内部) - 回传以通知客户端支持 ProtocolExtension
- ToggleHUDS2C - 代替客户端点击 F1 以切换 HUD 可见性**
- HUDPutElementS2C - 向游戏内 HUD 添加具有指定 ID、位置和文本的元素
- HUDDeleteElementS2C - 从游戏内 HUD 删除具有指定 ID 的元素
- HUDClearS2C - 清除游戏内 HUD 中的所有元素
- HUDSettingHotbarS2C - 切换游戏内 HUD 上的快捷栏可见性
- MoveToggleS2C - 切换客户端逻辑中的移动计时
- ServerCommandS2C - 设置玩家的潜行和疾跑模式
- SetWindowTitleS2C - 在游戏窗口标题后追加文本字面量
- SetPerspectiveS2C - 设置客户端的视角
- ToggleRenderingS2C - 切换游戏是否为客户端渲染
- ClearChatS2CPayload - 清除客户端的聊天记录
?️ 安全性
ProtocolExtension 高度重视您的设备安全,并尽可能最小化提供的数据。服务端无法:
- 在您的客户端上评估原始代码
- 记录您在游戏外时的键盘或鼠标状态
- 查看由其创建之外的任何 HUD 元素
服务端创建的所有 HUD 元素在您离开服务器后都会自动移除。
? API
ProtocolExtension 提供了 API 以便向客户端发送自定义数据包。相关文档即将推出。要安装它,您需要将 ProtocolExtension jar 嵌入到您的 maven.pom/build.gradle 中,并设置为 compile-only;更多信息请见此处。
* 它实际上使用的是 CustomPayload 数据包
** 切换 HUD 可见性
?️ ProtocolExtension extends server possibilities by adding more packets* to the game.
Note: If you're using my mods, please do not buy Minecraft.
? Setup (only for server owners)
ProtocolExtension can only be installed as a client on Fabric, and as a server on Paper (and forks). I may add more compatibility in the future but it is not considered currently. The project JAR is both for the server, and the client.
- Download the ProtocolExtension latest JAR file
- Download the PacketEvents latest JAR file
- Upload both JARs to the server `plugins` folder
Of course, all players also need to install the ProtocolExtension JAR file (to be able to have the custom packets work), but it doesn't have any dependencies on the client.
(You can make a plugin that kicks players for not using this as a mod, however it's optional to do so - because most plugins I make use this just as a QoL thing, not an essential part of any process)
Older versions of ProtocolExtension are not supported. If you need an update for an older Minecraft version, please request it on the GitHub Issues page - if it's not too different from the latest (in terms of code), I might make a version for it. ProtocolExtension will be undergoing a rewrite onto Avoid Framework. Don't worry, this will bring even more Minecraft versions support!
? Packets
-
[Serverbound]
- Activate (internal) - sent first to notify the server of the ProtocolExtension support
- KeyPressedC2S - received when the client presses a non-special key in-game
- MouseMoveC2S - received when the client moves the mouse in a screen
- ChatOpenedC2SPayload - received when the client opens the chat screen
- ChatClosedC2SPayload - received when the client closes the chat screen
-
[Clientbound]
- Activate (internal) - sent back to notify the client of the ProtocolExtension support
- ToggleHUDS2C - sent to click F1 on behalf of the client**
- HUDPutElementS2C - adds an element with a given id, position and text to the in-game HUD
- HUDDeleteElementS2C - deletes an element with a given id from the ingame HUD
- HUDClearS2C - clears all elements from the ingame HUD
- HUDSettingHotbarS2C - toggles hotbar visibility on the ingame HUD
- MoveToggleS2C - toggles movement ticking in the client logic
- ServerCommandS2C - sets the player's sneaking and sprinting modes
- SetWindowTitleS2C - appends a text literal to the game window title
- SetPerspectiveS2C - sets the client's perspective
- ToggleRenderingS2C - toggles whether the game renders for the client
- ClearChatS2CPayload - clears the client's chat
?️ Security
ProtocolExtension treats your device safety seriously, and minimizes the provided data as much as possible. The server cannot:
- evaluate raw code on your client
- log your keyboard or mouse states when used outside of the game
- view any HUD elements not created by it
All HUD elements the server makes are automatically removed after you leave the server.
? API
ProtocolExtension has an API to send the custom packets to the clients. A documentation will be available for it soon. To install it, you need to embed the ProtocolExtension jar in your maven.pom/build.gradle as compile-only; more info here.
* it actually uses CustomPayload packets
** toggle HUD visibility
下载 ProtocolExtension
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
下载 ProtocolExtension
26.2 说明文件
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
通过对话框或铁砧界面帮助你的 Anthme
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
评论 0
登录后参与评分
还没有评论,来抢沙发吧