diff options
author | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-19 22:19:36 +0100 |
---|---|---|
committer | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-19 22:19:36 +0100 |
commit | 05d71675f69e13d8ab590a33b38ee6d0f8a77b6f (patch) | |
tree | 97453620e42516f0e6da1e969397e14becdc15b4 /source/Blocks | |
parent | Implemented double doors (diff) | |
download | cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar.gz cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar.bz2 cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar.lz cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar.xz cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.tar.zst cuberite-05d71675f69e13d8ab590a33b38ee6d0f8a77b6f.zip |
Diffstat (limited to 'source/Blocks')
-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));
}
|