Class WrittenBookMeta
java.lang.Object
net.minestom.server.item.metadata.WrittenBookMeta
- All Implemented Interfaces:
ItemMeta
public class WrittenBookMeta extends java.lang.Object implements ItemMeta
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WrittenBookMeta.WrittenBookGeneration
-
Constructor Summary
Constructors Constructor Description WrittenBookMeta()
-
Method Summary
Modifier and Type Method Description ItemMeta
copy()
Copies this item meta.java.lang.String
getAuthor()
Gets the author of the book.WrittenBookMeta.WrittenBookGeneration
getGeneration()
Gets the copy tier of the book.java.util.ArrayList<JsonMessage>
getPages()
Gets anArrayList
containing all the pages.java.lang.String
getTitle()
Gets the title of the book.boolean
hasNbt()
Gets if this meta object contains any useful data to send to the client.boolean
isResolved()
Gets if the book is resolved.boolean
isSimilar(ItemMeta itemMeta)
Gets if the two ItemMeta are similar.void
read(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Reads nbt data from a compound.void
setAuthor(java.lang.String author)
Sets the author of the book.void
setGeneration(WrittenBookMeta.WrittenBookGeneration generation)
Sets the copy tier of the book.void
setPages(java.util.ArrayList<JsonMessage> pages)
Sets theArrayList
containing the book pages.void
setResolved(boolean resolved)
Sets to true when the book (or a book from the stack) is opened for the first time after being created.void
setTitle(java.lang.String title)
Sets the title of the book.void
write(org.jglrxavpok.hephaistos.nbt.NBTCompound compound)
Writes nbt data to a compound.
-
Constructor Details
-
WrittenBookMeta
public WrittenBookMeta()
-
-
Method Details
-
isResolved
public boolean isResolved()Gets if the book is resolved.- Returns:
- true if the book is resolved, false otherwise
-
setResolved
public void setResolved(boolean resolved)Sets to true when the book (or a book from the stack) is opened for the first time after being created.- Parameters:
resolved
- true to make the book resolved, false otherwise
-
getGeneration
Gets the copy tier of the book.- Returns:
- the copy tier of the book
-
setGeneration
Sets the copy tier of the book.- Parameters:
generation
- the copy tier of the book
-
getAuthor
public java.lang.String getAuthor()Gets the author of the book.- Returns:
- the author of the book
-
setAuthor
public void setAuthor(java.lang.String author)Sets the author of the book.- Parameters:
author
- the author of the book
-
getTitle
public java.lang.String getTitle()Gets the title of the book.- Returns:
- the title of the book
-
setTitle
public void setTitle(java.lang.String title)Sets the title of the book.- Parameters:
title
- the title of the book
-
getPages
Gets anArrayList
containing all the pages.The list is modifiable.
- Returns:
- a modifiable
ArrayList
with the pages of the book
-
setPages
Sets theArrayList
containing the book pages.- Parameters:
pages
- the array list containing the book pages
-
hasNbt
public boolean hasNbt()Description copied from interface:ItemMeta
Gets if this meta object contains any useful data to send to the client. -
isSimilar
Description copied from interface:ItemMeta
Gets if the two ItemMeta are similar.It is used by
ItemStack.isSimilar(ItemStack)
. -
read
public void read(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Reads nbt data from a compound.WARNING: it is possible that it contains no useful data, it has to be checked before getting anything.
-
write
public void write(@NotNull org.jglrxavpok.hephaistos.nbt.NBTCompound compound)Description copied from interface:ItemMeta
Writes nbt data to a compound. -
copy
Description copied from interface:ItemMeta
Copies this item meta.Used by
ItemStack.copy()
.
-