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 TypeFieldDescriptionThe 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_299284_, Optional<DisplayInfo> p_301017_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_300504_, 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_300038_) display()Returns the value of thedisplayrecord component.final booleanIndicates whether some other object is "equal to" this one.static AdvancementfromJson(com.google.gson.JsonObject p_300691_, DeserializationContext p_300053_) Deprecated.Forge: use overload with context.static AdvancementfromJson(com.google.gson.JsonObject p_300691_, DeserializationContext p_300053_, ICondition.IContext context) final inthashCode()Returns a hash code value for this object.booleanisRoot()name()Returns the value of thenamerecord component.static Componentname(AdvancementHolder p_297556_) parent()Returns the value of theparentrecord component.static Advancementread(FriendlyByteBuf p_300670_) Returns the value of therequirementsrecord component.rewards()Returns the value of therewardsrecord component.booleanReturns the value of thesendsTelemetryEventrecord component.com.google.gson.JsonObjectfinal StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_299393_) 
- 
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.
 
- 
- 
Constructor Details- 
Advancementpublic Advancement(Optional<ResourceLocation> p_299284_, Optional<DisplayInfo> p_301017_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_300504_, 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- 
decorateName
- 
name
- 
serializeToJsonpublic com.google.gson.JsonObject serializeToJson()
- 
fromJson@Deprecated public static Advancement fromJson(com.google.gson.JsonObject p_300691_, DeserializationContext p_300053_) Deprecated.Forge: use overload with context.
- 
fromJsonpublic static Advancement fromJson(com.google.gson.JsonObject p_300691_, DeserializationContext p_300053_, ICondition.IContext context) 
- 
write
- 
read
- 
isRootpublic boolean isRoot()
- 
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
 
 
-