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 TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<Advancement> static final com.mojang.serialization.Codec
<Optional<WithConditions<Advancement>>> The field for thecriteria
record component.private final Optional
<DisplayInfo> The field for thedisplay
record component.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.static final StreamCodec
<RegistryFriendlyByteBuf, Advancement> -
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.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.private static Advancement
read
(RegistryFriendlyByteBuf p_320555_) Returns the value of therequirements
record component.rewards()
Returns the value of therewards
record component.boolean
Returns the value of thesendsTelemetryEvent
record component.final String
toString()
Returns a string representation of this record class.private static com.mojang.serialization.DataResult
<Advancement> validate
(Advancement p_312433_) void
validate
(ProblemReporter p_311766_, HolderGetter.Provider p_335685_) private void
write
(RegistryFriendlyByteBuf p_320833_)
-
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. -
CRITERIA_CODEC
-
CODEC
-
STREAM_CODEC
-
CONDITIONAL_CODEC
public static final com.mojang.serialization.Codec<Optional<WithConditions<Advancement>>> CONDITIONAL_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
-
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 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
-