summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-08-01 20:55:41 +0200
committerLukas Pioch <lukas@zgow.de>2017-08-27 14:54:42 +0200
commit16deb2b7553a2ecb16606e72a925fd53cbb736c7 (patch)
treedbfd16c2fa2573b9bc7e8183aff51b936b0deb53
parentUse GetStackValue to get the class instance and simplified IsSigned (diff)
downloadcuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar.gz
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar.bz2
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar.lz
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar.xz
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.tar.zst
cuberite-16deb2b7553a2ecb16606e72a925fd53cbb736c7.zip
-rw-r--r--Server/Plugins/APIDump/APIDesc.lua7
-rw-r--r--src/BookContent.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua
index 251c2e4fb..a22eab601 100644
--- a/Server/Plugins/APIDump/APIDesc.lua
+++ b/Server/Plugins/APIDump/APIDesc.lua
@@ -7028,6 +7028,12 @@ This class contains the information for a signed or writeable book: The author,
{
constructor =
{
+ Returns =
+ {
+ {
+ Type = "cBookContent",
+ },
+ },
Notes = "Creates a empty book",
},
SetAuthor =
@@ -7098,6 +7104,7 @@ This class contains the information for a signed or writeable book: The author,
Params =
{
{
+ Name = "Pages",
Type = "table",
},
},
diff --git a/src/BookContent.h b/src/BookContent.h
index 001da824c..67c980c0a 100644
--- a/src/BookContent.h
+++ b/src/BookContent.h
@@ -20,13 +20,13 @@ public:
void SetAuthor(const AString & a_Author) { m_Author = a_Author; }
/** Returns the author of the book */
- const AString GetAuthor(void) const { return m_Author; }
+ const AString & GetAuthor(void) const { return m_Author; }
/** Set the title of the book */
void SetTitle(const AString & a_Title) { m_Title = a_Title; }
/** Returns the title of the book */
- const AString GetTitle(void) const { return m_Title; }
+ const AString & GetTitle(void) const { return m_Title; }
/** Add a page to the end of the book */
void AddPage(const AString & a_Page) { m_Pages.emplace_back(a_Page); }
@@ -42,7 +42,7 @@ public:
/** Returns a AStringVector ref to the pages. Used in ManualBindings and for saving the book */
const AStringVector & GetPages(void) const { return m_Pages; }
- /** Read the book content from nbt. The boolean a_SaveAsJson is optional. If a player creates a book, the text should be in a json string */
+ /** Read the book content from nbt. The boolean a_SaveAsJson is optional. If the book is signed, the text should be in a json string */
static void ParseFromNBT(int TagTag, cBookContent & a_BookContent, const cParsedNBT & a_NBT, bool a_SaveAsJson = false);
/** Write book content to nbt */