From 6ad8553a3a9095bd5a8c25085fa0bb209d411048 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 26 Aug 2012 17:50:42 +0000 Subject: Added basic noteblocks, finished sign storage in Anvil (patch contributed by l0udPL) http://forum.mc-server.org/showthread.php?tid=528 git-svn-id: http://mc-server.googlecode.com/svn/trunk@793 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cChunk.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/cChunk.cpp') diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 8fb4570ae..c479a7bc3 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -17,6 +17,7 @@ #include "cChestEntity.h" #include "cFurnaceEntity.h" #include "cSignEntity.h" +#include "cNoteEntity.h" #include "cTorch.h" #include "cLadder.h" #include "cPickup.h" @@ -962,6 +963,15 @@ void cChunk::CreateBlockEntities(void) } break; } + + case E_BLOCK_NOTE_BLOCK: + { + if (!HasBlockEntityAt(x + m_PosX * Width, y + m_PosY * Height, z + m_PosZ * Width)) + { + m_BlockEntities.push_back(new cNoteEntity(x + m_PosX * Width, y + m_PosY * Height, z + m_PosZ * Width, m_World) ); + } + break; + } } // switch (BlockType) } // for y } // for z @@ -1087,6 +1097,11 @@ void cChunk::SetBlock( int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType AddBlockEntity( new cSignEntity( (ENUM_BLOCK_ID)a_BlockType, WorldPos.x, WorldPos.y, WorldPos.z, m_World) ); break; } + case E_BLOCK_NOTE_BLOCK: + { + AddBlockEntity(new cNoteEntity(WorldPos.x, WorldPos.y, WorldPos.z, m_World)); + break; + } } // switch (a_BlockType) } -- cgit v1.2.3