diff options
author | Mattes D <github@xoft.cz> | 2014-02-04 22:10:44 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-02-04 22:10:44 +0100 |
commit | dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435 (patch) | |
tree | 01bca60c90c1d5a6a5d00429a95bb99b3dfa9ac1 /src/Piston.h | |
parent | Fixed chest placement. (diff) | |
parent | Fix gcc not having operator ++ on enums (diff) | |
download | cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar.gz cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar.bz2 cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar.lz cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar.xz cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.tar.zst cuberite-dad49c6fddaa361cd4f98b095cfeb0e2d2e1a435.zip |
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 ); |