Record Class ClientboundSetScorePacket
java.lang.Object
java.lang.Record
net.minecraft.network.protocol.game.ClientboundSetScorePacket
- All Implemented Interfaces:
Packet<ClientGamePacketListener>
public record ClientboundSetScorePacket(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat)
extends Record
implements Packet<ClientGamePacketListener>
-
Field Summary
Modifier and TypeFieldDescriptionThe field for thedisplay
record component.private final Optional
<NumberFormat> The field for thenumberFormat
record component.private final String
The field for theobjectiveName
record component.private final String
The field for theowner
record component.private final int
The field for thescore
record component.static final StreamCodec
<RegistryFriendlyByteBuf, ClientboundSetScorePacket> -
Constructor Summary
ConstructorDescriptionClientboundSetScorePacket
(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aClientboundSetScorePacket
record class. -
Method Summary
Modifier and TypeMethodDescriptiondisplay()
Returns the value of thedisplay
record component.final boolean
Indicates whether some other object is "equal to" this one.void
handle
(ClientGamePacketListener p_133338_) final int
hashCode()
Returns a hash code value for this object.Returns the value of thenumberFormat
record component.Returns the value of theobjectiveName
record component.owner()
Returns the value of theowner
record component.int
score()
Returns the value of thescore
record component.final String
toString()
Returns a string representation of this record class.type()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.network.protocol.Packet
isSkippable, isTerminal
-
Field Details
-
owner
The field for theowner
record component. -
objectiveName
The field for theobjectiveName
record component. -
score
private final int scoreThe field for thescore
record component. -
display
The field for thedisplay
record component. -
numberFormat
The field for thenumberFormat
record component. -
STREAM_CODEC
-
-
Constructor Details
-
ClientboundSetScorePacket
public ClientboundSetScorePacket(String owner, String objectiveName, int score, Optional<Component> display, Optional<NumberFormat> numberFormat) Creates an instance of aClientboundSetScorePacket
record class.- Parameters:
owner
- the value for theowner
record componentobjectiveName
- the value for theobjectiveName
record componentscore
- the value for thescore
record componentdisplay
- the value for thedisplay
record componentnumberFormat
- the value for thenumberFormat
record component
-
-
Method Details
-
type
- Specified by:
type
in interfacePacket<ClientGamePacketListener>
-
handle
- Specified by:
handle
in interfacePacket<ClientGamePacketListener>
-
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 '=='. -
owner
Returns the value of theowner
record component.- Returns:
- the value of the
owner
record component
-
objectiveName
Returns the value of theobjectiveName
record component.- Returns:
- the value of the
objectiveName
record component
-
score
public int score()Returns the value of thescore
record component.- Returns:
- the value of the
score
record component
-
display
Returns the value of thedisplay
record component.- Returns:
- the value of the
display
record component
-
numberFormat
Returns the value of thenumberFormat
record component.- Returns:
- the value of the
numberFormat
record component
-