Record Class DataComponentPredicate.Single<T extends DataComponentPredicate>
java.lang.Object
java.lang.Record
net.minecraft.core.component.predicates.DataComponentPredicate.Single<T>
- Enclosing interface:
DataComponentPredicate
public static record DataComponentPredicate.Single<T extends DataComponentPredicate>(DataComponentPredicate.Type<T extends DataComponentPredicate> type, T extends DataComponentPredicate predicate)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TThe field for thepredicaterecord component.private final DataComponentPredicate.Type<T> The field for thetyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSingle(DataComponentPredicate.Type<T> type, T predicate) Creates an instance of aSinglerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.private static <T extends DataComponentPredicate>
DataComponentPredicate.Single<T> fromEntry(Map.Entry<DataComponentPredicate.Type<?>, T> e) final inthashCode()Returns a hash code value for this object.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.private static <T extends DataComponentPredicate>
com.mojang.serialization.MapCodec<DataComponentPredicate.Single<T>> wrapCodec(DataComponentPredicate.Type<T> type, com.mojang.serialization.Codec<T> codec)
-
Field Details
-
type
The field for thetyperecord component. -
predicate
The field for thepredicaterecord component.
-
-
Constructor Details
-
Single
Creates an instance of aSinglerecord class.- Parameters:
type- the value for thetyperecord componentpredicate- the value for thepredicaterecord component
-
-
Method Details
-
wrapCodec
private static <T extends DataComponentPredicate> com.mojang.serialization.MapCodec<DataComponentPredicate.Single<T>> wrapCodec(DataComponentPredicate.Type<T> type, com.mojang.serialization.Codec<T> codec) -
fromEntry
private static <T extends DataComponentPredicate> DataComponentPredicate.Single<T> fromEntry(Map.Entry<DataComponentPredicate.Type<?>, T> e) -
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). -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-