Class AddRemotePlayerInfo

java.lang.Object
de.marcely.bedwars.api.remote.AddRemotePlayerInfo
All Implemented Interfaces:
Cloneable

public class AddRemotePlayerInfo extends Object implements Cloneable
Contains all the info needed to add a remote player to an arena.
  • Constructor Details

    • AddRemotePlayerInfo

      public AddRemotePlayerInfo()
      Creates a new instance.
  • Method Details

    • addPlayer

      public AddRemotePlayerInfo addPlayer(RemotePlayer player)
      Add a player that shall be added to the arena.
      Parameters:
      player - The player who shall be added
      Returns:
      This instance
    • addPlayers

      public AddRemotePlayerInfo addPlayers(RemotePlayer... players)
      Add multiple players that shall be added to the arena.
      Parameters:
      players - The player who shall be added
      Returns:
      This instance
    • addPlayers

      public AddRemotePlayerInfo addPlayers(Collection<RemotePlayer> players)
      Add multiple players that shall be added to the arena.
      Parameters:
      players - The player who shall be added
      Returns:
      This instance
    • getPlayers

      public Collection<RemotePlayer> getPlayers()
      Returns all players that have been added so far.
      Returns:
      A (unmodifiable) list of all players that have been added
    • setTargetTeam

      public AddRemotePlayerInfo setTargetTeam(@Nullable @Nullable Team targetTeam)
      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 be null
      Returns:
      This instance
    • getTargetTeam

      @Nullable public @Nullable Team getTargetTeam()
      Returns the target team that has been specified using getTargetTeam().
      Returns:
      The target team. May be null
    • setAutoAssignTeam

      public AddRemotePlayerInfo setAutoAssignTeam(boolean autoAssign)
      Whether a team shall be automatically assigned. false by default.

      The difference to setTargetTeam(Team) with null 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 using setAutoAssignTeam(boolean).
      Returns:
      Either true or false
    • setAutoAssignTeamIncludePlayers

      public AddRemotePlayerInfo setAutoAssignTeamIncludePlayers(Collection<RemotePlayer> players)
      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

      public Collection<RemotePlayer> 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

      public AddRemotePlayerInfo setSpectatorFallback(boolean enableFallback)
      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 using setSpectatorFallback(boolean).
      Returns:
      Either true or false
    • setCause

      public AddRemotePlayerInfo setCause(AddPlayerCause cause)
      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

      public AddPlayerCause getCause()
      Returns the cause that made him join the arena- Defined using setCause(AddPlayerCause).
      Returns:
      The cause that made him join the arena
    • setForcefully

      public AddRemotePlayerInfo setForcefully(boolean force)
      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

      public AddRemotePlayerInfo clone()
      Overrides:
      clone in class Object