Freight is a library for working with BungeeCord plugin messages in Minestom. It provides bindings for sending and receiving BungeeCord plugin messages, by including types for requests and responses for BungeeCord plugin messaging.
- Type-safe request and response objects for BungeeCord plugin messaging
- Utilities for sending messages through adventures audiences
- Easy integration with Minestom event system
- Connect, ConnectOther
- IP, IPOther
- PlayerCount, PlayerList
- GetServers, GetServer, GetPlayerServer
- UUID, UUIDOther
- ServerIP
- KickPlayer, KickPlayerRaw
- Forward, ForwardToPlayer
- Message, MessageRaw
The latest version of Freight is published to Maven Central. To use it in your project add the following dependency:
repositories {
mavenCentral()
}
dependencies {
implementation("dev.kerman:freight:$VERSION")
}Where $VERSION can be found on Maven Central or by using the latest release dropping the v.
For example, the latest version as of writing is 1.6.2.
importmoduledev.kerman.freight;
// orimportdev.kerman.freight.BungeeMessage;
importdev.kerman.freight.BungeeRequest;
importdev.kerman.freight.BungeeResponse;Playerplayer = ...;
BungeeRequestrequest = newBungeeRequest.UUID();
request.send(player);Using the shorthand version of BungeeMessage#readResponse(PlayerPluginMessageEvent)
vareventNode = ...
eventNode.addListener(PlayerPluginMessageEvent.class, event -> {
BungeeResponseresponse = BungeeMessage.readResponse(event);
if (response == null) return;
// Handle the response hereswitch (response) {
caseBungeeResponse.UUID(UUIDuuid) -> {
// Handle the UUID response
}
...
}
});Javadocs are hosted here
This project uses Gradle. To build:
gradlew buildSee LICENSE.