Package org.spongepowered.api.scoreboard
Interface Team.Builder
-
- All Superinterfaces:
AbstractBuilder<Team>,Buildable.Builder<Team>,Builder<Team,Team.Builder>,CopyableBuilder<Team,Team.Builder>,ResettableBuilder<Team,Team.Builder>
- Enclosing interface:
- Team
public static interface Team.Builder extends Builder<Team,Team.Builder>, CopyableBuilder<Team,Team.Builder>
Represents a builder tp createTeaminstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Team.BuilderallowFriendlyFire(boolean enabled)Sets whether friendly fire is enabled for theTeam.Teambuild()Builds an instance of aTeam.Team.BuildercanSeeFriendlyInvisibles(boolean enabled)Sets whether invisible team members are shown for theTeam.default Team.BuildercollisionRule(java.util.function.Supplier<? extends CollisionRule> rule)Sets theCollisionRulefor this team's members.Team.BuildercollisionRule(CollisionRule rule)Sets theCollisionRulefor this team's members.Team.Buildercolor(NamedTextColor color)Sets the color of theTeam.default Team.BuilderdeathTextVisibility(java.util.function.Supplier<? extends Visibility> visibility)Sets theVisibilitywhich controls who death Texts of players on theTeamare visible to.Team.BuilderdeathTextVisibility(Visibility visibility)Sets theVisibilitywhich controls who death Texts of players on theTeamare visible to.Team.BuilderdisplayName(Component displayName)Sets the name displayed to users for theTeam.Team.Buildermembers(java.util.Set<Component> users)Team.Buildername(java.lang.String name)Sets the name of theTeam.default Team.BuildernameTagVisibility(java.util.function.Supplier<? extends Visibility> visibility)Sets theVisibilitywhich controls to who nametags of players on theTeamare visible to.Team.BuildernameTagVisibility(Visibility visibility)Sets theVisibilitywhich controls to who nametags of players on theTeamare visible to.Team.Builderprefix(Component prefix)Sets the prefix prepended to the display name of users on theTeam.Team.Buildersuffix(Component suffix)Sets the suffix appended to the display name of users on theTeam.-
Methods inherited from interface org.spongepowered.api.util.CopyableBuilder
from
-
-
-
-
Method Detail
-
name
Team.Builder name(java.lang.String name)
Sets the name of theTeam.- Parameters:
name- The name to set- Returns:
- This builder
-
color
Team.Builder color(NamedTextColor color)
Sets the color of theTeam.The team's color is a distinct concept from its prefix or suffix. It is only used for colored sidebar display slots, and certain statistic criteria.
- Parameters:
color- The color to set- Returns:
- This builder
-
displayName
Team.Builder displayName(Component displayName) throws java.lang.IllegalArgumentException
Sets the name displayed to users for theTeam.Display names may be truncated in order to meet an implementation-defined length limit. In Vanilla, this is sixteen characters.
By default, this is set to
name(String)- Parameters:
displayName- TheComponentto set- Returns:
- This builder
- Throws:
java.lang.IllegalArgumentException
-
prefix
Team.Builder prefix(Component prefix)
Sets the prefix prepended to the display name of users on theTeam.Display names may be truncated in order to meet an implementation-defined length limit. In Vanilla, this is sixteen characters.
- Parameters:
prefix- The new prefix for theTeam- Returns:
- This builder
-
suffix
Team.Builder suffix(Component suffix)
Sets the suffix appended to the display name of users on theTeam.Display names may be truncated in order to meet an implementation-defined length limit. In Vanilla, this is sixteen characters.
- Parameters:
suffix- The new suffix for theTeam.- Returns:
- This builder
-
allowFriendlyFire
Team.Builder allowFriendlyFire(boolean enabled)
Sets whether friendly fire is enabled for theTeam.- Parameters:
enabled- Whether friendly fire is enabled- Returns:
- This builder
-
canSeeFriendlyInvisibles
Team.Builder canSeeFriendlyInvisibles(boolean enabled)
Sets whether invisible team members are shown for theTeam.- Parameters:
enabled- Whether to show invisible teammates- Returns:
- This builder
-
nameTagVisibility
default Team.Builder nameTagVisibility(java.util.function.Supplier<? extends Visibility> visibility)
Sets theVisibilitywhich controls to who nametags of players on theTeamare visible to.- Parameters:
visibility- TheVisibilityfor theTeam's nametags- Returns:
- This builder
-
nameTagVisibility
Team.Builder nameTagVisibility(Visibility visibility)
Sets theVisibilitywhich controls to who nametags of players on theTeamare visible to.- Parameters:
visibility- TheVisibilityfor theTeam's nametags- Returns:
- This builder
-
deathTextVisibility
default Team.Builder deathTextVisibility(java.util.function.Supplier<? extends Visibility> visibility)
Sets theVisibilitywhich controls who death Texts of players on theTeamare visible to.- Parameters:
visibility- TheVisibilityfor theTeam's death Texts- Returns:
- This builder
-
deathTextVisibility
Team.Builder deathTextVisibility(Visibility visibility)
Sets theVisibilitywhich controls who death Texts of players on theTeamare visible to.- Parameters:
visibility- TheVisibilityfor theTeam's death Texts- Returns:
- This builder
-
collisionRule
default Team.Builder collisionRule(java.util.function.Supplier<? extends CollisionRule> rule)
Sets theCollisionRulefor this team's members.- Parameters:
rule- TheCollisionRulefor theTeam's members- Returns:
- This builder
-
collisionRule
Team.Builder collisionRule(CollisionRule rule)
Sets theCollisionRulefor this team's members.- Parameters:
rule- TheCollisionRulefor theTeam's members- Returns:
- This builder
-
members
Team.Builder members(java.util.Set<Component> users)
-
build
Team build() throws java.lang.IllegalStateException
Builds an instance of aTeam.- Specified by:
buildin interfaceAbstractBuilder<Team>- Specified by:
buildin interfaceBuildable.Builder<Team>- Returns:
- A new instance of a
Team - Throws:
java.lang.IllegalStateException- if theTeamis not complete
-
-