summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockBookShelf.h
diff options
context:
space:
mode:
authorXenoxis <ikdc.services@gmail.com>2020-03-28 13:20:14 +0100
committerGitHub <noreply@github.com>2020-03-28 13:20:14 +0100
commit1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5 (patch)
treeb45ad6c133efaceea749516fb6b6faa7da42d481 /src/Blocks/BlockBookShelf.h
parentToss all items from enchantment table (#4569) (diff)
downloadcuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar.gz
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar.bz2
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar.lz
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar.xz
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.tar.zst
cuberite-1e1f79b795ffba893c6bfabc2df7ecee1e6c2ad5.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockBookShelf.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Blocks/BlockBookShelf.h b/src/Blocks/BlockBookShelf.h
new file mode 100644
index 000000000..477cb47b7
--- /dev/null
+++ b/src/Blocks/BlockBookShelf.h
@@ -0,0 +1,26 @@
+
+#pragma once
+
+#include "BlockHandler.h"
+
+
+
+
+class cBlockBookShelfHandler :
+ public cBlockHandler
+{
+ public:
+ cBlockBookShelfHandler(BLOCKTYPE a_BlockType) :
+ cBlockHandler(a_BlockType)
+ {
+ }
+
+ virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
+ {
+ if ((ItemCategory::IsTool(a_Tool->m_ItemType)) && (ToolHasSilkTouch(a_Tool)))
+ {
+ return cItem(m_BlockType, 1);
+ }
+ return cItem(E_ITEM_BOOK, 3);
+ }
+};