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 TypeFieldDescriptionThe field for thecriteriarecord component.private final Optional<DisplayInfo>The field for thedisplayrecord component.private static final com.mojang.serialization.Codec<Unit>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 Summary
ConstructorsConstructorDescriptionAdvancement(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 Summary
Modifier 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.static AdvancementfromJson(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_) Deprecated.Forge: use overload with context.static AdvancementfromJson(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_, com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> jsonElementOps) 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.com.google.gson.JsonObjectfinal StringtoString()Returns a string representation of this record class.voidwrite(FriendlyByteBuf p_301055_)
-
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. -
DUMMY_CODEC
-
-
Constructor Details
-
Advancement
public Advancement(Optional<ResourceLocation> p_300893_, Optional<DisplayInfo> p_301147_, AdvancementRewards p_286389_, Map<String, Criterion<?>> p_286635_, AdvancementRequirements p_301002_, 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
-
decorateName
-
name
-
serializeToJson
public com.google.gson.JsonObject serializeToJson() -
fromJson
@Deprecated @Nullable public static Advancement fromJson(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_) Deprecated.Forge: use overload with context. -
fromJson
@Nullable public static Advancement fromJson(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_, com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> jsonElementOps) -
write
-
read
-
isRoot
public boolean isRoot() -
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
-