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 classes/interfaces inherited from interface net.minecraft.advancements.critereon.ItemSubPredicate
ItemSubPredicate.Type<T extends ItemSubPredicate>
-
Field Summary
Modifier and TypeFieldDescriptionThe field for theauthor
record component.static final com.mojang.serialization.Codec
<ItemWrittenBookPredicate> private final MinMaxBounds.Ints
The field for thegeneration
record component.private final Optional
<CollectionPredicate<Filterable<Component>, ItemWrittenBookPredicate.PagePredicate>> The field for thepages
record component.The field for theresolved
record component.The field for thetitle
record component. -
Constructor Summary
ConstructorDescriptionItemWrittenBookPredicate
(Optional<CollectionPredicate<Filterable<Component>, ItemWrittenBookPredicate.PagePredicate>> pages, Optional<String> author, Optional<String> title, MinMaxBounds.Ints generation, Optional<Boolean> resolved) Creates an instance of aItemWrittenBookPredicate
record class. -
Method Summary
Modifier and TypeMethodDescriptionauthor()
Returns the value of theauthor
record component.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of thegeneration
record component.final int
hashCode()
Returns a hash code value for this object.boolean
matches
(ItemStack p_336266_, WrittenBookContent p_336372_) pages()
Returns the value of thepages
record component.resolved()
Returns the value of theresolved
record component.title()
Returns the value of thetitle
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<Component>,ItemWrittenBookPredicate.PagePredicate>> pagesThe field for thepages
record component. -
author
The field for theauthor
record component. -
title
The field for thetitle
record component. -
generation
The field for thegeneration
record component. -
resolved
The field for theresolved
record 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 aItemWrittenBookPredicate
record class.- Parameters:
pages
- the value for thepages
record componentauthor
- the value for theauthor
record componenttitle
- the value for thetitle
record componentgeneration
- the value for thegeneration
record componentresolved
- the value for theresolved
record component
-
-
Method Details
-
componentType
- Specified by:
componentType
in interfaceSingleComponentItemPredicate<WrittenBookContent>
-
matches
- Specified by:
matches
in 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 thepages
record component.- Returns:
- the value of the
pages
record component
-
author
Returns the value of theauthor
record component.- Returns:
- the value of the
author
record component
-
title
Returns the value of thetitle
record component.- Returns:
- the value of the
title
record component
-
generation
Returns the value of thegeneration
record component.- Returns:
- the value of the
generation
record component
-
resolved
Returns the value of theresolved
record component.- Returns:
- the value of the
resolved
record component
-