Package net.minecraft.advancements
Record Class Advancement
java.lang.Object
java.lang.Record
net.minecraft.advancements.Advancement
public record Advancement(Optional<ResourceLocation> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String,Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent, Optional<Component> name)
extends Record 
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier 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<ResourceLocation>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.
- 
Constructor SummaryConstructorsConstructorDescriptionAdvancement(Optional<ResourceLocation> p_300893_, Optional<DisplayInfo> p_301147_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_301002_, boolean p_286478_) Advancement(Optional<ResourceLocation> parent, Optional<DisplayInfo> display, AdvancementRewards rewards, Map<String, Criterion<?>> criteria, AdvancementRequirements requirements, boolean sendsTelemetryEvent, Optional<Component> name) Creates an instance of aAdvancementrecord class.
- 
Method SummaryModifier and TypeMethodDescriptioncriteria()Returns the value of thecriteriarecord component.private static ComponentdecorateName(DisplayInfo p_301019_) 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 p_300875_) parent()Returns the value of theparentrecord component.static Advancementread(FriendlyByteBuf p_301040_) 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 p_312433_) voidvalidate(ProblemReporter p_311766_, LootDataResolver p_311896_) voidwrite(FriendlyByteBuf p_301055_) 
- 
Field Details- 
parentThe field for theparentrecord component.
- 
displayThe field for thedisplayrecord component.
- 
rewardsThe field for therewardsrecord component.
- 
criteriaThe field for thecriteriarecord component.
- 
requirementsThe field for therequirementsrecord component.
- 
sendsTelemetryEventprivate final boolean sendsTelemetryEventThe field for thesendsTelemetryEventrecord component.
- 
nameThe field for thenamerecord component.
- 
CRITERIA_CODEC
- 
CODEC
- 
CONDITIONAL_CODECpublic static final com.mojang.serialization.Codec<Optional<WithConditions<Advancement>>> CONDITIONAL_CODEC
 
- 
- 
Constructor Details- 
Advancementpublic Advancement(Optional<ResourceLocation> p_300893_, Optional<DisplayInfo> p_301147_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_301002_, boolean p_286478_) 
- 
Advancementpublic Advancement(Optional<ResourceLocation> 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 the- parentrecord component
- display- the value for the- displayrecord component
- rewards- the value for the- rewardsrecord component
- criteria- the value for the- criteriarecord component
- requirements- the value for the- requirementsrecord component
- sendsTelemetryEvent- the value for the- sendsTelemetryEventrecord component
- name- the value for the- namerecord component
 
 
- 
- 
Method Details- 
validate
- 
decorateName
- 
name
- 
write
- 
read
- 
isRootpublic boolean isRoot()
- 
validate
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
parentReturns the value of theparentrecord component.- Returns:
- the value of the parentrecord component
 
- 
displayReturns the value of thedisplayrecord component.- Returns:
- the value of the displayrecord component
 
- 
rewardsReturns the value of therewardsrecord component.- Returns:
- the value of the rewardsrecord component
 
- 
criteriaReturns the value of thecriteriarecord component.- Returns:
- the value of the criteriarecord component
 
- 
requirementsReturns the value of therequirementsrecord component.- Returns:
- the value of the requirementsrecord component
 
- 
sendsTelemetryEventpublic boolean sendsTelemetryEvent()Returns the value of thesendsTelemetryEventrecord component.- Returns:
- the value of the sendsTelemetryEventrecord component
 
- 
nameReturns the value of thenamerecord component.- Returns:
- the value of the namerecord component
 
 
-