diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-07-28 12:11:07 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-08-27 14:54:40 +0200 |
commit | c171b272d96453f1a9d13d4623ac4bd3aa7d19e8 (patch) | |
tree | 32828d71b3de14de7489b080f07066dcf49e913e /src/Items/ItemWrittenBook.h | |
parent | Implement anvil chunk sparsing (diff) | |
download | cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar.gz cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar.bz2 cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar.lz cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar.xz cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.tar.zst cuberite-c171b272d96453f1a9d13d4623ac4bd3aa7d19e8.zip |
Diffstat (limited to 'src/Items/ItemWrittenBook.h')
-rw-r--r-- | src/Items/ItemWrittenBook.h | 30 |
1 files changed, 30 insertions, 0 deletions
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; + } +} ; |