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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<WritableBookContent> static final WritableBookContent
static final int
private static final com.mojang.serialization.Codec
<Filterable<String>> static final int
private final List
<Filterable<String>> The field for thepages
record component.static final com.mojang.serialization.Codec
<List<Filterable<String>>> static final StreamCodec
<io.netty.buffer.ByteBuf, WritableBookContent> -
Constructor Summary
ConstructorDescriptionWritableBookContent
(List<Filterable<String>> pages) Creates an instance of aWritableBookContent
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getPages
(boolean p_333617_) final int
hashCode()
Returns a hash code value for this object.pages()
Returns the value of thepages
record component.final String
toString()
Returns a string representation of this record class.withReplacedPages
(List<Filterable<String>> p_334830_)
-
Field Details
-
pages
The field for thepages
record 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 aWritableBookContent
record class.- Parameters:
pages
- the value for thepages
record component
-
-
Method Details
-
getPages
-
withReplacedPages
- Specified by:
withReplacedPages
in interfaceBookContent<String,
WritableBookContent>
-
pages
Returns the value of thepages
record component.- Specified by:
pages
in interfaceBookContent<String,
WritableBookContent> - Returns:
- the value of the
pages
record component
-
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)
.
-