Package net.minecraft.world.scores
Record Class Objective.Packed
java.lang.Object
java.lang.Record
net.minecraft.world.scores.Objective.Packed
- Enclosing class:
Objective
public static record Objective.Packed(String name, ObjectiveCriteria criteria, Component displayName, ObjectiveCriteria.RenderType renderType, boolean displayAutoUpdate, Optional<NumberFormat> numberFormat)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Objective.Packed> private final ObjectiveCriteria
The field for thecriteria
record component.private final boolean
The field for thedisplayAutoUpdate
record component.private final Component
The field for thedisplayName
record component.private final String
The field for thename
record component.private final Optional
<NumberFormat> The field for thenumberFormat
record component.private final ObjectiveCriteria.RenderType
The field for therenderType
record component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked
(String name, ObjectiveCriteria criteria, Component displayName, ObjectiveCriteria.RenderType renderType, boolean displayAutoUpdate, Optional<NumberFormat> numberFormat) Creates an instance of aPacked
record class. -
Method Summary
Modifier and TypeMethodDescriptioncriteria()
Returns the value of thecriteria
record component.boolean
Returns the value of thedisplayAutoUpdate
record component.Returns the value of thedisplayName
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.name()
Returns the value of thename
record component.Returns the value of thenumberFormat
record component.Returns the value of therenderType
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
name
The field for thename
record component. -
criteria
The field for thecriteria
record component. -
displayName
The field for thedisplayName
record component. -
renderType
The field for therenderType
record component. -
displayAutoUpdate
private final boolean displayAutoUpdateThe field for thedisplayAutoUpdate
record component. -
numberFormat
The field for thenumberFormat
record component. -
CODEC
-
-
Constructor Details
-
Packed
public Packed(String name, ObjectiveCriteria criteria, Component displayName, ObjectiveCriteria.RenderType renderType, boolean displayAutoUpdate, Optional<NumberFormat> numberFormat) Creates an instance of aPacked
record class.- Parameters:
name
- the value for thename
record componentcriteria
- the value for thecriteria
record componentdisplayName
- the value for thedisplayName
record componentrenderType
- the value for therenderType
record componentdisplayAutoUpdate
- the value for thedisplayAutoUpdate
record componentnumberFormat
- the value for thenumberFormat
record component
-
-
Method Details
-
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 '=='. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
criteria
Returns the value of thecriteria
record component.- Returns:
- the value of the
criteria
record component
-
displayName
Returns the value of thedisplayName
record component.- Returns:
- the value of the
displayName
record component
-
renderType
Returns the value of therenderType
record component.- Returns:
- the value of the
renderType
record component
-
displayAutoUpdate
public boolean displayAutoUpdate()Returns the value of thedisplayAutoUpdate
record component.- Returns:
- the value of the
displayAutoUpdate
record component
-
numberFormat
Returns the value of thenumberFormat
record component.- Returns:
- the value of the
numberFormat
record component
-