Class RexlCloudBridge

java.lang.Object
de.rexlcloud.bridge.RexlCloudBridge

public final class RexlCloudBridge extends Object
Connects a Minestom server that rexlCloud started from a "Custom jar" group to its wrapper. In the server's main:
var cloud = RexlCloudBridge.getInstance();
var server = MinecraftServer.init(cloud.getAuth());
// ... instances, events ...
cloud.initialize();
server.start("0.0.0.0", cloud.getPort());

Everything comes from the cloud.json the wrapper writes into the server's folder before each start. Outside the cloud (no cloud.json), isCloudServer() is false, getPort() returns 25565 and initialize() does nothing, so the same jar can be started locally for testing.

  • Method Details

    • isCloudServer

      public boolean isCloudServer()
      Whether the server was started by rexlCloud.
    • getServerName

      @Nullable public @Nullable String getServerName()
    • getServerKey

      @Nullable public @Nullable UUID getServerKey()
    • getPort

      public int getPort()
      The port the server has to listen on.
    • getTemplateVariant

      public String getTemplateVariant()
      Which template variant (e.g. map) the server got, "default" if its group has none.
    • isMaintenance

      public boolean isMaintenance()
    • getAuth

      public net.minestom.server.Auth getAuth()
      How players reach the server, matching the cloud's proxies: Velocity modern forwarding with the network's secret, BungeeCord forwarding, or offline mode outside the cloud. Pass it to MinecraftServer.init.
    • getWrapperPort

      public int getWrapperPort()
    • getWrapperToken

      public String getWrapperToken()
      The secret this run proves itself with to the wrapper.
    • initialize

      public void initialize()
      Connects to the wrapper and handles the cloud's player teleports. Call it once, after MinecraftServer.init. Without a cloud.json it does nothing.
    • setShutdownHook

      public void setShutdownHook(Runnable onShutdown)
      What happens when the cloud stops the server or the wrapper goes away. By default the server stops and the process exits.
    • shutdownServer

      public void shutdownServer()
    • getInstance

      public static RexlCloudBridge getInstance()
    • getRexlCloudApi

      public RexlCloudApi getRexlCloudApi()
    • setRexlCloudApi

      public void setRexlCloudApi(RexlCloudApi rexlCloudApi)
    • getBufferedPlayerTeleports

      public List<de.rexlcloud.core.network.packets.PlayerTeleportPacket> getBufferedPlayerTeleports()
      Teleports for players that are still joining, done once they are loaded.
    • getWrapperReconnect

      public de.rexlcloud.core.network.WrapperReconnect getWrapperReconnect()