Interface GliderService
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 TypeMethodDescriptionbooleandeploy(@NotNull org.bukkit.entity.Player player) Opens the player's glider where they are, as the dragon bus does.@NotNull Optional<GliderDefinition> The glider used by players who chose none.@NotNull Optional<GliderDefinition> The glider with this ID.@NotNull Optional<GliderDefinition> 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.@NotNull List<GliderDefinition> Every glider in the catalog, in the server's order.booleanWhether the glider catalog and previews are available on this server.booleanisGliding(@NotNull org.bukkit.entity.Player player) Whether the player is gliding.booleanShows a glider on the player's back where they stand, to them alone, for about five seconds, as the cosmetics menu does.booleanstop(@NotNull org.bukkit.entity.Player player) Ends the player's glide, or their preview, taking the glider off their back.voidstopPreview(@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
Every glider in the catalog, in the server's order. -
getGlider
The glider with this ID. -
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
GliderDeployEventlistener 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.
-