public interface SpectateManager
Modifier and Type | Interface and Description |
---|---|
static class |
SpectateManager.Result |
Modifier and Type | Method and Description |
---|---|
Spectator |
get(org.bukkit.entity.Player player)
Attempts to find a
Spectator instance associated to the player given. |
java.util.List<Spectator> |
getSpectators(Arena arena)
|
boolean |
isSpectating(org.bukkit.entity.Player player)
Checks if a player is spectating a match.
|
SpectateManager.Result |
startSpectating(org.bukkit.entity.Player player,
org.bukkit.entity.Player target)
Attempts to put the player in spectator mode and teleports player to target player in match.
|
void |
stopSpectating(org.bukkit.entity.Player player)
Puts a player out of spectator mode.
|
@Nullable Spectator get(@NotNull org.bukkit.entity.Player player)
Spectator
instance associated to the player given.player
- Player to search through the spectator cache. Should not be null!Spectator
instance associated to player if exists or null otherwise.boolean isSpectating(@NotNull org.bukkit.entity.Player player)
player
- Player to check if spectating. Should not be null!@NotNull SpectateManager.Result startSpectating(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.entity.Player target)
SpectateStartEvent
is cancelled
Note: Calls SpectateStartEvent
before player is turned into spectator mode.player
- Player to put in spectator mode. Should not be null!target
- Target player to teleport to. Should not be null!SpectateManager.Result
instance indicating the outcome of this call.void stopSpectating(@NotNull org.bukkit.entity.Player player)
SpectateEndEvent
after player stops spectating.player
- Player to stop spectating. Should not be null!