From c171b272d96453f1a9d13d4623ac4bd3aa7d19e8 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Fri, 28 Jul 2017 12:11:07 +0200 Subject: Started on adding books --- src/Items/ItemWrittenBook.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/Items/ItemWrittenBook.h (limited to 'src/Items/ItemWrittenBook.h') diff --git a/src/Items/ItemWrittenBook.h b/src/Items/ItemWrittenBook.h new file mode 100644 index 000000000..37f1254c5 --- /dev/null +++ b/src/Items/ItemWrittenBook.h @@ -0,0 +1,30 @@ + +// ItemWrittenBook.h + +#pragma once + +#include "ItemHandler.h" +#include "../Entities/Player.h" +#include "../Inventory.h" + + + +class cItemWrittenBookHandler : + public cItemHandler +{ +public: + cItemWrittenBookHandler(int a_ItemType) + : cItemHandler(a_ItemType) + { + } + + virtual bool OnItemUse( + cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, + int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace + ) override + { + // TODO: Currently only main haind. If second hand is implemented, fix this + a_Player->GetClientHandle()->SendOpenBook(0); + return true; + } +} ; -- cgit v1.2.3