summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockStairs.h
diff options
context:
space:
mode:
authorworktycho <work.tycho@gmail.com>2015-12-14 21:31:33 +0100
committerworktycho <work.tycho@gmail.com>2015-12-14 21:31:33 +0100
commit1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84 (patch)
tree8adc41d291bdac3c83eb0c56933e7a29cd1c3942 /src/Blocks/BlockStairs.h
parentMerge pull request #2744 from cuberite/HopperMetaStrip (diff)
parentblockheight mechanism (diff)
downloadcuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar.gz
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar.bz2
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar.lz
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar.xz
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.tar.zst
cuberite-1e5ba8a1bb887808961e9c17dfd44af6bbbd2a84.zip
Diffstat (limited to 'src/Blocks/BlockStairs.h')
-rw-r--r--src/Blocks/BlockStairs.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Blocks/BlockStairs.h b/src/Blocks/BlockStairs.h
index 8a23fd064..3d7dd1442 100644
--- a/src/Blocks/BlockStairs.h
+++ b/src/Blocks/BlockStairs.h
@@ -115,6 +115,38 @@ public:
}
}
}
+
+ /** EXCEPTION a.k.a. why is this removed:
+ This collision-detection is actually more accurate than the client, but since the client itself
+ sends inaccurate / sparse data, it's easier to just err on the side of the client and keep the
+ two in sync by assuming that if a player hit ANY of the stair's bounding cube, it counts as the ground. */
+ #if 0
+ bool IsInsideBlock(const Vector3d & a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta)
+ {
+ if (a_BlockMeta & 0x4) // upside down
+ {
+ return true;
+ }
+ else if ((a_BlockMeta & 0x3) == 0) // tall side is east (+X)
+ {
+ return a_Position.y < ((a_Position.x > 0.5) ? 1.0 : 0.5);
+ }
+ else if ((a_BlockMeta & 0x3) == 1) // tall side is west (-X)
+ {
+ return a_Position.y < ((a_Position.x < 0.5) ? 1.0 : 0.5);
+ }
+ else if ((a_BlockMeta & 0x3) == 2) // tall side is south (+Z)
+ {
+ return a_Position.y < ((a_Position.z > 0.5) ? 1.0 : 0.5);
+ }
+ else if ((a_BlockMeta & 0x3) == 3) // tall side is north (-Z)
+ {
+ return a_Position.y < ((a_Position.z < 0.5) ? 1.0 : 0.5);
+ }
+ return false;
+ }
+ #endif
+
} ;