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
-
Field Summary
Modifier and TypeFieldDescriptionThe field for thecriteria
record component.private final Optional<DisplayInfo>
The field for thedisplay
record component.private static final com.mojang.serialization.Codec<Unit>
The field for thename
record component.private final Optional<ResourceLocation>
The field for theparent
record component.private final AdvancementRequirements
The field for therequirements
record component.private final AdvancementRewards
The field for therewards
record component.private final boolean
The field for thesendsTelemetryEvent
record component. -
Constructor Summary
ConstructorDescriptionAdvancement
(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 aAdvancement
record class. -
Method Summary
Modifier and TypeMethodDescriptioncriteria()
Returns the value of thecriteria
record component.private static Component
decorateName
(DisplayInfo p_301019_) display()
Returns the value of thedisplay
record component.final boolean
Indicates whether some other object is "equal to" this one.static Advancement
fromJson
(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_) Deprecated.Forge: use overload with context.static Advancement
fromJson
(com.google.gson.JsonObject p_301286_, DeserializationContext p_300878_, com.mojang.serialization.DynamicOps<com.google.gson.JsonElement> jsonElementOps) final int
hashCode()
Returns a hash code value for this object.boolean
isRoot()
name()
Returns the value of thename
record component.static Component
name
(AdvancementHolder p_300875_) parent()
Returns the value of theparent
record component.static Advancement
read
(FriendlyByteBuf p_301040_) Returns the value of therequirements
record component.rewards()
Returns the value of therewards
record component.boolean
Returns the value of thesendsTelemetryEvent
record component.com.google.gson.JsonObject
final String
toString()
Returns a string representation of this record class.void
write
(FriendlyByteBuf p_301055_)
-
Field Details
-
parent
The field for theparent
record component. -
display
The field for thedisplay
record component. -
rewards
The field for therewards
record component. -
criteria
The field for thecriteria
record component. -
requirements
The field for therequirements
record component. -
sendsTelemetryEvent
private final boolean sendsTelemetryEventThe field for thesendsTelemetryEvent
record component. -
name
The field for thename
record 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 aAdvancement
record class.- Parameters:
parent
- the value for theparent
record componentdisplay
- the value for thedisplay
record componentrewards
- the value for therewards
record componentcriteria
- the value for thecriteria
record componentrequirements
- the value for therequirements
record componentsendsTelemetryEvent
- the value for thesendsTelemetryEvent
record componentname
- the value for thename
record 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 theparent
record component.- Returns:
- the value of the
parent
record component
-
display
Returns the value of thedisplay
record component.- Returns:
- the value of the
display
record component
-
rewards
Returns the value of therewards
record component.- Returns:
- the value of the
rewards
record component
-
criteria
Returns the value of thecriteria
record component.- Returns:
- the value of the
criteria
record component
-
requirements
Returns the value of therequirements
record component.- Returns:
- the value of the
requirements
record component
-
sendsTelemetryEvent
public boolean sendsTelemetryEvent()Returns the value of thesendsTelemetryEvent
record component.- Returns:
- the value of the
sendsTelemetryEvent
record component
-
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-