diff options
Diffstat (limited to '')
-rw-r--r-- | source/Blocks/BlockDispenser.h | 9 | ||||
-rw-r--r-- | source/Blocks/BlockDoor.cpp | 17 | ||||
-rw-r--r-- | source/Blocks/BlockFenceGate.h | 3 | ||||
-rw-r--r-- | source/Blocks/BlockSnow.h | 2 |
4 files changed, 15 insertions, 16 deletions
diff --git a/source/Blocks/BlockDispenser.h b/source/Blocks/BlockDispenser.h index 4a54fbde5..581e0f49b 100644 --- a/source/Blocks/BlockDispenser.h +++ b/source/Blocks/BlockDispenser.h @@ -1,10 +1,17 @@ +
#pragma once
+
#include "BlockEntity.h"
#include "../World.h"
#include "../Piston.h"
#include "../Player.h"
-class cBlockDispenserHandler : public cBlockEntityHandler
+
+
+
+
+class cBlockDispenserHandler :
+ public cBlockEntityHandler
{
public:
cBlockDispenserHandler(BLOCKTYPE a_BlockType)
diff --git a/source/Blocks/BlockDoor.cpp b/source/Blocks/BlockDoor.cpp index 1976e2f20..a2c352d7b 100644 --- a/source/Blocks/BlockDoor.cpp +++ b/source/Blocks/BlockDoor.cpp @@ -69,19 +69,10 @@ void cBlockDoorHandler::PlaceBlock(cWorld * a_World, cPlayer * a_Player, NIBBLET {
a_BlockMeta = cDoors::RotationToMetaData(a_Player->GetRotation());
char a_TopBlockMeta = 8;
- if((a_BlockMeta == 0) && (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ - 1) == m_BlockType))
- {
- a_TopBlockMeta = 9;
- }
- else if((a_BlockMeta == 1) && (a_World->GetBlock(a_BlockX + 1, a_BlockY, a_BlockZ) == m_BlockType))
- {
- a_TopBlockMeta = 9;
- }
- else if((a_BlockMeta == 2) && (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ + 1) == m_BlockType))
- {
- a_TopBlockMeta = 9;
- }
- else if((a_BlockMeta == 3) && (a_World->GetBlock(a_BlockX - 1, a_BlockY, a_BlockZ) == m_BlockType))
+ if( (a_BlockMeta == 0) && (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ - 1) == m_BlockType) ||
+ (a_BlockMeta == 1) && (a_World->GetBlock(a_BlockX + 1, a_BlockY, a_BlockZ) == m_BlockType) ||
+ (a_BlockMeta == 2) && (a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ + 1) == m_BlockType) ||
+ (a_BlockMeta == 3) && (a_World->GetBlock(a_BlockX - 1, a_BlockY, a_BlockZ) == m_BlockType))
{
a_TopBlockMeta = 9;
}
diff --git a/source/Blocks/BlockFenceGate.h b/source/Blocks/BlockFenceGate.h index 072eb9c3a..0390bcc7d 100644 --- a/source/Blocks/BlockFenceGate.h +++ b/source/Blocks/BlockFenceGate.h @@ -34,7 +34,8 @@ public: char OldMetaData = a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
char NewMetaData = cDoors::RotationToMetaData(a_Player->GetRotation() + 270);
OldMetaData ^= 4; //Toggle the gate
- if((OldMetaData & 1) == (NewMetaData & 1)){
+ if((OldMetaData & 1) == (NewMetaData & 1))
+ {
//Standing in front of the gate - apply new direction
a_World->SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, (OldMetaData & 4) | (NewMetaData & 3));
}
diff --git a/source/Blocks/BlockSnow.h b/source/Blocks/BlockSnow.h index 7d29c67f2..2a5009b69 100644 --- a/source/Blocks/BlockSnow.h +++ b/source/Blocks/BlockSnow.h @@ -25,7 +25,7 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
- a_Pickups.push_back(cItem(E_ITEM_SNOWBALL, 4, 0));
+ a_Pickups.push_back(cItem(E_ITEM_SNOWBALL, 1, 0));
}
|