summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-13 00:24:32 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-13 00:24:32 +0200
commit5f72cdac3880f22590b30217aeab6022dc64cc69 (patch)
treef79245b62979addf8a02ee561d20a390f82631c4 /src/Chunk.cpp
parentComment grammar correction (diff)
parentcNBTChunkSerializer: Fixed alignment. (diff)
downloadcuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar.gz
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar.bz2
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar.lz
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar.xz
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.tar.zst
cuberite-5f72cdac3880f22590b30217aeab6022dc64cc69.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 1e80eb61b..c004a6408 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1301,6 +1301,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:
@@ -1431,6 +1432,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:
@@ -2150,7 +2152,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;
@@ -2530,8 +2532,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);
}