Record Class Advancement
java.lang.Object
java.lang.Record
net.minecraft.advancements.Advancement
public record Advancement(Optional<Identifier> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent, Optional<Component> name)
extends Record
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Advancement> static final com.mojang.serialization.Codec<Optional<WithConditions<Advancement>>> The field for thecriteriarecord component.private final Optional<DisplayInfo> The field for thedisplayrecord component.The field for thenamerecord component.private final Optional<Identifier> The field for theparentrecord component.private final AdvancementRequirementsThe field for therequirementsrecord component.private final AdvancementRewardsThe field for therewardsrecord component.private final booleanThe field for thesendsTelemetryEventrecord component.static final StreamCodec<RegistryFriendlyByteBuf, Advancement> -
Constructor Summary
ConstructorsConstructorDescriptionAdvancement(Optional<Identifier> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent) Advancement(Optional<Identifier> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent, Optional<Component> name) Creates an instance of aAdvancementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncriteria()Returns the value of thecriteriarecord component.private static ComponentdecorateName(DisplayInfo display) display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisRoot()name()Returns the value of thenamerecord component.static Componentname(AdvancementHolder holder) parent()Returns the value of theparentrecord component.private static Advancementread(RegistryFriendlyByteBuf input) Returns the value of therequirementsrecord component.rewards()Returns the value of therewardsrecord component.booleanReturns the value of thesendsTelemetryEventrecord component.final StringtoString()Returns a string representation of this record class.private static com.mojang.serialization.DataResult<Advancement> validate(Advancement advancement) voidvalidate(ProblemReporter reporter, HolderGetter.Provider lootData) private voidwrite(RegistryFriendlyByteBuf output)
-
Field Details
-
parent
The field for theparentrecord component. -
display
The field for thedisplayrecord component. -
rewards
The field for therewardsrecord component. -
criteria
-
requirements
The field for therequirementsrecord component. -
sendsTelemetryEvent
private final boolean sendsTelemetryEventThe field for thesendsTelemetryEventrecord component. -
name
-
CRITERIA_CODEC
-
CODEC
-
STREAM_CODEC
-
CONDITIONAL_CODEC
public static final com.mojang.serialization.Codec<Optional<WithConditions<Advancement>>> CONDITIONAL_CODEC
-
-
Constructor Details
-
Advancement
public Advancement(Optional<Identifier> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent) -
Advancement
public Advancement(Optional<Identifier> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent, Optional<Component> name) Creates an instance of aAdvancementrecord class.- Parameters:
parent- the value for theparentrecord componentdisplay- the value for thedisplayrecord componentrewards- the value for therewardsrecord componentcriteria- the value for thecriteriarecord componentrequirements- the value for therequirementsrecord componentsendsTelemetryEvent- the value for thesendsTelemetryEventrecord componentname- the value for thenamerecord component
-
-
Method Details
-
validate
-
decorateName
-
name
-
write
-
read
-
isRoot
public boolean isRoot() -
validate
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
parent
Returns the value of theparentrecord component.- Returns:
- the value of the
parentrecord component
-
display
Returns the value of thedisplayrecord component.- Returns:
- the value of the
displayrecord component
-
rewards
Returns the value of therewardsrecord component.- Returns:
- the value of the
rewardsrecord component
-
criteria
-
requirements
Returns the value of therequirementsrecord component.- Returns:
- the value of the
requirementsrecord component
-
sendsTelemetryEvent
public boolean sendsTelemetryEvent()Returns the value of thesendsTelemetryEventrecord component.- Returns:
- the value of the
sendsTelemetryEventrecord component
-
name
-