summaryrefslogtreecommitdiffstats
path: root/source/cWorld.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-17 21:58:39 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-17 21:58:39 +0200
commite5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d (patch)
treed13286487b7d74dc3c56cf3c529909e31f00b8ff /source/cWorld.h
parentLogs completion of chunk saving (FS #215) (diff)
downloadcuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar.gz
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar.bz2
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar.lz
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar.xz
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.tar.zst
cuberite-e5fdc133bc6e03c4e8e1f1707ff13f4c836d2b8d.zip
Diffstat (limited to 'source/cWorld.h')
-rw-r--r--source/cWorld.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/source/cWorld.h b/source/cWorld.h
index c4ce91474..b356bdf0a 100644
--- a/source/cWorld.h
+++ b/source/cWorld.h
@@ -39,9 +39,16 @@ class cEntity;
class cBlockEntity;
class cWorldGenerator; // The generator that actually generates the chunks for a single world
class cChunkGenerator; // The thread responsible for generating chunks
+class cChestEntity;
+class cFurnaceEntity;
+
typedef std::list< cPlayer * > cPlayerList;
-typedef cItemCallback<cPlayer> cPlayerListCallback;
-typedef cItemCallback<cEntity> cEntityCallback;
+
+typedef cItemCallback<cPlayer> cPlayerListCallback;
+typedef cItemCallback<cEntity> cEntityCallback;
+typedef cItemCallback<cChestEntity> cChestCallback;
+typedef cItemCallback<cFurnaceEntity> cFurnaceCallback;
+
@@ -238,9 +245,20 @@ public:
inline cWaterSimulator *GetWaterSimulator() { return m_WaterSimulator; }
inline cLavaSimulator *GetLavaSimulator() { return m_LavaSimulator; }
- // TODO: This interface is dangerous! Export as a set of specific action functions for Lua: GetChestItem, GetFurnaceItem, SetFurnaceItem, SetSignLines etc.
- // _X 2012_02_21: This function always returns NULL
- OBSOLETE cBlockEntity * GetBlockEntity( int a_X, int a_Y, int a_Z ); //tolua_export
+ /// Calls the callback for each chest in the specified chunk; returns true if all chests processed, false if the callback aborted by returning true
+ bool ForEachChestInChunk (int a_ChunkX, int a_ChunkZ, cChestCallback & a_Callback); // Exported in ManualBindings.cpp
+
+ /// Calls the callback for each furnace in the specified chunk; returns true if all furnaces processed, false if the callback aborted by returning true
+ bool ForEachFurnaceInChunk(int a_ChunkX, int a_ChunkZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp
+
+ /// 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); // Exported in ManualBindings.cpp
+
+ /// Calls the callback for the furnace at the specified coords; returns false if there's no furnace at those coords, true if found
+ bool DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp
+
+ /// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
+ bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // tolua_export
/// a_Player is using block entity at [x, y, z], handle that:
void UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z) {m_ChunkMap->UseBlockEntity(a_Player, a_X, a_Y, a_Z); }