Klasse SpectateManager
java.lang.Object
de.delinkedde.mobarenareborn.session.SpectateManager
Lets outside players watch a running round from the spectator warp.
Spectating is deliberately lightweight: the watcher keeps their inventory and is only switched to spectator mode and teleported. Their previous position, game mode and flight state are held in memory and restored when they stop watching, when they disconnect, or when the watched round ends. Watchers are not session participants: they earn nothing, cannot be targeted and do not count towards the wave scaling.
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic enumThe outcome of aspectate(Player, Arena)attempt. -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanisSpectating(@NotNull Player player) @NotNull SpectateManager.SpectateResultPuts a player into watch mode for an arena's running round.booleanStops a player from watching and restores their previous state.voidstopAllFor(@NotNull String arenaName) Returns every watcher of the given arena to their previous state.
-
Konstruktordetails
-
SpectateManager
- Parameter:
sessions- the session manager, used to check for running rounds
-
-
Methodendetails
-
spectate
@NotNull public @NotNull SpectateManager.SpectateResult spectate(@NotNull @NotNull Player player, @NotNull @NotNull Arena arena) Puts a player into watch mode for an arena's running round.- Parameter:
player- the watcherarena- the arena to watch- Gibt zurück:
- the outcome
-
stop
Stops a player from watching and restores their previous state.- Parameter:
player- the watcher- Gibt zurück:
trueif the player was watching
-
isSpectating
- Parameter:
player- the player- Gibt zurück:
- whether the player is currently watching a round
-
stopAllFor
Returns every watcher of the given arena to their previous state. Called when the watched round ends.- Parameter:
arenaName- the arena identifier
-