summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-07 00:50:22 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-07 00:50:22 +0200
commit9e44b0aae164f2456a452714f869cc9670732d8e (patch)
tree952cf9c8aca9c1b200b8285586e48e50a0188667 /src/Chunk.cpp
parentFixed OpenSSL programs and tests being generated when testing disabled. (diff)
downloadcuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar.gz
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar.bz2
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar.lz
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar.xz
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.tar.zst
cuberite-9e44b0aae164f2456a452714f869cc9670732d8e.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 0fee40cac..c1f9dbfd6 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1297,6 +1297,7 @@ void cChunk::CreateBlockEntities(void)
switch (BlockType)
{
case E_BLOCK_BEACON:
+ case E_BLOCK_TRAPPED_CHEST:
case E_BLOCK_CHEST:
case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_DISPENSER:
@@ -1427,6 +1428,7 @@ void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType,
switch (a_BlockType)
{
case E_BLOCK_BEACON:
+ case E_BLOCK_TRAPPED_CHEST:
case E_BLOCK_CHEST:
case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_DISPENSER:
@@ -2121,7 +2123,7 @@ bool cChunk::DoWithChestAt(int a_BlockX, int a_BlockY, int a_BlockZ, cChestCallb
{
continue;
}
- if ((*itr)->GetBlockType() != E_BLOCK_CHEST)
+ if (((*itr)->GetBlockType() != E_BLOCK_CHEST) && ((*itr)->GetBlockType() != E_BLOCK_TRAPPED_CHEST) /* Trapped chests use normal chests' handlers */)
{
// There is a block entity here, but of different type. No other block entity can be here, so we can safely bail out
return false;
@@ -2501,8 +2503,8 @@ cChunk * cChunk::GetRelNeighborChunk(int a_RelX, int a_RelZ)
{
int BlockX = m_PosX * cChunkDef::Width + a_RelX;
int BlockZ = m_PosZ * cChunkDef::Width + a_RelZ;
- int BlockY, ChunkX, ChunkZ;
- AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
+ int ChunkX, ChunkZ;
+ BlockToChunk(BlockX, BlockZ, ChunkX, ChunkZ);
return m_ChunkMap->GetChunkNoLoad(ChunkX, ZERO_CHUNK_Y, ChunkZ);
}