Class AddRemotePlayerInfo
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddPlayer
(RemotePlayer player) Add a player that shall be added to the arena.addPlayers
(RemotePlayer... players) Add multiple players that shall be added to the arena.addPlayers
(Collection<RemotePlayer> players) Add multiple players that shall be added to the arena.clone()
All players that also are being concidered for the auto-team assignation.getCause()
Returns the cause that made him join the arena- Defined usingsetCause(AddPlayerCause)
.Returns all players that have been added so far.@Nullable Team
Returns the target team that has been specified usinggetTargetTeam()
.boolean
Whether auto-assign has been enabled usingsetAutoAssignTeam(boolean)
.boolean
Returns whether all players are being forcefully being removed from their existing arenas.boolean
Whether they shall fallback as spectators.setAutoAssignTeam
(boolean autoAssign) Whether a team shall be automatically assigned.Set all players that shall also be concidered for the auto-team assignation.setCause
(AddPlayerCause cause) Define the cause that made the player join the arena.setForcefully
(boolean force) Whether it should ignore that he's already playing within an arena.setSpectatorFallback
(boolean enableFallback) Define whether players shall fall back as spectators when the arena is running.setTargetTeam
(@Nullable Team targetTeam) Set the team which the player shall automatically enter when he joins the arena.
-
Constructor Details
-
AddRemotePlayerInfo
public AddRemotePlayerInfo()Creates a new instance.
-
-
Method Details
-
addPlayer
Add a player that shall be added to the arena.- Parameters:
player
- The player who shall be added- Returns:
- This instance
-
addPlayers
Add multiple players that shall be added to the arena.- Parameters:
players
- The player who shall be added- Returns:
- This instance
-
addPlayers
Add multiple players that shall be added to the arena.- Parameters:
players
- The player who shall be added- Returns:
- This instance
-
getPlayers
Returns all players that have been added so far.- Returns:
- A (unmodifiable) list of all players that have been added
-
setTargetTeam
Set the team which the player shall automatically enter when he joins the arena.null
by default.Setting it as
null
causes him to not join any arena automatically.- Parameters:
targetTeam
- His target team. May benull
- Returns:
- This instance
-
getTargetTeam
Returns the target team that has been specified usinggetTargetTeam()
.- Returns:
- The target team. May be
null
-
setAutoAssignTeam
Whether a team shall be automatically assigned.false
by default.The difference to
setTargetTeam(Team)
withnull
as a parameter, is that this method tries to add all given players into the same arena. This may not succed every time when a team is already fully occupied. In this case, the remaining players won't enter any team. The team is still going to be filled.- Parameters:
autoAssign
- Whether all players shall be assigned to the same team- Returns:
- This instance
-
isAutoAssignTeam
public boolean isAutoAssignTeam()Whether auto-assign has been enabled usingsetAutoAssignTeam(boolean)
.- Returns:
- Either true or false
-
setAutoAssignTeamIncludePlayers
Set all players that shall also be concidered for the auto-team assignation.The collection should only contain players that are already playing within the arena.
- Parameters:
players
- All players that shall also have their team changed to the same one- Returns:
- This instance
-
getAutoAssignTeamIncludePlayers
All players that also are being concidered for the auto-team assignation.The collection should only contain players that are already playing within the arena.
- Returns:
- All players that are also being concidered for the auto-team assignation
-
setSpectatorFallback
Define whether players shall fall back as spectators when the arena is running.false
by default.- Parameters:
enableFallback
- Whether they shall fall back as a spectator- Returns:
- This instance
-
isSpectatorFallbackActive
public boolean isSpectatorFallbackActive()Whether they shall fallback as spectators. Defined usingsetSpectatorFallback(boolean)
.- Returns:
- Either true or false
-
setCause
Define the cause that made the player join the arena.AddPlayerCause.PLUGIN
by default.- Parameters:
cause
- The cause that made him join the arena- Returns:
- This instance
-
getCause
Returns the cause that made him join the arena- Defined usingsetCause(AddPlayerCause)
.- Returns:
- The cause that made him join the arena
-
setForcefully
Whether it should ignore that he's already playing within an arena.They won't rejoin an arena in case they are already playing inside it.
- Parameters:
force
- Force him to leave his existing arena- Returns:
- This instance
-
isForcefully
public boolean isForcefully()Returns whether all players are being forcefully being removed from their existing arenas.They won't rejoin an arena in case they are already playing inside it.
- Returns:
- Whether they are being forced to join the given arena
-
clone
-