BungeeLib
This is a resource for developers looking to work with Bungee without having to deal with plugin messages manually.
This is a replacement for my old library SpongyCord; rather than a plugin, it is a shadowable library. It also has no possibility of multiple plugins interfering, unlike SpongyCord.
This library supports all the standard Bungee functions:
- Connecting players to other servers
- Getting players’ real IP addresses
- Getting players’ real UUIDs
- Getting player counts, both server and network
- Getting player lists, both server and network
- Getting the server name of the current server
- Sending messages to players on other servers
- Sending plugin message packets to other players or servers
- Getting the IP address of servers
- Kicking players on other servers
Simply construct a BungeeLib
using your PluginContainer
and everything will work.
Notes:
- Since the library operates via plugin messages, there must be at least one player online on the server.
- If the server is not currently in
GameState.SERVER_STARTED
, anIllegalStateException
is thrown. - If the server has started, but there are no players online, methods that do not take a player as an argument throw
NoPlayerOnlineException
.
To use this in your plugin, add the following code to build.gradle
:
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.3'
}
configurations {
compile.extendsFrom shadow
}
repositories {
maven {
url 'https://jitpack.io'
}
}
dependencies {
shadow 'com.github.pie-flavor:BungeeLib:1.0.0'
}
shadowJar {
classifier = null
configurations = [project.configurations.shadow]
}
build.dependsOn(shadowJar)
No Maven example because maven is bad.