summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockLadder.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/BlockLadder.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/BlockLadder.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/source/Blocks/BlockLadder.h b/source/Blocks/BlockLadder.h
index 5f0b09737..280f0deb1 100644
--- a/source/Blocks/BlockLadder.h
+++ b/source/Blocks/BlockLadder.h
@@ -69,20 +69,13 @@ public:
}
- virtual bool CanBePlacedAt(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace) override
+ virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
- if (LadderCanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace))
- {
- return true;
- }
- return (FindSuitableBlockFace(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
- {
- char BlockFace = cLadder::MetaDataToDirection(a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ));
- return CanBePlacedAt(a_World, a_BlockX, a_BlockY, a_BlockZ, BlockFace);
+ // TODO: Use cTorch::AdjustCoordsByMeta(), then cChunk::UnboundedRelGetBlock() and finally some comparison
+ char BlockFace = cLadder::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 LadderCanBePlacedAt(a_Chunk.GetWorld(), BlockX, a_RelY, BlockZ, BlockFace);
}