summaryrefslogtreecommitdiffstats
path: root/src/Piston.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-09 01:04:42 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-09 01:04:42 +0100
commitf86f066615f4e4807941f863f6e749dc12ac01be (patch)
treea792dc877470a98030569204b3d32575da404d6d /src/Piston.h
parentFixed a boat ASSERT (diff)
parentFixed a gcc warning in ManualBindings. (diff)
downloadcuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar.gz
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar.bz2
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar.lz
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar.xz
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.tar.zst
cuberite-f86f066615f4e4807941f863f6e749dc12ac01be.zip
Diffstat (limited to 'src/Piston.h')
-rw-r--r--src/Piston.h21
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 );