From 15b92af166e03e3deb8baf5eb2ec6b0be5981646 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 25 Jan 2014 11:14:14 -0800 Subject: First attempt at Implementing Interfaces --- src/Blocks/BlockDoor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 1e86446dd..cf0572284 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -16,7 +16,7 @@ public: cBlockDoorHandler(BLOCKTYPE a_BlockType); virtual void OnDestroyed(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override; - virtual void OnUse(cWorld * a_World, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; + virtual void OnUse(cWorld * a_World, cWorldInterface * a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; virtual const char * GetStepSound(void) override; -- cgit v1.2.3 From 25ec7750aac9800bec83a844020a6eeda5cd4d74 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 31 Jan 2014 15:17:41 -0800 Subject: Changed signitures of Several BLockHandler Methods Changed the signitures of the following to use interfaces: GetPlacementBlockTypeMeta OnPlaced OnPlacedByPlayer OnDestroyed OnNeighbourChanged NeighbourChanged OnUse CanBeAt Check --- src/Blocks/BlockDoor.h | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index cf0572284..3a72f7a39 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -2,7 +2,6 @@ #pragma once #include "BlockHandler.h" -#include "../World.h" #include "../Entities/Player.h" @@ -15,13 +14,13 @@ class cBlockDoorHandler : public: cBlockDoorHandler(BLOCKTYPE a_BlockType); - virtual void OnDestroyed(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override; - virtual void OnUse(cWorld * a_World, cWorldInterface * a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; + virtual void OnDestroyed(cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override; + virtual void OnUse(cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; virtual const char * GetStepSound(void) override; virtual bool GetPlacementBlockTypeMeta( - cWorld * a_World, cPlayer * a_Player, + cChunkInterface * a_ChunkInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta @@ -34,8 +33,8 @@ public: } if ( - !CanReplaceBlock(a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ)) || - !CanReplaceBlock(a_World->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ)) + !CanReplaceBlock(a_ChunkInterface->GetBlock(a_BlockX, a_BlockY, a_BlockZ)) || + !CanReplaceBlock(a_ChunkInterface->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ)) ) { return false; @@ -54,7 +53,7 @@ public: virtual void OnPlacedByPlayer( - cWorld * a_World, cPlayer * a_Player, + cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta @@ -67,7 +66,7 @@ public: } - virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override + virtual bool CanBeAt(cChunkInterface * a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR)); } @@ -137,32 +136,32 @@ public: /// Changes the door at the specified coords from open to close or vice versa - static void ChangeDoor(cWorld * a_World, int a_X, int a_Y, int a_Z) + static void ChangeDoor(cChunkInterface * a_ChunkInterface, int a_X, int a_Y, int a_Z) { - NIBBLETYPE OldMetaData = a_World->GetBlockMeta(a_X, a_Y, a_Z); + NIBBLETYPE OldMetaData = a_ChunkInterface->GetBlockMeta(a_X, a_Y, a_Z); - a_World->SetBlockMeta(a_X, a_Y, a_Z, ChangeStateMetaData(OldMetaData)); + a_ChunkInterface->SetBlockMeta(a_X, a_Y, a_Z, ChangeStateMetaData(OldMetaData)); if (OldMetaData & 8) { // Current block is top of the door - BLOCKTYPE BottomBlock = a_World->GetBlock(a_X, a_Y - 1, a_Z); - NIBBLETYPE BottomMeta = a_World->GetBlockMeta(a_X, a_Y - 1, a_Z); + BLOCKTYPE BottomBlock = a_ChunkInterface->GetBlock(a_X, a_Y - 1, a_Z); + NIBBLETYPE BottomMeta = a_ChunkInterface->GetBlockMeta(a_X, a_Y - 1, a_Z); if (IsDoor(BottomBlock) && !(BottomMeta & 8)) { - a_World->SetBlockMeta(a_X, a_Y - 1, a_Z, ChangeStateMetaData(BottomMeta)); + a_ChunkInterface->SetBlockMeta(a_X, a_Y - 1, a_Z, ChangeStateMetaData(BottomMeta)); } } else { // Current block is bottom of the door - BLOCKTYPE TopBlock = a_World->GetBlock(a_X, a_Y + 1, a_Z); - NIBBLETYPE TopMeta = a_World->GetBlockMeta(a_X, a_Y + 1, a_Z); + BLOCKTYPE TopBlock = a_ChunkInterface->GetBlock(a_X, a_Y + 1, a_Z); + NIBBLETYPE TopMeta = a_ChunkInterface->GetBlockMeta(a_X, a_Y + 1, a_Z); if (IsDoor(TopBlock) && (TopMeta & 8)) { - a_World->SetBlockMeta(a_X, a_Y + 1, a_Z, ChangeStateMetaData(TopMeta)); + a_ChunkInterface->SetBlockMeta(a_X, a_Y + 1, a_Z, ChangeStateMetaData(TopMeta)); } } } -- cgit v1.2.3 From c6304b2b4faf31c2e4a91a07bcac298467898dba Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 1 Feb 2014 05:06:32 -0800 Subject: Changed pointers to references --- src/Blocks/BlockDoor.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 3a72f7a39..31d1bb797 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -14,13 +14,13 @@ class cBlockDoorHandler : public: cBlockDoorHandler(BLOCKTYPE a_BlockType); - virtual void OnDestroyed(cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override; - virtual void OnUse(cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; + virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override; + virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; virtual const char * GetStepSound(void) override; virtual bool GetPlacementBlockTypeMeta( - cChunkInterface * a_ChunkInterface, cPlayer * a_Player, + cChunkInterface & a_ChunkInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta @@ -33,8 +33,8 @@ public: } if ( - !CanReplaceBlock(a_ChunkInterface->GetBlock(a_BlockX, a_BlockY, a_BlockZ)) || - !CanReplaceBlock(a_ChunkInterface->GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ)) + !CanReplaceBlock(a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ)) || + !CanReplaceBlock(a_ChunkInterface.GetBlock(a_BlockX, a_BlockY + 1, a_BlockZ)) ) { return false; @@ -53,7 +53,7 @@ public: virtual void OnPlacedByPlayer( - cChunkInterface * a_ChunkInterface, cWorldInterface * a_WorldInterface, cPlayer * a_Player, + cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta @@ -66,7 +66,7 @@ public: } - virtual bool CanBeAt(cChunkInterface * a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override + virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR)); } @@ -136,32 +136,32 @@ public: /// Changes the door at the specified coords from open to close or vice versa - static void ChangeDoor(cChunkInterface * a_ChunkInterface, int a_X, int a_Y, int a_Z) + static void ChangeDoor(cChunkInterface & a_ChunkInterface, int a_X, int a_Y, int a_Z) { - NIBBLETYPE OldMetaData = a_ChunkInterface->GetBlockMeta(a_X, a_Y, a_Z); + NIBBLETYPE OldMetaData = a_ChunkInterface.GetBlockMeta(a_X, a_Y, a_Z); - a_ChunkInterface->SetBlockMeta(a_X, a_Y, a_Z, ChangeStateMetaData(OldMetaData)); + a_ChunkInterface.SetBlockMeta(a_X, a_Y, a_Z, ChangeStateMetaData(OldMetaData)); if (OldMetaData & 8) { // Current block is top of the door - BLOCKTYPE BottomBlock = a_ChunkInterface->GetBlock(a_X, a_Y - 1, a_Z); - NIBBLETYPE BottomMeta = a_ChunkInterface->GetBlockMeta(a_X, a_Y - 1, a_Z); + BLOCKTYPE BottomBlock = a_ChunkInterface.GetBlock(a_X, a_Y - 1, a_Z); + NIBBLETYPE BottomMeta = a_ChunkInterface.GetBlockMeta(a_X, a_Y - 1, a_Z); if (IsDoor(BottomBlock) && !(BottomMeta & 8)) { - a_ChunkInterface->SetBlockMeta(a_X, a_Y - 1, a_Z, ChangeStateMetaData(BottomMeta)); + a_ChunkInterface.SetBlockMeta(a_X, a_Y - 1, a_Z, ChangeStateMetaData(BottomMeta)); } } else { // Current block is bottom of the door - BLOCKTYPE TopBlock = a_ChunkInterface->GetBlock(a_X, a_Y + 1, a_Z); - NIBBLETYPE TopMeta = a_ChunkInterface->GetBlockMeta(a_X, a_Y + 1, a_Z); + BLOCKTYPE TopBlock = a_ChunkInterface.GetBlock(a_X, a_Y + 1, a_Z); + NIBBLETYPE TopMeta = a_ChunkInterface.GetBlockMeta(a_X, a_Y + 1, a_Z); if (IsDoor(TopBlock) && (TopMeta & 8)) { - a_ChunkInterface->SetBlockMeta(a_X, a_Y + 1, a_Z, ChangeStateMetaData(TopMeta)); + a_ChunkInterface.SetBlockMeta(a_X, a_Y + 1, a_Z, ChangeStateMetaData(TopMeta)); } } } -- cgit v1.2.3 From cf3b4ec226034b006fd646b395f4e8a609f6f378 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 1 Feb 2014 06:01:13 -0800 Subject: Changed Signiture of OnDestroyedByPlayer --- src/Blocks/BlockDoor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 31d1bb797..2da561952 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -3,7 +3,7 @@ #include "BlockHandler.h" #include "../Entities/Player.h" - +#include "Chunk.h" -- cgit v1.2.3 From 8464f689ea214d3c30105ae58539885cf1268317 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 4 Feb 2014 10:59:05 -0800 Subject: Improved Type safety of eBlockFace May Fix #640 --- src/Blocks/BlockDoor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 2da561952..ef0dbb787 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -15,13 +15,13 @@ public: cBlockDoorHandler(BLOCKTYPE a_BlockType); virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override; - virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; + virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; virtual const char * GetStepSound(void) override; virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer * a_Player, - int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, + int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override @@ -54,7 +54,7 @@ public: virtual void OnPlacedByPlayer( cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, - int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, + int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta ) override; -- cgit v1.2.3 From 84913299f45a28d3bd6146b3decbf14764449030 Mon Sep 17 00:00:00 2001 From: Tycho Date: Thu, 27 Feb 2014 11:33:35 -0800 Subject: Added some Metadate rotaters using templated Mixin --- src/Blocks/BlockDoor.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index ef0dbb787..c3647b203 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -9,8 +9,9 @@ class cBlockDoorHandler : - public cBlockHandler + public cMetaRotater { + typedef super cMetaRotater; public: cBlockDoorHandler(BLOCKTYPE a_BlockType); @@ -167,6 +168,60 @@ public: } + virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override + { + if (a_Meta & 0x08) + { + return a_Meta; + } + else + { + return super::MetaRotateCCW(a_Meta); + } + } + + + + virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override + { + if (a_Meta & 0x08) + { + return a_Meta; + } + else + { + return super::MetaRotateCW(a_Meta); + } + } + + + + virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override + { + if (a_Meta & 0x08) + { + return a_Meta; + } + else + { + return super::MetaMirrorXY(a_Meta); + } + } + + + + virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override + { + if (a_Meta & 0x08) + { + return a_Meta; + } + else + { + return super::MetaMirrorYZ(a_Meta); + } + } + } ; -- cgit v1.2.3 From 65edffd5b04623dcd4cebbd1afb2575e98eee5db Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 1 Mar 2014 10:04:50 -0800 Subject: Implemented Rotations --- src/Blocks/BlockDoor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index c3647b203..8e3f2d83f 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -4,14 +4,15 @@ #include "BlockHandler.h" #include "../Entities/Player.h" #include "Chunk.h" +#include "MetaRotater.h" class cBlockDoorHandler : - public cMetaRotater + public cMetaRotater { - typedef super cMetaRotater; + typedef super cMetaRotater; public: cBlockDoorHandler(BLOCKTYPE a_BlockType); -- cgit v1.2.3 From 5093b75ef1488b3687e1c54c893ab68b4475e451 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 1 Mar 2014 10:14:24 -0800 Subject: Revesed typedef --- src/Blocks/BlockDoor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 8e3f2d83f..0caeb7dba 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -12,7 +12,7 @@ class cBlockDoorHandler : public cMetaRotater { - typedef super cMetaRotater; + typedef cMetaRotater super; public: cBlockDoorHandler(BLOCKTYPE a_BlockType); -- cgit v1.2.3 From a38be148ba980e7d54bf72c9056502850d81c77a Mon Sep 17 00:00:00 2001 From: Tycho Date: Sun, 2 Mar 2014 12:33:08 -0800 Subject: Reformatted --- src/Blocks/BlockDoor.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 0caeb7dba..ef73a5d42 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -10,9 +10,9 @@ class cBlockDoorHandler : - public cMetaRotater + public cMetaRotater { - typedef cMetaRotater super; + typedef cMetaRotater super; public: cBlockDoorHandler(BLOCKTYPE a_BlockType); -- cgit v1.2.3 From d4a5b16c52c41da59d2fe3405570653521e5d36e Mon Sep 17 00:00:00 2001 From: Howaner Date: Wed, 5 Mar 2014 15:10:20 +0100 Subject: Add data backsending, when the Client interacts a Block and the Interact is cancelled. --- src/Blocks/BlockDoor.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index ef0dbb787..68be2c658 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -16,6 +16,7 @@ public: virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override; virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override; + virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override; virtual const char * GetStepSound(void) override; -- cgit v1.2.3 From 2343b0dfbe12f6db76de1b4ed03cd902975d77b3 Mon Sep 17 00:00:00 2001 From: narroo Date: Sun, 23 Mar 2014 22:11:01 -0400 Subject: Added MetaRotate/Mirror Support for a number of classes. --- src/Blocks/BlockDoor.h | 66 ++++++-------------------------------------------- 1 file changed, 7 insertions(+), 59 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 981774c17..066e1ab28 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -21,6 +21,10 @@ public: virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override; virtual const char * GetStepSound(void) override; + virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override; + virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override; + virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override; + virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override; virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer * a_Player, @@ -142,14 +146,14 @@ public: static void ChangeDoor(cChunkInterface & a_ChunkInterface, int a_X, int a_Y, int a_Z) { NIBBLETYPE OldMetaData = a_ChunkInterface.GetBlockMeta(a_X, a_Y, a_Z); - + a_ChunkInterface.SetBlockMeta(a_X, a_Y, a_Z, ChangeStateMetaData(OldMetaData)); - + if (OldMetaData & 8) { // Current block is top of the door BLOCKTYPE BottomBlock = a_ChunkInterface.GetBlock(a_X, a_Y - 1, a_Z); - NIBBLETYPE BottomMeta = a_ChunkInterface.GetBlockMeta(a_X, a_Y - 1, a_Z); + NIBBLETYPE BottomMeta = a_ChunkInterface.GetBlockMeta(a_X, a_Y - 1, a_Z); if (IsDoor(BottomBlock) && !(BottomMeta & 8)) { @@ -168,62 +172,6 @@ public: } } } - - - virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override - { - if (a_Meta & 0x08) - { - return a_Meta; - } - else - { - return super::MetaRotateCCW(a_Meta); - } - } - - - - virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override - { - if (a_Meta & 0x08) - { - return a_Meta; - } - else - { - return super::MetaRotateCW(a_Meta); - } - } - - - - virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override - { - if (a_Meta & 0x08) - { - return a_Meta; - } - else - { - return super::MetaMirrorXY(a_Meta); - } - } - - - - virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override - { - if (a_Meta & 0x08) - { - return a_Meta; - } - else - { - return super::MetaMirrorYZ(a_Meta); - } - } - } ; -- cgit v1.2.3 From 3df4f8609dc2e28c2328ddf448fa53f5483f4262 Mon Sep 17 00:00:00 2001 From: narroo Date: Tue, 25 Mar 2014 17:26:13 -0400 Subject: Fixed spelling; Rotater to Rotator. --- src/Blocks/BlockDoor.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index 066e1ab28..797fe484c 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -4,15 +4,15 @@ #include "BlockHandler.h" #include "../Entities/Player.h" #include "Chunk.h" -#include "MetaRotater.h" +#include "MetaRotator.h" class cBlockDoorHandler : - public cMetaRotater + public cMetaRotator { - typedef cMetaRotater super; + typedef cMetaRotator super; public: cBlockDoorHandler(BLOCKTYPE a_BlockType); -- cgit v1.2.3