Record Class TeamsPacket.CreateTeamAction
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.server.play.TeamsPacket.CreateTeamAction
- All Implemented Interfaces:
ComponentHolder<TeamsPacket.CreateTeamAction>
,NetworkBuffer.Writer
,TeamsPacket.Action
- Enclosing class:
TeamsPacket
public static record TeamsPacket.CreateTeamAction(Component displayName, byte friendlyFlags, TeamsPacket.NameTagVisibility nameTagVisibility, TeamsPacket.CollisionRule collisionRule, NamedTextColor teamColor, Component teamPrefix, Component teamSuffix, Collection<String> entities)
extends Record
implements TeamsPacket.Action, ComponentHolder<TeamsPacket.CreateTeamAction>
-
Constructor Summary
ConstructorDescriptionCreateTeamAction
(Component displayName, byte friendlyFlags, TeamsPacket.NameTagVisibility nameTagVisibility, TeamsPacket.CollisionRule collisionRule, NamedTextColor teamColor, Component teamPrefix, Component teamSuffix, Collection<String> entities) Creates an instance of aCreateTeamAction
record class.CreateTeamAction
(@NotNull NetworkBuffer reader) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecollisionRule
record component.@NotNull Collection
<Component> Gets the components held by this object.@NotNull TeamsPacket.CreateTeamAction
copyWithOperator
(@NotNull UnaryOperator<Component> operator) Returns a copy of this object.Returns the value of thedisplayName
record component.entities()
Returns the value of theentities
record component.final boolean
Indicates whether some other object is "equal to" this one.byte
Returns the value of thefriendlyFlags
record component.final int
hashCode()
Returns a hash code value for this object.int
id()
Returns the value of thenameTagVisibility
record component.Returns the value of theteamColor
record component.Returns the value of theteamPrefix
record component.Returns the value of theteamSuffix
record component.final String
toString()
Returns a string representation of this record class.void
write
(@NotNull NetworkBuffer writer) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minestom.server.adventure.ComponentHolder
visitComponents
-
Constructor Details
-
CreateTeamAction
public CreateTeamAction(Component displayName, byte friendlyFlags, TeamsPacket.NameTagVisibility nameTagVisibility, TeamsPacket.CollisionRule collisionRule, NamedTextColor teamColor, Component teamPrefix, Component teamSuffix, Collection<String> entities) Creates an instance of aCreateTeamAction
record class.- Parameters:
displayName
- the value for thedisplayName
record componentfriendlyFlags
- the value for thefriendlyFlags
record componentnameTagVisibility
- the value for thenameTagVisibility
record componentcollisionRule
- the value for thecollisionRule
record componentteamColor
- the value for theteamColor
record componentteamPrefix
- the value for theteamPrefix
record componentteamSuffix
- the value for theteamSuffix
record componententities
- the value for theentities
record component
-
CreateTeamAction
-
-
Method Details
-
write
- Specified by:
write
in interfaceNetworkBuffer.Writer
-
id
public int id()- Specified by:
id
in interfaceTeamsPacket.Action
-
components
Description copied from interface:ComponentHolder
Gets the components held by this object.- Specified by:
components
in interfaceComponentHolder<TeamsPacket.CreateTeamAction>
- Returns:
- the components
-
copyWithOperator
@NotNull public @NotNull TeamsPacket.CreateTeamAction copyWithOperator(@NotNull @NotNull UnaryOperator<Component> operator) Description copied from interface:ComponentHolder
Returns a copy of this object. For each component this object holds, the operator is applied to the copy before returning.- Specified by:
copyWithOperator
in interfaceComponentHolder<TeamsPacket.CreateTeamAction>
- Parameters:
operator
- the operator- Returns:
- the copy
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
displayName
Returns the value of thedisplayName
record component.- Returns:
- the value of the
displayName
record component
-
friendlyFlags
public byte friendlyFlags()Returns the value of thefriendlyFlags
record component.- Returns:
- the value of the
friendlyFlags
record component
-
nameTagVisibility
Returns the value of thenameTagVisibility
record component.- Returns:
- the value of the
nameTagVisibility
record component
-
collisionRule
Returns the value of thecollisionRule
record component.- Returns:
- the value of the
collisionRule
record component
-
teamColor
Returns the value of theteamColor
record component.- Returns:
- the value of the
teamColor
record component
-
teamPrefix
Returns the value of theteamPrefix
record component.- Returns:
- the value of the
teamPrefix
record component
-
teamSuffix
Returns the value of theteamSuffix
record component.- Returns:
- the value of the
teamSuffix
record component
-
entities
Returns the value of theentities
record component.- Returns:
- the value of the
entities
record component
-