From a5c2d639c612031331a668a483339f3025c7041f Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 20 Nov 2013 21:53:29 +0100 Subject: Added cWorld:ForEachBlockEntityInChunk() and cWorld:DoWithBlockEntityAt() functions. Also exported them to the Lua API. --- source/Chunk.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/Chunk.h') diff --git a/source/Chunk.h b/source/Chunk.h index 0d7479347..895b407a3 100644 --- a/source/Chunk.h +++ b/source/Chunk.h @@ -207,6 +207,9 @@ public: /// Calls the callback if the entity with the specified ID is found, with the entity object as the callback param. Returns true if entity found. bool DoWithEntityByID(int a_EntityID, cEntityCallback & a_Callback, bool & a_CallbackResult); // Lua-accessible + /// Calls the callback for each block entity; returns true if all block entities processed, false if the callback aborted by returning true + bool ForEachBlockEntity(cBlockEntityCallback & a_Callback); // Lua-accessible + /// Calls the callback for each chest; returns true if all chests processed, false if the callback aborted by returning true bool ForEachChest(cChestCallback & a_Callback); // Lua-accessible @@ -222,6 +225,9 @@ public: /// Calls the callback for each furnace; returns true if all furnaces processed, false if the callback aborted by returning true bool ForEachFurnace(cFurnaceCallback & a_Callback); // Lua-accessible + /// Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, true if found + bool DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBlockEntityCallback & a_Callback); // Lua-acessible + /// Calls the callback for the chest at the specified coords; returns false if there's no chest at those coords, true if found bool DoWithChestAt(int a_BlockX, int a_BlockY, int a_BlockZ, cChestCallback & a_Callback); // Lua-acessible -- cgit v1.2.3