summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockTorch.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-15 21:18:11 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-15 21:18:11 +0100
commit8090c13cde2d61a0330f1e262de7526318a0965d (patch)
tree8a5f53d6113c25ee49caacea5c52548dc1585f91 /source/Blocks/BlockTorch.h
parentDoxygen: Alpha-sorted class member docs (diff)
downloadcuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.gz
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.bz2
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.lz
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.xz
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.zst
cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.zip
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockTorch.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/Blocks/BlockTorch.h b/source/Blocks/BlockTorch.h
index 43c5cdb4c..3cc487421 100644
--- a/source/Blocks/BlockTorch.h
+++ b/source/Blocks/BlockTorch.h
@@ -98,6 +98,7 @@ public:
}
+ /*
virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace) override
{
if (TorchCanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace))
@@ -107,12 +108,16 @@ public:
return (FindSuitableFace(a_World, a_BlockX, a_BlockY, a_BlockZ) != BLOCK_FACE_BOTTOM);
}
+ */
- virtual bool CanBeAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
+ virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
- char Face = cTorch::MetaDataToDirection(a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ));
- return TorchCanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, Face);
+ // TODO: Use cTorch::AdjustCoordsByMeta(), then cChunk::UnboundedRelGetBlock() and finally some comparison
+ char Face = cTorch::MetaDataToDirection(a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ));
+ int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
+ int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
+ return TorchCanBePlacedAt(a_Chunk.GetWorld(), BlockX, a_RelY, BlockZ, Face);
}