Interface Spectator
public interface Spectator
Represents a spectating player and contains the info about him
-
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Returns the arena which the player is spectating.Returns the time when he got a spectator.Returns the player behind this data.Returns the reason or the cause of him being a spectator.@Nullable Instant
Returns the time when he is supposed to be released from enforced spectating.boolean
Returns if this Spectator instance is still present.default boolean
kick()
Same askick(KickSpectatorReason)
.boolean
kick
(KickSpectatorReason reason) Stops the player from spectating any further.
-
Method Details
-
getPlayer
Player getPlayer()Returns the player behind this data.- Returns:
- Bukkit's player
-
getArena
Arena getArena()Returns the arena which the player is spectating.- Returns:
- The arena he's spectating
-
getReason
SpectateReason getReason()Returns the reason or the cause of him being a spectator.- Returns:
- The reason he's spectating
-
getEnterTime
Instant getEnterTime()Returns the time when he got a spectator.- Returns:
- The time he started to spectate
-
getReleaseTime
Returns the time when he is supposed to be released from enforced spectating.This is used for death spectating (
getReason()
equalsSpectateReason.DEATH
).- Returns:
- The time he's supposed to be released.
null
if he's not supposed to be released automatically
-
isPresent
boolean isPresent()Returns if this Spectator instance is still present.This method will always return false after he stopped being a spectator.
- Returns:
true
if he hasn't stopped being a spectator yet
-
kick
default boolean kick()Same askick(KickSpectatorReason)
. Only usesKickSpectatorReason.PLUGIN
as the reason.- Returns:
true
if it was successful
-
kick
Stops the player from spectating any further.Additional things might happen depending on the reason given.
- Parameters:
reason
- Reason why he shall get kicked- Returns:
true
if it was successful
-