Interface GliderService


public interface GliderService
Zentrix's built-in gliders: the catalog players choose from, the glides in progress and the previews shown in the cosmetics menu.

Players glide into the map from the dragon bus or a sky drop. While gliding they wear their glider - the one they chose and still own, or the server's default - on their back and drift forward under Slow Falling until they land. Which gliders a player owns is managed by CosmeticsService.

The glider catalog is not part of the Free edition: there isCatalogAvailable() is false, the catalog is empty, and deploy(org.bukkit.entity.Player) and preview(org.bukkit.entity.Player, java.lang.String) fail, while isGliding(org.bukkit.entity.Player) and stop(org.bukkit.entity.Player) still cover the glides Zentrix starts itself. Every method that changes something must be called on the main thread.

Since:
1.8.0
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    deploy(@NotNull org.bukkit.entity.Player player)
    Opens the player's glider where they are, as the dragon bus does.
    The glider used by players who chose none.
    getGlider(@NotNull String id)
    The glider with this ID.
    getGliderFor(@NotNull org.bukkit.entity.Player player)
    The glider a player would fly with now: the one they chose and still own, or the default.
    Every glider in the catalog, in the server's order.
    boolean
    Whether the glider catalog and previews are available on this server.
    boolean
    isGliding(@NotNull org.bukkit.entity.Player player)
    Whether the player is gliding.
    boolean
    preview(@NotNull org.bukkit.entity.Player player, @NotNull String gliderId)
    Shows a glider on the player's back where they stand, to them alone, for about five seconds, as the cosmetics menu does.
    boolean
    stop(@NotNull org.bukkit.entity.Player player)
    Ends the player's glide, or their preview, taking the glider off their back.
    void
    stopPreview(@NotNull org.bukkit.entity.Player player)
    Ends the player's preview, if one shows.
  • Method Details

    • isCatalogAvailable

      boolean isCatalogAvailable()
      Whether the glider catalog and previews are available on this server.
    • getGliders

      @NotNull @NotNull List<GliderDefinition> getGliders()
      Every glider in the catalog, in the server's order.
    • getGlider

      @NotNull @NotNull Optional<GliderDefinition> getGlider(@NotNull @NotNull String id)
      The glider with this ID.
    • getDefaultGlider

      @NotNull @NotNull Optional<GliderDefinition> getDefaultGlider()
      The glider used by players who chose none.
    • getGliderFor

      @NotNull @NotNull Optional<GliderDefinition> getGliderFor(@NotNull @NotNull org.bukkit.entity.Player player)
      The glider a player would fly with now: the one they chose and still own, or the default.
    • isGliding

      boolean isGliding(@NotNull @NotNull org.bukkit.entity.Player player)
      Whether the player is gliding.
    • deploy

      boolean deploy(@NotNull @NotNull org.bukkit.entity.Player player)
      Opens the player's glider where they are, as the dragon bus does.

      Spectators, dead players and players in spectator mode cannot glide. A GliderDeployEvent listener may refuse.

      Returns:
      whether the player glides now
    • stop

      boolean stop(@NotNull @NotNull org.bukkit.entity.Player player)
      Ends the player's glide, or their preview, taking the glider off their back.
      Returns:
      whether they were gliding
    • preview

      boolean preview(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String gliderId)
      Shows a glider on the player's back where they stand, to them alone, for about five seconds, as the cosmetics menu does. Moving away, teleporting or starting to glide ends it early.
      Returns:
      whether the preview shows
    • stopPreview

      void stopPreview(@NotNull @NotNull org.bukkit.entity.Player player)
      Ends the player's preview, if one shows.