Interface ArenaSourceService


public interface ArenaSourceService
Registers source arenas installed by an external addon without a full Zentrix reload.
  • Method Details

    • registerSource

      @NotNull @NotNull CompletableFuture<ArenaSourceResult> registerSource(@NotNull @NotNull String sourceArenaName)
    • registerSource

      @NotNull default @NotNull CompletableFuture<ArenaSourceResult> registerSource(@NotNull @NotNull String sourceArenaName, @NotNull @NotNull String sourceWorldDirectoryName)
      Registers a source arena whose world folders live under a custom directory in the server root. Implementations that do not support custom source directories fall back to the default root-world lookup.
    • unregisterSource

      @NotNull @NotNull CompletableFuture<ArenaSourceResult> unregisterSource(@NotNull @NotNull String sourceArenaName)
    • isSourceRegistered

      @NotNull @NotNull CompletableFuture<Boolean> isSourceRegistered(@NotNull @NotNull String sourceArenaName)
    • isSourceBusy

      @NotNull default @NotNull CompletableFuture<Boolean> isSourceBusy(@NotNull @NotNull String sourceArenaName)
      Returns whether Zentrix still needs this source.

      True while a runtime copy is being created from it, and while a published custom game holds it for a match that has not started yet. A provider must not reclaim, unregister or delete a busy source.

    • registerProvider

      default boolean registerProvider(@NotNull org.bukkit.plugin.Plugin owner, @Nullable @Nullable ArenaSourceProvider provider)
      Installs the provider Zentrix asks when it needs a source arena it cannot pick itself.

      Replaces any provider registered before, so an addon that registers on enable and unregisters on disable never leaves a stale one behind. Zentrix drops the provider automatically when its owning plugin is disabled.

      Parameters:
      owner - the plugin that owns the provider
      provider - the provider, or null to remove the one owner registered
      Returns:
      false when the request was rejected, which older Zentrix versions always do
      Since:
      1.6.0
    • hasProvider

      default boolean hasProvider()
      Whether a source provider is installed, and therefore whether Zentrix may ask for a source instead of picking one this server configured itself.
      Since:
      1.6.0
    • requestSource

      @NotNull default @NotNull CompletableFuture<Optional<ArenaSourceLease>> requestSource(@NotNull @NotNull ArenaSourceRequest request)
      Asks the installed provider for a source arena.

      Completes with an empty result when no provider is installed or the provider has nothing to give. A provider may complete the future later than it answers; callers that keep a player waiting on it should apply their own deadline.

      Safe to call from any thread: the provider itself is always asked on the main thread, as ArenaSourceProvider promises it. The returned future is completed on whichever thread the provider completes its own, so a caller that touches the Bukkit API in a continuation still has to get itself back onto the main thread.

      Since:
      1.6.0
    • unsupported

      static ArenaSourceService unsupported()