Enum Team

java.lang.Object
java.lang.Enum<Team>
de.marcely.bedwars.api.arena.Team
All Implemented Interfaces:
Serializable, Comparable<Team>, java.lang.constant.Constable

public enum Team extends Enum<Team>
A list of all possible colors that exist in the game
  • Enum Constant Details

    • YELLOW

      public static final Team YELLOW
    • ORANGE

      public static final Team ORANGE
    • RED

      public static final Team RED
    • BLUE

      public static final Team BLUE
    • LIGHT_BLUE

      public static final Team LIGHT_BLUE
    • CYAN

      public static final Team CYAN
    • LIGHT_GREEN

      public static final Team LIGHT_GREEN
    • GREEN

      public static final Team GREEN
    • PURPLE

      public static final Team PURPLE
    • PINK

      public static final Team PINK
    • WHITE

      public static final Team WHITE
    • LIGHT_GRAY

      public static final Team LIGHT_GRAY
    • GRAY

      public static final Team GRAY
    • BROWN

      public static final Team BROWN
    • BLACK

      public static final Team BLACK
  • Field Details

    • VALUES

      public static Team[] VALUES
      A list of all possible colors that exist in the game.

      Same thing as values() but as a constant. Exists as creating a new copy each time is slow. Try to avoid changing its values!! This WILL cause problems. If you are insecure about it, use values() instead.

  • Method Details

    • values

      public static Team[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static Team valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getBungeeChatColor

      public net.md_5.bungee.api.ChatColor getBungeeChatColor()
      Returns the corresponding ChatColor to this team.
      Returns:
      The ChatColor of the team
    • setBungeeChatColor

      public void setBungeeChatColor(net.md_5.bungee.api.ChatColor chatColor)
      Set the corresponding ChatColor of this team.

      This change is not persistent and will change back after a restart.

      Parameters:
      chatColor - The new color
    • getDyeColor

      public DyeColor getDyeColor()
      Returns the corresponding DyeColor to this team.
      Returns:
      The DyeColor of the team
    • setDyeColor

      public void setDyeColor(DyeColor dyeColor)
      Set the corresponding DyeColor of this team.

      This change is not persistent and will change back after a restart.

      Parameters:
      dyeColor - The new color
    • getBukkitColor

      public Color getBukkitColor()
      Returns the corresponding Color to this team.
      Returns:
      The color of the team
    • setBukkitColor

      public void setBukkitColor(Color color)
      Set the corresponding Color of this team.

      This change is not persistent and will change back after a restart.

      Parameters:
      color - The new color
    • getInitials

      public String getInitials()
      Returns the initials of the team that shall be shown to players.

      In case none has been enforced using setEnforcedInitials(String), it will return the default initials. Default initials are automatically generated based on the team's name. Examples of auto generation:
      When RED: R
      When LIGHT_BLUE: LB
      When CYAN: C

      Returns:
      The initials of the team
    • setEnforcedInitials

      public void setEnforcedInitials(@Nullable @Nullable String initials)
      Set the initials of the team that shall be shown to players.

      In case a non-null value is given, the auto generation of initials will be disabled and getInitials() will return the given value.

      Parameters:
      initials - The new enforced initials. May be null to reset to auto generation
      See Also:
    • getEnforcedInitials

      @Nullable public @Nullable String getEnforcedInitials()
      Returns the enforced initials of the team that shall be shown to players.

      In case none has been enforced using setEnforcedInitials(String), it will return null.

      Returns:
      The enforced initials of the team. May be null
      See Also:
    • getDisplayName

      public String getDisplayName()
      Get the name of the team in the default language.
      Returns:
      The configured name of the team in the default language
    • getDisplayName

      public String getDisplayName(@Nullable @Nullable CommandSender sender)
      Get the name of the team in the language of the CommandSender.
      Parameters:
      sender - The person from which it should look up the language. null if it should take the default language
      Returns:
      The configured name of the team in the language of the CommandSender
    • getNameAsMessage

      public Message getNameAsMessage()
      Get the original Message instance that is used for the name of the team.
      Returns:
      The Message instance fed with the message entry from the messages files
    • setConfigName

      public void setConfigName(String configName)
      Set the formatted name of the team as it is present in the configs.
      Parameters:
      configName - The new raw name
    • getConfigName

      public String getConfigName()
      Get the formatted name of the team as it is present in the configs.
      Returns:
      The raw name
    • newItemInstance

      public ItemStack newItemInstance()
      Constructs a new item that's being used for placing the bed during the set-up.

      Uses the configured language for the name of the item.

      Returns:
      The item that's being used for set-up
    • newItemInstance

      public ItemStack newItemInstance(@Nullable @Nullable CommandSender sender)
      Constructs a new item that's being used for placing the bed during the set-up.

      The name of the item is being translated into the language of the given sender. Passing null causes it to use the default configured language instead.

      Parameters:
      sender - Will name the item in the langauge of him
      Returns:
      The item that's being used for set-up
    • getByName

      @Nullable public static @Nullable Team getByName(String name)
      Looks through all teams and checks which team fits the best to the given name.

      Ignores upper- and undercase, and some other things for better results.

      Parameters:
      name - The name of the team it should look up for
      Returns:
      The team that fits the best to the name. Returns null if it hasn't found any