PayloadLib
一种更简便的方法,供 Paper 服务器发送和处理自定义数据包(Payload),高度优化且功能强大。
更多信息请参阅我们的 GitHub 仓库。
导入
若要使用 PayloadLib 的快照版本,请在你的 build.gradle 中添加以下内容:
repositories {
maven {
name = 'Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
}
}
dependencies {
implementation 'top.nlrdev:payloadlib:0.0.2-SNAPSHOT'
// 可选依赖项,提供 ByteBuf
implementation 'io.netty:netty-buffer:4.2.14.Final'
}
不建议将此插件嵌入到其他插件 JAR 文件中,因为这可能导致各种问题。
支持的数据类型
基本类型
| 基本类型 | 打包类型 | 数组类型 | 无符号实现方式 |
|---|---|---|---|
| boolean | Boolean | 不支持 | 无 |
| byte | Byte | byte[] | 无 |
| short | Short | 不支持 | top.nlrdev.payloadlib.types.UnsignedShort |
| char | Character | 不支持 | 无 |
| int | Integer | 不支持 | 无 |
| long | Long | 不支持 | 无 |
| float | Float | 不支持 | 无 |
| double | Double | 不支持 | 无 |
非基本类型
| 类型 | PayloadLib |
|---|---|
| String | 保持不变 |
| UUID | 保持不变 |
org.joml.Vector3f |
保持不变 |
org.joml.Quaternionf |
保持不变 |
| Minecraft (官方映射) | Minecraft (Yarn 映射) | PayloadLib |
|---|---|---|
net.minecraft.resources.ResourceLocation |
net.minecraft.util.Identifier |
top.nlrdev.payloadlib.types.Identifier |
ByteBufCodecs#VAR_INT |
PacketCodecs#VAR_INT |
top.nlrdev.payloadlib.types.VarInt |
ByteBufCodecs#VAR_LONG |
PacketCodecs#VAR_LONG |
top.nlrdev.payloadlib.types.VarLong |
net.minecraft.world.phys.Vec3 |
net.minecraft.util.math.Vec3d |
org.joml.Vector3d |
net.minecraft.core.BlockPos |
net.minecraft.util.math.BlockPos |
top.nlrdev.payloadlib.types.BlockPos |
许可证
本模组采用 MIT 许可证授权。
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包事件PacketEvents
retrooper
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
前置科技
46
ExyliaLib
ExyliaServices
ExyliaPlugins 的库。
前置实用
26
ProAuthMeLogin
3623813757
通过对话框或铁砧界面帮助你的 Anthme
实用
16
Vessel
muhdfdeen
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
生物存储
13
Vivecraft Spigot Extension
fayer3
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
前置实用
12
旅行地图
mysticdrew
用于绘制游戏内地图或在浏览器中随探索实时进行地图绘制的实时地图。
冒险实用
12
评论 0
登录后参与评分
还没有评论,来抢沙发吧