summaryrefslogtreecommitdiffstats
path: root/AnvilStats/Callback.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 15:33:45 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 15:33:45 +0200
commitcead22a206617207d8f757b57e064eea39d0b2f2 (patch)
tree0260f222fbd1c2f89201653ead9735318c8a552e /AnvilStats/Callback.h
parentAnvilStats: Fixed biome format string (diff)
downloadcuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar.gz
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar.bz2
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar.lz
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar.xz
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.tar.zst
cuberite-cead22a206617207d8f757b57e064eea39d0b2f2.zip
Diffstat (limited to 'AnvilStats/Callback.h')
-rw-r--r--AnvilStats/Callback.h44
1 files changed, 43 insertions, 1 deletions
diff --git a/AnvilStats/Callback.h b/AnvilStats/Callback.h
index 66d6bcfae..52d2e27eb 100644
--- a/AnvilStats/Callback.h
+++ b/AnvilStats/Callback.h
@@ -13,6 +13,13 @@
+// fwd:
+class cParsedNBT;
+
+
+
+
+
/** The base class for all chunk-processor callbacks, declares the interface.
The processor calls each virtual function in the order they are declared here with the specified args.
If the function returns true, the processor moves on to next chunk and starts calling the callbacks again from start with
@@ -68,7 +75,42 @@ public:
*/
virtual bool OnEmptySection(unsigned char a_Y) { return false; }
- // TODO: entities, tile-entities, tile-ticks
+ /** Called for each entity in the chunk.
+ Common parameters are parsed from the NBT.
+ The callback may parse any other param from the a_NBT and a_NBTTag parameters.
+ The a_NBTTag parameter points to the entity compound tag inside the Entities tag.
+ */
+ virtual bool OnEntity(
+ const AString & a_EntityType,
+ double a_PosX, double a_PosY, double a_PosZ,
+ double a_SpeedX, double a_SpeedY, double a_SpeedZ,
+ float a_Yaw, float a_Pitch,
+ float a_FallDistance,
+ short a_FireTicksLeft,
+ short a_AirTicks,
+ char a_IsOnGround,
+ cParsedNBT & a_NBT,
+ int a_NBTTag
+ ) { return true; }
+
+ /** Called for each tile entity in the chunk.
+ Common parameters are parsed from the NBT.
+ The callback may parse any other param from the a_NBT and a_NBTTag parameters.
+ The a_NBTTag parameter points to the tile entity compound tag inside the TileEntities tag.
+ */
+ virtual bool OnTileEntity(
+ const AString & a_EntityType,
+ int a_PosX, int a_PosY, int a_PosZ,
+ cParsedNBT & a_NBT,
+ int a_NBTTag
+ ) { return true; }
+
+ /// Called for each tile tick in the chunk
+ virtual bool OnTileTick(
+ int a_BlockType,
+ int a_TicksLeft,
+ int a_PosX, int a_PosY, int a_PosZ
+ ) { return true; }
} ;
typedef std::vector<cCallback *> cCallbacks;