Record Class WritableBookContent
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.WritableBookContent
- All Implemented Interfaces:
BookContent<String,WritableBookContent>
public record WritableBookContent(List<Filterable<String>> pages)
extends Record
implements BookContent<String,WritableBookContent>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<WritableBookContent> static final WritableBookContentstatic final intprivate static final com.mojang.serialization.Codec<Filterable<String>> static final intprivate final List<Filterable<String>> The field for thepagesrecord component.static final com.mojang.serialization.Codec<List<Filterable<String>>> static final StreamCodec<io.netty.buffer.ByteBuf, WritableBookContent> -
Constructor Summary
ConstructorsConstructorDescriptionWritableBookContent(List<Filterable<String>> pages) Creates an instance of aWritableBookContentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getPages(boolean p_330613_) final inthashCode()Returns a hash code value for this object.pages()Returns the value of thepagesrecord component.final StringtoString()Returns a string representation of this record class.withReplacedPages(List<Filterable<String>> p_333808_)
-
Field Details
-
pages
The field for thepagesrecord component. -
EMPTY
-
PAGE_EDIT_LENGTH
public static final int PAGE_EDIT_LENGTH- See Also:
-
MAX_PAGES
public static final int MAX_PAGES- See Also:
-
PAGE_CODEC
-
PAGES_CODEC
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
WritableBookContent
Creates an instance of aWritableBookContentrecord class.- Parameters:
pages- the value for thepagesrecord component
-
-
Method Details
-
getPages
-
withReplacedPages
- Specified by:
withReplacedPagesin interfaceBookContent<String,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
Returns the value of thepagesrecord component.- Specified by:
pagesin interfaceBookContent<String,WritableBookContent> - Returns:
- the value of the
pagesrecord component
-