summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockDoor.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-04-08 22:35:08 +0200
committerAlexander Harkness <me@bearbin.net>2020-04-10 15:07:16 +0200
commitf40aba941eaf69b52ac0fbe3d8cea1ea349b97a6 (patch)
treed96f25621ab462bf3af7ff7403acb54c01a70595 /src/Blocks/BlockDoor.h
parentBrewing stands do not have rotation (diff)
downloadcuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar.gz
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar.bz2
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar.lz
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar.xz
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.tar.zst
cuberite-f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockDoor.h40
1 files changed, 3 insertions, 37 deletions
diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h
index ccb34c5a9..61185f562 100644
--- a/src/Blocks/BlockDoor.h
+++ b/src/Blocks/BlockDoor.h
@@ -12,9 +12,9 @@
class cBlockDoorHandler :
- public cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x03, 0x00, true>
+ public cYawRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x03, 0x00, true>
{
- using super = cMetaRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x03, 0x00, true>;
+ using super = cYawRotator<cBlockHandler, 0x03, 0x01, 0x02, 0x03, 0x00, true>;
public:
@@ -50,9 +50,7 @@ public:
return false;
}
- a_BlockType = m_BlockType;
- a_BlockMeta = PlayerYawToMetaData(a_Player.GetYaw());
- return true;
+ return super::GetPlacementBlockTypeMeta(a_ChunkInterface, a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, a_BlockType, a_BlockMeta);
}
virtual cBoundingBox GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP) override;
@@ -146,38 +144,6 @@ public:
- /** Converts the player's yaw to placed door's blockmeta */
- inline static NIBBLETYPE PlayerYawToMetaData(double a_Yaw)
- {
- ASSERT((a_Yaw >= -180) && (a_Yaw < 180));
-
- a_Yaw += 90 + 45;
- if (a_Yaw > 360)
- {
- a_Yaw -= 360;
- }
- if ((a_Yaw >= 0) && (a_Yaw < 90))
- {
- return 0x00;
- }
- else if ((a_Yaw >= 180) && (a_Yaw < 270))
- {
- return 0x02;
- }
- else if ((a_Yaw >= 90) && (a_Yaw < 180))
- {
- return 0x01;
- }
- else
- {
- return 0x03;
- }
- }
-
-
-
-
-
/** Returns a vector pointing one block in the direction the door is facing (where the outside is). */
inline static Vector3i GetRelativeDirectionToOutside(NIBBLETYPE a_BlockMeta)
{