From f40aba941eaf69b52ac0fbe3d8cea1ea349b97a6 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Wed, 8 Apr 2020 21:35:08 +0100 Subject: Add mixins for blocks that rotate based on player yaw at placement Also add observer block handler. --- src/Blocks/BlockBed.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'src/Blocks/BlockBed.h') diff --git a/src/Blocks/BlockBed.h b/src/Blocks/BlockBed.h index bedc383e1..3d35b2bf5 100644 --- a/src/Blocks/BlockBed.h +++ b/src/Blocks/BlockBed.h @@ -16,9 +16,9 @@ class cWorldInterface; class cBlockBedHandler : - public cMetaRotator + public cYawRotator { - using super = cMetaRotator; + using super = cYawRotator; public: @@ -41,24 +41,6 @@ public: - // Bed specific helper functions - static NIBBLETYPE RotationToMetaData(double a_Rotation) - { - a_Rotation += 180 + (180 / 4); // So its not aligned with axis - if (a_Rotation > 360) - { - a_Rotation -= 360; - } - - a_Rotation = (a_Rotation / 360) * 4; - - return (static_cast(a_Rotation + 2)) % 4; - } - - - - - static Vector3i MetaDataToDirection(NIBBLETYPE a_MetaData) { switch (a_MetaData) -- cgit v1.2.3