jtJava / PacketWrapper

Packet wrapper classes for ProtocolLib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PacketWrapper

Build

This is an unofficial continuation of PacketWrapper by dmulloy2 and aadnk. The original versions can be found here and here.

When reading and writing packets in ProtocolLib, it is necessary to know the order in which the fields are stored in memory. This requires you to decompile the Minecraft source code with JD-GUI or find it in the Spigot work directory (/work/decompile/), while decoding the meaning of a field by looking up an online wiki resource (tutorial). It would be much easier if these packets could be accessed as any other normal Java bean.

Enter PacketWrapper. It contains wrapper classes for all known packets in 1.19.4, providing you with access to the fields by name, along with automatic conversion to existing Bukkit enumerations and classes. It also includes a number of custom enumerations when appropriate.

How to use

Maven:

First, add the Jitpack Repository

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Then, include the actual dependency

<dependencies>
    <dependency>
        <groupId>com.github.lukalt</groupId>
        <artifactId>PacketWrapper</artifactId>
        <version>2.0.0.</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Either install PacketWrapper as a plugin or shade it into your plugin. Alternatively, you can copy just the required classes (AbstractPacket and the Wrappers you are using) directly to your project.

Gradle (build.gradle):

First register the jitpack repository in your build.gradle:

repositories {
    ...
    maven { url 'https://jitpack.io' }
}

Then add the actual dependency:

dependencies {
    ...
    compile 'com.comphenix.packetwrapper:PacketWrapper:1.19.4-R0.1-SNAPSHOT'
}

Either install PacketWrapper as a plugin on the server or shadow it into your plugin. Alternatively, you can copy just the required classes (AbstractPacket and the Wrappers you are using) directly to your project.

Dependencies

Resources

Building

You can compile this project yourself by using the latest version of Maven using mvn clean install.

Remarks

This project was mostly generated by a script.

About

Packet wrapper classes for ProtocolLib

License:GNU Lesser General Public License v3.0


Languages

Language:Java 100.0%