PacketWrapper
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 my repository to your pom.xml so Maven can find the library.
<repositories>
<repository>
<id>lukasalt-repo</id>
<url>https://repo.lukasa.lt/repository/maven-public/</url>
</repository>
</repositories>
Then, include the actual dependency in your pom.xml
<dependencies>
<dependency>
<groupId>com.comphenix.packetwrapper</groupId>
<artifactId>PacketWrapper</artifactId>
<version>1.19.4-2.1.1</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, add my repository so Gradle can find the dependency:
repositories {
...
maven { url 'https://repo.lukasa.lt/repository/maven-public/' }
}
Then, add the actual dependency:
dependencies {
...
compile 'com.comphenix.packetwrapper:packetWrapper:1.19.4-2.1.1'
}
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.
Information
Category | Developer Tools |
---|---|
Published on | May 15, 2023 |
License | GPL |
Downloads | 6 |
Stars | 0 |
Watchers | 0 |