diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 21:10:02 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 21:10:02 +0200 |
commit | b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5 (patch) | |
tree | 089b3be905aa030367925762c58bd30b08f5f3f6 /src/Blocks/BlockHandler.cpp | |
parent | Updated prefabs to current Gallery content. (diff) | |
parent | Merge remote-tracking branch 'origin/master' into saplingsandleaves (diff) | |
download | cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.gz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.bz2 cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.lz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.xz cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.tar.zst cuberite-b5e5586ab04b4cb7d630bc8a4999e23eba71a6e5.zip |
Diffstat (limited to 'src/Blocks/BlockHandler.cpp')
-rw-r--r-- | src/Blocks/BlockHandler.cpp | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index b6ef23cb9..3e16f970a 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -408,39 +408,6 @@ void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_Bl - -void cBlockHandler::OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) -{ -} - - - - - -void cBlockHandler::OnDigging(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) -{ -} - - - - - -void cBlockHandler::OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) -{ -} - - - - - -void cBlockHandler::OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) -{ -} - - - - - void cBlockHandler::ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) { // Setting the meta to a_BlockMeta keeps most textures. The few other blocks have to override this. @@ -451,11 +418,20 @@ void cBlockHandler::ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) -void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ) +void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, bool a_DropVerbatim) { cItems Pickups; NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ); - ConvertToPickups(Pickups, Meta); + + if (!a_DropVerbatim) + { + ConvertToPickups(Pickups, Meta); + } + else + { + // TODO: Add a proper overridable function for this + Pickups.Add(m_BlockType, 1, Meta); + } // Allow plugins to modify the pickups: a_BlockPluginInterface.CallHookBlockToPickups(a_Digger, a_BlockX, a_BlockY, a_BlockZ, m_BlockType, Meta, Pickups); |