From 1cca9b13b3d320ff767cfc552413265b2ef6e0d6 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 6 Jun 2012 20:18:50 +0000 Subject: Item-dropping code rewritten and centralized - now there's only one place to modify if we want to split or merge same-item drops: cWorld:SpawnItemPickups(). Also, mined blocks can now drop more items, and they recognize if they're being mined by the correct tool. git-svn-id: http://mc-server.googlecode.com/svn/trunk@561 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cWorld.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/cWorld.h') diff --git a/source/cWorld.h b/source/cWorld.h index 3f8080f06..c3a521d1b 100644 --- a/source/cWorld.h +++ b/source/cWorld.h @@ -19,6 +19,7 @@ #include "ChunkSender.h" #include "Defines.h" #include "LightingThread.h" +#include "cItem.h" @@ -206,14 +207,20 @@ public: char GetBlockSkyLight( int a_X, int a_Y, int a_Z ); //tolua_export // TODO: char GetBlockActualLight(int a_BlockX, int a_BlockY, int a_BlockZ); // tolua_export + /// Spawns item pickups for each item in the list. May compress pickups if too many entities: + void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0); + + /// Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified: + void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ); + /// Replaces world blocks with a_Blocks, if they are of type a_FilterBlockType void ReplaceBlocks(const sSetBlockVector & a_Blocks, BLOCKTYPE a_FilterBlockType); /// Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read. bool GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure); - bool DigBlock( int a_X, int a_Y, int a_Z, cItem & a_PickupItem ); //tolua_export - void SendBlockTo( int a_X, int a_Y, int a_Z, cPlayer* a_Player ); //tolua_export + bool DigBlock (int a_X, int a_Y, int a_Z); //tolua_export + void SendBlockTo(int a_X, int a_Y, int a_Z, cPlayer * a_Player ); //tolua_export const double & GetSpawnX() { return m_SpawnX; } //tolua_export const double & GetSpawnY(); //tolua_export -- cgit v1.2.3