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 Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<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.static final StreamCodec<RegistryFriendlyByteBuf, Advancement> -
Constructor Summary
ConstructorsConstructorDescriptionAdvancement(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 Summary
Modifier 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.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.private static Advancementread(RegistryFriendlyByteBuf p_328348_) 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_312373_) voidvalidate(ProblemReporter p_310503_, HolderGetter.Provider p_335087_) private voidwrite(RegistryFriendlyByteBuf p_328062_)
-
Field Details
-
parent
The field for theparentrecord component. -
display
The field for thedisplayrecord component. -
rewards
The field for therewardsrecord component. -
criteria
The field for thecriteriarecord component. -
requirements
The field for therequirementsrecord component. -
sendsTelemetryEvent
private final boolean sendsTelemetryEventThe field for thesendsTelemetryEventrecord component. -
name
The field for thenamerecord component. -
CRITERIA_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
Advancement
public Advancement(Optional<ResourceLocation> p_299284_, Optional<DisplayInfo> p_301017_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_300504_, boolean p_286478_) -
Advancement
public 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 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
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 '=='. -
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
Returns the value of thecriteriarecord component.- Returns:
- the value of the
criteriarecord component
-
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
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-