PayloadLib
Easier approach for Paper servers to send & handle custom payloads, simple & powerful.
PayloadLib
PayloadLib
Easier approach for Paper servers to send & handle custom payloads, simple & powerful.
Please refer to our GitHub Repository for more information.
Importing
To access the snapshot version of PayloadLib, please add this in your `build.gradle`:
```groovy repositories { maven { name = 'Central Portal Snapshots' url = 'https://central.sonatype.com/repository/maven-snapshots/' } }
dependencies { implementation 'top.nlrdev:payloadlib:0.0.2-SNAPSHOT'
// Optional dependency, providing ByteBuf implementation 'io.netty:netty-buffer:4.2.2.Final' } ```
Embedding this plugin within other plugin JARs is not recommended, as it can lead to various issues.
Supported Data Types
Primitive
| Primitive | Packaged | Array | Unsigned Implementation | | --------- | --------- | ------------- | ------------------------------------------- | | boolean | Boolean | Unsupported | None | | byte | Byte | byte[] | None | | short | Short | Unsupported | `top.nlrdev.payloadlib.types.UnsignedShort` | | char | Character | Unsupported | None | | int | Integer | Unsupported | None | | long | Long | Unsupported | None | | float | Float | Unsupported | None | | double | Double | Unsupported | None |
Non-Primitive
| Type | PayloadLib | | ---------------------- | ----------- | | String | Unchanged | | UUID | Unchanged | | `org.joml.Vector3f` | Unchanged | | `org.joml.Quaternionf` | Unchanged |
| Minecraft (Official) | 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` |
Examples
You can refer to these live examples to get inspiration:
- XIAYM-gh/SittingPlus-uwu-Bukkit
License
This mod is licensed under MIT License.