summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockTorch.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-02-01 00:17:41 +0100
committerTycho <work.tycho+git@gmail.com>2014-02-01 00:17:41 +0100
commit25ec7750aac9800bec83a844020a6eeda5cd4d74 (patch)
tree1820a0856969583238d85b2a68d299e55807f951 /src/Blocks/BlockTorch.h
parentChanged it so std was actually set to c++11 in clang not gcc on OS X (diff)
downloadcuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar.gz
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar.bz2
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar.lz
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar.xz
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.tar.zst
cuberite-25ec7750aac9800bec83a844020a6eeda5cd4d74.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockTorch.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Blocks/BlockTorch.h b/src/Blocks/BlockTorch.h
index faba9c4f5..a9a3bd1f8 100644
--- a/src/Blocks/BlockTorch.h
+++ b/src/Blocks/BlockTorch.h
@@ -18,7 +18,7 @@ public:
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
@@ -28,7 +28,7 @@ public:
if ((a_BlockFace == BLOCK_FACE_TOP) || (a_BlockFace == BLOCK_FACE_BOTTOM))
{
- a_BlockFace = FindSuitableFace(a_World, a_BlockX, a_BlockY, a_BlockZ); // Top or bottom faces clicked, find a suitable face
+ a_BlockFace = FindSuitableFace(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ); // Top or bottom faces clicked, find a suitable face
if (a_BlockFace == BLOCK_FACE_NONE)
{
// Client wouldn't have sent anything anyway, but whatever
@@ -39,10 +39,10 @@ public:
{
// Not top or bottom faces, try to preserve whatever face was clicked
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, true);
- if (!CanBePlacedOn(a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ), a_BlockFace))
+ if (!CanBePlacedOn(a_ChunkInterface->GetBlock(a_BlockX, a_BlockY, a_BlockZ), a_BlockFace))
{
// Torch couldn't be placed on whatever face was clicked, last ditch resort - find another face
- a_BlockFace = FindSuitableFace(a_World, a_BlockX, a_BlockY, a_BlockZ);
+ a_BlockFace = FindSuitableFace(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
if (a_BlockFace == BLOCK_FACE_NONE)
{
return false;
@@ -110,12 +110,12 @@ public:
/// Finds a suitable face to place the torch, returning BLOCK_FACE_NONE on failure
- static char FindSuitableFace(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
+ static char FindSuitableFace(cChunkInterface * a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
{
for (int i = BLOCK_FACE_YM; i <= BLOCK_FACE_XP; i++) // Loop through all directions
{
AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, i, true);
- BLOCKTYPE BlockInQuestion = a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
+ 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
((BlockInQuestion == E_BLOCK_GLASS) ||
@@ -142,7 +142,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
{
char Face = MetaDataToDirection(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ));