BungeeCord

BungeeCord

magicutils-bungee exposes platform wiring, config, logger, lang, command, and diagnostics integration for BungeeCord proxies in one artifact.

Shared Bundle Install

If several plugins on the proxy use MagicUtils, install magicutils-bungee-bundle as a standalone proxy plugin instead of shading MagicUtils into each one. It is a drop-in MagicUtils plugin that boots one shared MagicRuntime and registers /magicutils (alias mu) with diagnostics sub-commands. Downstream plugins then depend on it (depends/softDepends in their bungee.yml) and register with the shared runtime through BungeeMagicUtilsConsumerRegistry, so /magicutils mods lists them live. The published bundle jar is a shaded runnable artifact — the same one exercised by the compatibility smoke.

Do not do both: either embed MagicUtils in your plugin, or depend on the shared bundle — not both on the same proxy.

Dependency

kotlin
dependencies {    implementation("dev.ua.theroer:magicutils-bungee:1.22.0")}
java
public final class MyPlugin extends Plugin {    private BungeeBootstrap.RuntimeResult magic;    @Override    public void onEnable() {        magic = BungeeBootstrap.forPlugin(this, "MyPlugin")                .enableCommands()                .configureCommands(registry -> registry.registerCommand(new ExampleCommand()))                .buildRuntime();    }    @Override    public void onDisable() {        if (magic != null) {            magic.runtime().close();            magic = null;        }    }}

BungeeBootstrap creates the Platform, ConfigManager, LoggerCore, LanguageManager, and optional CommandRegistry for the plugin. build() returns the legacy bootstrap view; buildRuntime() additionally gives you a managed MagicRuntime.

Commands

Commands register directly with the proxy plugin manager, so you do not declare them anywhere else.

  • Use enableCommands() to create the registry during bootstrap.
  • Use configureCommands(...) to register commands right away.
  • Use permissionPrefix(...) to set the permission node prefix.
  • Use asyncExecutor(...) to override the default async executor used by the command layer.

Bootstrap Options

BungeeBootstrap.Builder supports additional configuration beyond the basics:

MethodDescription
logger(logger)Bind a java.util.logging.Logger for console output.
dataDirectory(path)Override the config/lang data directory.
enableCommands()Create a CommandRegistry during bootstrap.
permissionPrefix(prefix)Set the permission node prefix for commands.
asyncExecutor(executor)Override the async executor used by the command layer.
configureCommands(consumer)Register commands during bootstrap.
enableDiagnostics()Enable the diagnostics service.
initLanguage(boolean)Enable/disable language manager initialization.
bindLoggerLanguage(boolean)Bind the language manager to the logger.
setMessagesManager(boolean)Set the global Messages language manager.
registerMessages(boolean)Register the plugin's messages scope.
addMagicUtilsMessages(boolean)Register built-in MagicUtils messages.
translations(consumer)Configure additional translations.

Notes

  • Platform.runOnMain(...) executes immediately because BungeeCord has no main game thread.
  • buildRuntime() returns a managed MagicRuntime and wires shutdown cleanup through the plugin instance you pass to the bootstrap.