diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-28 21:44:34 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-06-28 21:44:34 +0200 |
commit | 61cb08b54698e9b70f629858a6a9c5b389db8b3e (patch) | |
tree | 6d43e221dd0e883c653fc22a3a27628f64b3d294 /src/Items | |
parent | Added more block exceptions to torches (diff) | |
download | cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar.gz cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar.bz2 cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar.lz cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar.xz cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.tar.zst cuberite-61cb08b54698e9b70f629858a6a9c5b389db8b3e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemHandler.cpp | 2 | ||||
-rw-r--r-- | src/Items/ItemString.h | 39 |
2 files changed, 41 insertions, 0 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index f639423ae..a2fd4e3f8 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -44,6 +44,7 @@ #include "ItemSign.h" #include "ItemMobHead.h" #include "ItemSpawnEgg.h" +#include "ItemString.h" #include "ItemSugarcane.h" #include "ItemSword.h" @@ -129,6 +130,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_HEAD: return new cItemMobHeadHandler(a_ItemType); case E_ITEM_SNOWBALL: return new cItemSnowballHandler(); case E_ITEM_SPAWN_EGG: return new cItemSpawnEggHandler(a_ItemType); + case E_ITEM_STRING: return new cItemStringHandler(a_ItemType); case E_ITEM_SUGARCANE: return new cItemSugarcaneHandler(a_ItemType); case E_ITEM_WOODEN_HOE: diff --git a/src/Items/ItemString.h b/src/Items/ItemString.h new file mode 100644 index 000000000..a97fbe0ce --- /dev/null +++ b/src/Items/ItemString.h @@ -0,0 +1,39 @@ + +#pragma once + +#include "ItemHandler.h" + + + + + +class cItemStringHandler : + public cItemHandler +{ +public: + cItemStringHandler(int a_ItemType) : + cItemHandler(a_ItemType) + { + } + + virtual bool IsPlaceable(void) override + { + return true; + } + + virtual bool GetPlacementBlockTypeMeta( + cWorld * a_World, cPlayer * a_Player, + int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, + int a_CursorX, int a_CursorY, int a_CursorZ, + BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta + ) override + { + a_BlockType = E_BLOCK_TRIPWIRE; + a_BlockMeta = 0; + return true; + } +}; + + + + |