Package tschipp.carryon.common.scripting
Record Class Matchables.NBTCondition
java.lang.Object
java.lang.Record
tschipp.carryon.common.scripting.Matchables.NBTCondition
- All Implemented Interfaces:
Matchables.Matchable<net.minecraft.nbt.CompoundTag>
- Enclosing class:
- Matchables
public static record Matchables.NBTCondition(net.minecraft.nbt.CompoundTag tag)
extends Record
implements Matchables.Matchable<net.minecraft.nbt.CompoundTag>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Matchables.NBTCondition>static final Matchables.NBTCondition -
Constructor Summary
ConstructorsConstructorDescriptionNBTCondition(net.minecraft.nbt.CompoundTag tag) Creates an instance of aNBTConditionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanmatches(net.minecraft.nbt.CompoundTag other) net.minecraft.nbt.CompoundTagtag()Returns the value of thetagrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
NONE
-
-
Constructor Details
-
NBTCondition
public NBTCondition(net.minecraft.nbt.CompoundTag tag) Creates an instance of aNBTConditionrecord class.- Parameters:
tag- the value for thetagrecord component
-
-
Method Details
-
matches
public boolean matches(net.minecraft.nbt.CompoundTag other) - Specified by:
matchesin interfaceMatchables.Matchable<net.minecraft.nbt.CompoundTag>
-
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). -
tag
public net.minecraft.nbt.CompoundTag tag()Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-