summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 19:30:31 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-22 19:30:31 +0200
commit18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2 (patch)
tree089b3be905aa030367925762c58bd30b08f5f3f6 /src/Blocks
parentMerge branch 'master' into saplingsandleaves (diff)
parentUpdated prefabs to current Gallery content. (diff)
downloadcuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar.gz
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar.bz2
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar.lz
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar.xz
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.tar.zst
cuberite-18a0b60c12daec4c04fd3cb9c4422e69de4fcbf2.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockBed.cpp4
-rw-r--r--src/Blocks/BlockHandler.cpp4
-rw-r--r--src/Blocks/BlockTorch.h7
-rw-r--r--src/Blocks/BlockVine.h2
-rw-r--r--src/Blocks/BroadcastInterface.h2
-rw-r--r--src/Blocks/ChunkInterface.h4
6 files changed, 12 insertions, 11 deletions
diff --git a/src/Blocks/BlockBed.cpp b/src/Blocks/BlockBed.cpp
index fbc82b440..80ac18560 100644
--- a/src/Blocks/BlockBed.cpp
+++ b/src/Blocks/BlockBed.cpp
@@ -27,8 +27,8 @@ void cBlockBedHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInt
{
NIBBLETYPE OldMeta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- Vector3i ThisPos( a_BlockX, a_BlockY, a_BlockZ );
- Vector3i Direction = MetaDataToDirection( OldMeta & 0x7 );
+ Vector3i ThisPos( a_BlockX, a_BlockY, a_BlockZ);
+ Vector3i Direction = MetaDataToDirection( OldMeta & 0x7);
if (OldMeta & 0x8)
{
// Was pillow
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 34014af7a..3e16f970a 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -175,7 +175,7 @@ public:
cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
{
- switch(a_BlockType)
+ switch (a_BlockType)
{
// Block handlers, alphabetically sorted:
case E_BLOCK_ACACIA_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType);
@@ -254,7 +254,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_NEW_LOG: return new cBlockSidewaysHandler (a_BlockType);
case E_BLOCK_NOTE_BLOCK: return new cBlockNoteHandler (a_BlockType);
case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType);
- case E_BLOCK_PISTON_EXTENSION: return new cBlockPistonHeadHandler ( );
+ case E_BLOCK_PISTON_EXTENSION: return new cBlockPistonHeadHandler;
case E_BLOCK_PLANKS: return new cBlockPlanksHandler (a_BlockType);
case E_BLOCK_POTATOES: return new cBlockCropsHandler (a_BlockType);
case E_BLOCK_POWERED_RAIL: return new cBlockRailHandler (a_BlockType);
diff --git a/src/Blocks/BlockTorch.h b/src/Blocks/BlockTorch.h
index 73f2bf9a8..c73118870 100644
--- a/src/Blocks/BlockTorch.h
+++ b/src/Blocks/BlockTorch.h
@@ -99,7 +99,7 @@ public:
static bool CanBePlacedOn(BLOCKTYPE a_BlockType, eBlockFace a_BlockFace)
{
- if ( !cBlockInfo::FullyOccupiesVoxel(a_BlockType) )
+ if (!cBlockInfo::FullyOccupiesVoxel(a_BlockType))
{
return (a_BlockFace == BLOCK_FACE_TOP); // Allow placement only when torch upright (for glass, etc.); exceptions won't even be sent by client, no need to handle
}
@@ -119,7 +119,8 @@ public:
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face, true);
BLOCKTYPE BlockInQuestion = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ);
- if ( // If on a block that can only hold a torch if torch is standing on it, return that face
+ // If on a block that can only hold a torch if torch is standing on it, return that face
+ if (
((BlockInQuestion == E_BLOCK_GLASS) ||
(BlockInQuestion == E_BLOCK_FENCE) ||
(BlockInQuestion == E_BLOCK_NETHER_BRICK_FENCE) ||
@@ -167,7 +168,7 @@ public:
// No need to check for upright orientation, it was done when the torch was placed
return true;
}
- else if ( !cBlockInfo::FullyOccupiesVoxel(BlockInQuestion) )
+ else if (!cBlockInfo::FullyOccupiesVoxel(BlockInQuestion))
{
return false;
}
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h
index c2d82eb4d..61092af3e 100644
--- a/src/Blocks/BlockVine.h
+++ b/src/Blocks/BlockVine.h
@@ -59,7 +59,7 @@ public:
static char MetaDataToDirection(NIBBLETYPE a_MetaData)
{
- switch(a_MetaData)
+ switch (a_MetaData)
{
case 0x1: return BLOCK_FACE_NORTH;
case 0x4: return BLOCK_FACE_SOUTH;
diff --git a/src/Blocks/BroadcastInterface.h b/src/Blocks/BroadcastInterface.h
index c8593c76a..cf332b153 100644
--- a/src/Blocks/BroadcastInterface.h
+++ b/src/Blocks/BroadcastInterface.h
@@ -6,7 +6,7 @@ class cBroadcastInterface
public:
virtual ~cBroadcastInterface() {}
- virtual void BroadcastUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) = 0;
+ virtual void BroadcastUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
virtual void BroadcastSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL) = 0;
virtual void BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL) = 0;
};
diff --git a/src/Blocks/ChunkInterface.h b/src/Blocks/ChunkInterface.h
index 3bab60be6..dea9d7c7e 100644
--- a/src/Blocks/ChunkInterface.h
+++ b/src/Blocks/ChunkInterface.h
@@ -61,9 +61,9 @@ public:
m_ChunkMap->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
}
- void FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta )
+ void FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
- FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta );
+ FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
}
void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)