Interface EndService


public interface EndService
Per-game End status and access control. Status queries read Bukkit world state and should run on the main thread. setAccess(dev.itsharshxd.zentrix.api.game.ZentrixGame, dev.itsharshxd.zentrix.api.end.EndToggleRequest) is safe to call from any thread and completes after the request is applied or queued.
Since:
1.6.0
  • Method Details

    • getStatus

      @NotNull @NotNull EndStatus getStatus(@NotNull @NotNull ZentrixGame game)
    • getWorld

      @NotNull @NotNull Optional<org.bukkit.World> getWorld(@NotNull @NotNull ZentrixGame game)
    • getWorldName

      @NotNull @NotNull Optional<String> getWorldName(@NotNull @NotNull ZentrixGame game)
    • isConfigured

      default boolean isConfigured(@NotNull @NotNull ZentrixGame game)
    • isPreparing

      default boolean isPreparing(@NotNull @NotNull ZentrixGame game)
    • isPrepared

      default boolean isPrepared(@NotNull @NotNull ZentrixGame game)
    • isAccessEnabled

      default boolean isAccessEnabled(@NotNull @NotNull ZentrixGame game)
    • setAccess

      @NotNull @NotNull CompletableFuture<EndToggleResult> setAccess(@NotNull @NotNull ZentrixGame game, @NotNull @NotNull EndToggleRequest request)
    • getDragon

      @NotNull @NotNull Optional<org.bukkit.entity.EnderDragon> getDragon(@NotNull @NotNull ZentrixGame game)
      The Ender Dragon of this match's runtime End, and only that one.

      Resolved through the End's own dragon fight, so a dragon that merely happens to be flying in the world — a transport dragon, one another plugin spawned, one belonging to a different match — is never returned. That makes this the check an objective built on the dragon needs.

      Empty when the match has no End, when the copy is not prepared yet, or when the dragon is dead or not currently loaded.

      Since:
      1.6.0
    • isLockedDown

      boolean isLockedDown(@NotNull @NotNull ZentrixGame game)
      Whether this match's runtime End is sealed.
      Since:
      1.6.0
    • setLockedDown

      boolean setLockedDown(@NotNull @NotNull ZentrixGame game, boolean locked)
      Seals or unseals this match's runtime End.

      A sealed End refuses new arrivals the way closed access does, and additionally keeps the players already inside from leaving: the exit portal puts them back on the island instead of returning them to the arena, and a portal out is refused. Gateways keep working, because they never leave the End in the first place.

      This is what a scenario that moves the final fight into the End needs, and it is undone automatically when the match is cleaned up.

      Returns:
      true when the match has a runtime End the flag could be applied to
      Since:
      1.6.0