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 InstantReturns the time when he is supposed to be released from enforced spectating.booleanReturns if this Spectator instance is still present.default booleankick()Same askick(KickSpectatorReason).booleankick(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.
nullif 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:
trueif he hasn't stopped being a spectator yet
-
kick
default boolean kick()Same askick(KickSpectatorReason). Only usesKickSpectatorReason.PLUGINas the reason.- Returns:
trueif 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:
trueif it was successful
-