Record Class ItemWrittenBookPredicate
java.lang.Object
java.lang.Record
net.minecraft.advancements.critereon.ItemWrittenBookPredicate
- All Implemented Interfaces:
ItemSubPredicate,SingleComponentItemPredicate<WrittenBookContent>
public record ItemWrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>,ItemWrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved)
extends Record
implements SingleComponentItemPredicate<WrittenBookContent>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
ItemSubPredicate.Type<T extends ItemSubPredicate> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theauthorrecord component.static final com.mojang.serialization.Codec<ItemWrittenBookPredicate> private final MinMaxBounds.IntsThe field for thegenerationrecord component.private final Optional<CollectionPredicate<Filterable<Component>, ItemWrittenBookPredicate.PagePredicate>> The field for thepagesrecord component.The field for theresolvedrecord component.The field for thetitlerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionItemWrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>, ItemWrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved) Creates an instance of aItemWrittenBookPredicaterecord class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()Returns the value of theauthorrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegenerationrecord component.final inthashCode()Returns a hash code value for this object.booleanmatches(ItemStack p_340982_, WrittenBookContent p_341220_) pages()Returns the value of thepagesrecord component.resolved()Returns the value of theresolvedrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.advancements.critereon.SingleComponentItemPredicate
matches
-
Field Details
-
pages
private final Optional<CollectionPredicate<Filterable<Component>,ItemWrittenBookPredicate.PagePredicate>> pagesThe field for thepagesrecord component. -
author
The field for theauthorrecord component. -
title
The field for thetitlerecord component. -
generation
The field for thegenerationrecord component. -
resolved
The field for theresolvedrecord component. -
CODEC
-
-
Constructor Details
-
ItemWrittenBookPredicate
public ItemWrittenBookPredicate(Optional<CollectionPredicate<Filterable<Component>, ItemWrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved) Creates an instance of aItemWrittenBookPredicaterecord class.- Parameters:
pages- the value for thepagesrecord componentauthor- the value for theauthorrecord componenttitle- the value for thetitlerecord componentgeneration- the value for thegenerationrecord componentresolved- the value for theresolvedrecord component
-
-
Method Details
-
componentType
- Specified by:
componentTypein interfaceSingleComponentItemPredicate<WrittenBookContent>
-
matches
- Specified by:
matchesin interfaceSingleComponentItemPredicate<WrittenBookContent>
-
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<Component>,ItemWrittenBookPredicate.PagePredicate>> pages()Returns the value of thepagesrecord component.- Returns:
- the value of the
pagesrecord component
-
author
Returns the value of theauthorrecord component.- Returns:
- the value of the
authorrecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-
generation
Returns the value of thegenerationrecord component.- Returns:
- the value of the
generationrecord component
-
resolved
Returns the value of theresolvedrecord component.- Returns:
- the value of the
resolvedrecord component
-