diff options
author | madmaxoft <github@xoft.cz> | 2014-07-15 09:01:32 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-15 09:01:32 +0200 |
commit | 8e946da8ac109a8bedf9d243251f9a18d29e5a1a (patch) | |
tree | 30f046ddec20d809e3fa84e78b76f31915a361c2 /src/Blocks/BlockLadder.h | |
parent | ItemHandler.cpp: removed redundant food and drink checks (diff) | |
parent | Pass cItem by reference. (diff) | |
download | cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.gz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.bz2 cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.lz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.xz cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.tar.zst cuberite-8e946da8ac109a8bedf9d243251f9a18d29e5a1a.zip |
Diffstat (limited to 'src/Blocks/BlockLadder.h')
-rw-r--r-- | src/Blocks/BlockLadder.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h index a605edf3f..7efd8e444 100644 --- a/src/Blocks/BlockLadder.h +++ b/src/Blocks/BlockLadder.h @@ -41,21 +41,27 @@ public: } - static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction) // tolua_export - { // tolua_export + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.Add(m_BlockType, 1, 0); // Reset meta + } + + + static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction) + { switch (a_Direction) { case BLOCK_FACE_ZM: return 0x2; case BLOCK_FACE_ZP: return 0x3; case BLOCK_FACE_XM: return 0x4; case BLOCK_FACE_XP: return 0x5; - default: return 0x2; + default: return 0x2; } - } // tolua_export + } - static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData) // tolua_export - { // tolua_export + static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData) + { switch (a_MetaData) { case 0x2: return BLOCK_FACE_ZM; @@ -64,10 +70,10 @@ public: case 0x5: return BLOCK_FACE_XP; default: return BLOCK_FACE_ZM; } - } // tolua_export + } - /// Finds a suitable Direction for the Ladder. Returns BLOCK_FACE_BOTTOM on failure + /** Finds a suitable Direction for the Ladder. Returns BLOCK_FACE_BOTTOM on failure */ static eBlockFace FindSuitableBlockFace(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) { for (int FaceInt = BLOCK_FACE_ZM; FaceInt <= BLOCK_FACE_XP; FaceInt++) |