Package tschipp.carryon.common.scripting
Record Class Matchables.AdvancementCondition
java.lang.Object
java.lang.Record
tschipp.carryon.common.scripting.Matchables.AdvancementCondition
- All Implemented Interfaces:
Matchables.Matchable<net.minecraft.server.level.ServerPlayer>
- Enclosing class:
Matchables
public static record Matchables.AdvancementCondition(String advancement)
extends Record
implements Matchables.Matchable<net.minecraft.server.level.ServerPlayer>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Matchables.AdvancementCondition> static final Matchables.AdvancementCondition -
Constructor Summary
ConstructorsConstructorDescriptionAdvancementCondition(String advancement) Creates an instance of aAdvancementConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadvancementrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(net.minecraft.server.level.ServerPlayer player) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
NONE
-
-
Constructor Details
-
AdvancementCondition
Creates an instance of aAdvancementConditionrecord class.- Parameters:
advancement- the value for theadvancementrecord component
-
-
Method Details
-
matches
public boolean matches(net.minecraft.server.level.ServerPlayer player) - Specified by:
matchesin interfaceMatchables.Matchable<net.minecraft.server.level.ServerPlayer>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
advancement
Returns the value of theadvancementrecord component.- Returns:
- the value of the
advancementrecord component
-