Record Class ItemWritableBookPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemWritableBookPredicate
- All Implemented Interfaces:
ItemSubPredicate
,SingleComponentItemPredicate<WritableBookContent>
public record ItemWritableBookPredicate(Optional<CollectionPredicate<Filterable<String>,ItemWritableBookPredicate.PagePredicate>> pages)
extends Record
implements SingleComponentItemPredicate<WritableBookContent>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
ItemSubPredicate.Type<T extends ItemSubPredicate>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<ItemWritableBookPredicate> private final Optional
<CollectionPredicate<Filterable<String>, ItemWritableBookPredicate.PagePredicate>> The field for thepages
record component. -
Constructor Summary
ConstructorDescriptionItemWritableBookPredicate
(Optional<CollectionPredicate<Filterable<String>, ItemWritableBookPredicate.PagePredicate>> pages) Creates an instance of aItemWritableBookPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(ItemStack p_335022_, WritableBookContent p_331059_) pages()
Returns the value of thepages
record component.final String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.advancements.critereon.SingleComponentItemPredicate
matches
-
Field Details
-
pages
private final Optional<CollectionPredicate<Filterable<String>,ItemWritableBookPredicate.PagePredicate>> pagesThe field for thepages
record component. -
CODEC
-
-
Constructor Details
-
ItemWritableBookPredicate
public ItemWritableBookPredicate(Optional<CollectionPredicate<Filterable<String>, ItemWritableBookPredicate.PagePredicate>> pages) Creates an instance of aItemWritableBookPredicate
record class.- Parameters:
pages
- the value for thepages
record component
-
-
Method Details
-
componentType
- Specified by:
componentType
in interfaceSingleComponentItemPredicate<WritableBookContent>
-
matches
- Specified by:
matches
in interfaceSingleComponentItemPredicate<WritableBookContent>
-
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)
. -
pages
public Optional<CollectionPredicate<Filterable<String>,ItemWritableBookPredicate.PagePredicate>> pages()Returns the value of thepages
record component.- Returns:
- the value of the
pages
record component
-