diff options
Diffstat (limited to 'src/Piston.h')
-rw-r--r-- | src/Piston.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/Piston.h b/src/Piston.h index 92ddf6938..9bbc8c6b9 100644 --- a/src/Piston.h +++ b/src/Piston.h @@ -2,7 +2,7 @@ #pragma once - +#include "Defines.h" // fwd: World.h @@ -54,6 +54,25 @@ public: } } } + + static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData) + { + switch (a_MetaData) + { + //case -1: return BLOCK_FACE_NONE; //can never happen as metadata is unsigned + case 0x0: return BLOCK_FACE_YM; + case 0x1: return BLOCK_FACE_YP; + case 0x2: return BLOCK_FACE_ZM; + case 0x3: return BLOCK_FACE_ZP; + case 0x4: return BLOCK_FACE_XM; + case 0x5: return BLOCK_FACE_XP; + default: + { + ASSERT(!"Invalid Metadata"); + return BLOCK_FACE_NONE; + } + } + } void ExtendPiston( int, int, int ); void RetractPiston( int, int, int ); |