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 ObjectiveCriteriaThe field for thecriteriarecord component.private final booleanThe field for thedisplayAutoUpdaterecord component.private final ComponentThe field for thedisplayNamerecord component.private final StringThe field for thenamerecord component.private final Optional<NumberFormat> The field for thenumberFormatrecord component.private final ObjectiveCriteria.RenderTypeThe field for therenderTyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPacked(String name, ObjectiveCriteria criteria, Component displayName, ObjectiveCriteria.RenderType renderType, boolean displayAutoUpdate, Optional<NumberFormat> numberFormat) Creates an instance of aPackedrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncriteria()Returns the value of thecriteriarecord component.booleanReturns the value of thedisplayAutoUpdaterecord component.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.name()Returns the value of thenamerecord component.Returns the value of thenumberFormatrecord component.Returns the value of therenderTyperecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
name
The field for thenamerecord component. -
criteria
The field for thecriteriarecord component. -
displayName
The field for thedisplayNamerecord component. -
renderType
The field for therenderTyperecord component. -
displayAutoUpdate
private final boolean displayAutoUpdateThe field for thedisplayAutoUpdaterecord component. -
numberFormat
The field for thenumberFormatrecord 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 aPackedrecord class.- Parameters:
name- the value for thenamerecord componentcriteria- the value for thecriteriarecord componentdisplayName- the value for thedisplayNamerecord componentrenderType- the value for therenderTyperecord componentdisplayAutoUpdate- the value for thedisplayAutoUpdaterecord componentnumberFormat- the value for thenumberFormatrecord 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
criteria
Returns the value of thecriteriarecord component.- Returns:
- the value of the
criteriarecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
renderType
Returns the value of therenderTyperecord component.- Returns:
- the value of the
renderTyperecord component
-
displayAutoUpdate
public boolean displayAutoUpdate()Returns the value of thedisplayAutoUpdaterecord component.- Returns:
- the value of the
displayAutoUpdaterecord component
-
numberFormat
Returns the value of thenumberFormatrecord component.- Returns:
- the value of the
numberFormatrecord component
-