summaryrefslogtreecommitdiffstats
path: root/source/cTorch.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 16:18:59 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-01 16:18:59 +0100
commit867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc (patch)
treea2f8b4a22a9b721d94ffa595ef57a07d1339f482 /source/cTorch.h
parentFixed the authenticator bug (diff)
downloadcuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.gz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.bz2
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.lz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.xz
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.tar.zst
cuberite-867fc8ee0dbebd3c09a4f7cdcbd5fb4d56f194dc.zip
Diffstat (limited to '')
-rw-r--r--source/cTorch.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/source/cTorch.h b/source/cTorch.h
index 98f8b86e3..6bb2291b2 100644
--- a/source/cTorch.h
+++ b/source/cTorch.h
@@ -1,5 +1,7 @@
#pragma once
+#include "Vector3i.h"
+
class cTorch //tolua_export
{ //tolua_export
public:
@@ -48,4 +50,45 @@ public:
return 0x0;
} //tolua_export
+ static bool IsAttachedTo( const Vector3i & a_TorchPos, char a_TorchMeta, const Vector3i & a_BlockPos )
+ {
+ switch( a_TorchMeta )
+ {
+ case 0x0:
+ case 0x5: // On floor
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 1, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x4: // South -Z
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, -1 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x3: // North +Z
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(0, 0, 1 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x2: // West -X
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i(-1, 0, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ case 0x1: // East +X
+ if( (a_TorchPos - a_BlockPos).Equals( Vector3i( 1, 0, 0 ) ) )
+ {
+ return true;
+ }
+ break;
+ default:
+ break;
+ };
+ return false;
+ }
+
}; //tolua_export \ No newline at end of file