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/Items/ItemBed.h | 2 +- src/Items/ItemComparator.h | 4 ++-- src/Items/ItemDoor.h | 2 +- src/Items/ItemRedstoneRepeater.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/Items') diff --git a/src/Items/ItemBed.h b/src/Items/ItemBed.h index 7f30a65c5..0f085d489 100644 --- a/src/Items/ItemBed.h +++ b/src/Items/ItemBed.h @@ -39,7 +39,7 @@ public: } // The "foot" block: - NIBBLETYPE BlockMeta = cBlockBedHandler::RotationToMetaData(a_Player.GetYaw()); + NIBBLETYPE BlockMeta = cBlockBedHandler::YawToMetaData(a_Player.GetYaw()); a_BlocksToPlace.emplace_back(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_BED, BlockMeta); // Check if there is empty space for the "head" block: diff --git a/src/Items/ItemComparator.h b/src/Items/ItemComparator.h index fc843c186..6f32e229d 100644 --- a/src/Items/ItemComparator.h +++ b/src/Items/ItemComparator.h @@ -2,7 +2,7 @@ #pragma once #include "ItemHandler.h" -#include "../Blocks/BlockRedstoneRepeater.h" +#include "../Blocks/BlockComparator.h" @@ -30,7 +30,7 @@ public: ) override { a_BlockType = E_BLOCK_INACTIVE_COMPARATOR; - a_BlockMeta = cBlockRedstoneRepeaterHandler::RepeaterRotationToMetaData(a_Player->GetYaw()); + a_BlockMeta = cBlockComparatorHandler::YawToMetaData(a_Player->GetYaw()); return true; } } ; diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index 7c2f81ef9..790e08ffc 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -74,7 +74,7 @@ public: } // Get the coords of the neighboring blocks: - NIBBLETYPE LowerBlockMeta = cBlockDoorHandler::PlayerYawToMetaData(a_Player.GetYaw()); + NIBBLETYPE LowerBlockMeta = cBlockDoorHandler::YawToMetaData(a_Player.GetYaw()); Vector3i RelDirToOutside = cBlockDoorHandler::GetRelativeDirectionToOutside(LowerBlockMeta); Vector3i LeftNeighborPos = RelDirToOutside; LeftNeighborPos.TurnCW(); diff --git a/src/Items/ItemRedstoneRepeater.h b/src/Items/ItemRedstoneRepeater.h index 13a797d00..9b0fc1bcc 100644 --- a/src/Items/ItemRedstoneRepeater.h +++ b/src/Items/ItemRedstoneRepeater.h @@ -30,7 +30,7 @@ public: ) override { a_BlockType = E_BLOCK_REDSTONE_REPEATER_OFF; - a_BlockMeta = cBlockRedstoneRepeaterHandler::RepeaterRotationToMetaData(a_Player->GetYaw()); + a_BlockMeta = cBlockRedstoneRepeaterHandler::YawToMetaData(a_Player->GetYaw()); return true; } } ; -- cgit v1.2.3