From 2126a1719d60a232d8e57b9a0dfec1b5ef556ca4 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Tue, 1 Aug 2017 18:54:31 +0200 Subject: Use GetStackValue to get the class instance and simplified IsSigned --- src/Protocol/Protocol_1_9.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/Protocol/Protocol_1_9.cpp') diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 9879140d4..aba0a9d01 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -2953,6 +2953,7 @@ void cProtocol_1_9_0::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, con cParsedNBT NBT(BookData.c_str(), BookData.size()); cItem BookItem; + bool IsSigned = true; if (a_Channel == "MC|BSign") { BookItem = cItem(E_ITEM_WRITTEN_BOOK); @@ -2961,13 +2962,11 @@ void cProtocol_1_9_0::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, con } else { + IsSigned = false; BookItem = cItem(E_ITEM_BOOK_AND_QUILL); cBookContent::ParseFromNBT(0, BookItem.m_BookContent, NBT); } - // If true, player has clicked on the sign button - bool IsSigned = (BookItem.m_ItemType == E_ITEM_WRITTEN_BOOK) ? true : false; - if (cRoot::Get()->GetPluginManager()->CallHookPlayerEditingBook(Player, BookItem.m_BookContent, IsSigned)) { // Plugin denied the editing of the book -- cgit v1.2.3