Record Class NbtPredicate
java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.NbtPredicate
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<NbtPredicate> static final NetworkBuffer.Type<NbtPredicate> -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aNbtPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancompareNBT(@Nullable BinaryTag standard, @Nullable BinaryTag comparison) Checks to see if everything instandardis contained incomparison.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.nbt()Returns the value of thenbtrecord component.booleanfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
NETWORK_TYPE
-
-
Constructor Details
-
NbtPredicate
Creates an instance of aNbtPredicaterecord class.- Parameters:
nbt- the value for thenbtrecord component
-
-
Method Details
-
compareNBT
public static boolean compareNBT(@Nullable @Nullable BinaryTag standard, @Nullable @Nullable BinaryTag comparison) Checks to see if everything instandardis contained incomparison. The comparison is allowed to have extra fields that are not contained in the standard.- Parameters:
standard- the standard that the comparison must have all elements ofcomparison- the comparison, that is being compared against the standard. NBT compounds in this parameter, whether deeper in the tree or not, are allowed to have keys that the standard does not - it's basically compared against a standard.- Returns:
- true if the comparison fits the standard, otherwise false
-
test
-
toString
-
hashCode
-
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). -
nbt
Returns the value of thenbtrecord component.- Returns:
- the value of the
nbtrecord component
-