diff options
Diffstat (limited to '')
-rw-r--r-- | src/ChunkMap.h | 118 |
1 files changed, 5 insertions, 113 deletions
diff --git a/src/ChunkMap.h b/src/ChunkMap.h index 99a1d764d..d0aeb867c 100644 --- a/src/ChunkMap.h +++ b/src/ChunkMap.h @@ -18,19 +18,6 @@ class cItems; class cChunkStay; class cChunk; class cPlayer; -class cBeaconEntity; -class cBedEntity; -class cBrewingstandEntity; -class cChestEntity; -class cDispenserEntity; -class cDropperEntity; -class cDropSpenserEntity; -class cFurnaceEntity; -class cHopperEntity; -class cNoteEntity; -class cCommandBlockEntity; -class cMobHeadEntity; -class cFlowerPotEntity; class cBlockArea; class cMobCensus; class cMobSpawner; @@ -40,22 +27,9 @@ class cDeadlockDetect; struct SetChunkData; typedef std::list<cClientHandle *> cClientHandleList; -using cEntityCallback = cFunctionRef<bool(cEntity &)>; -using cBeaconCallback = cFunctionRef<bool(cBeaconEntity &)>; -using cBedCallback = cFunctionRef<bool(cBedEntity &)>; -using cBlockEntityCallback = cFunctionRef<bool(cBlockEntity &)>; -using cBrewingstandCallback = cFunctionRef<bool(cBrewingstandEntity &)>; -using cChestCallback = cFunctionRef<bool(cChestEntity &)>; -using cChunkCallback = cFunctionRef<bool(cChunk &)>; -using cDispenserCallback = cFunctionRef<bool(cDispenserEntity &)>; -using cDropperCallback = cFunctionRef<bool(cDropperEntity &)>; -using cDropSpenserCallback = cFunctionRef<bool(cDropSpenserEntity &)>; -using cFurnaceCallback = cFunctionRef<bool(cFurnaceEntity &)>; -using cHopperCallback = cFunctionRef<bool(cHopperEntity &)>; -using cNoteBlockCallback = cFunctionRef<bool(cNoteEntity &)>; -using cCommandBlockCallback = cFunctionRef<bool(cCommandBlockEntity &)>; -using cMobHeadCallback = cFunctionRef<bool(cMobHeadEntity &)>; -using cFlowerPotCallback = cFunctionRef<bool(cFlowerPotEntity &)>; +using cChunkCallback = cFunctionRef<bool(cChunk &)>; +using cEntityCallback = cFunctionRef<bool(cEntity &)>; +using cBlockEntityCallback = cFunctionRef<bool(cBlockEntity &)>; @@ -228,88 +202,9 @@ public: Returns true if all block entities processed, false if the callback aborted by returning true. */ bool ForEachBlockEntityInChunk(int a_ChunkX, int a_ChunkZ, cBlockEntityCallback a_Callback); // Lua-accessible - /** Calls the callback for brewingstand in the specified chunk. - Returns true if all brewingstands processed, false if the callback aborted by returning true. */ - bool ForEachBrewingstandInChunk(int a_ChunkX, int a_ChunkZ, cBrewingstandCallback a_Callback); // Lua-accessible - - /** 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); // Lua-accessible - - /** Calls the callback for each dispenser in the specified chunk. - Returns true if all dispensers processed, false if the callback aborted by returning true. */ - bool ForEachDispenserInChunk(int a_ChunkX, int a_ChunkZ, cDispenserCallback a_Callback); - - /** Calls the callback for each dropper in the specified chunk. - Returns true if all droppers processed, false if the callback aborted by returning true. */ - bool ForEachDropperInChunk(int a_ChunkX, int a_ChunkZ, cDropperCallback a_Callback); - - /** Calls the callback for each dropspenser in the specified chunk. - Returns true if all dropspensers processed, false if the callback aborted by returning true. */ - bool ForEachDropSpenserInChunk(int a_ChunkX, int a_ChunkZ, cDropSpenserCallback a_Callback); - - /** 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); // 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 beacon at the specified coords. - Returns false if there's no beacon at those coords, true if found. */ - bool DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCallback a_Callback); // Lua-acessible - - /** Calls the callback for the bed at the specified coords. - Returns false if there's no bed at those coords, true if found. */ - bool DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback a_Callback); // Lua-acessible - - /** Calls the callback for the brewingstand at the specified coords; returns false if there's no brewingstand at those coords, true if found */ - bool DoWithBrewingstandAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBrewingstandCallback 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 - - /** Calls the callback for the dispenser at the specified coords. - Returns false if there's no dispenser at those coords or callback returns true, returns true if found. */ - bool DoWithDispenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDispenserCallback a_Callback); // Lua-accessible - - /** Calls the callback for the dropper at the specified coords. - Returns false if there's no dropper at those coords or callback returns true, returns true if found. */ - bool DoWithDropperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropperCallback a_Callback); // Lua-accessible - - /** Calls the callback for the dropspenser at the specified coords. - Returns false if there's no dropspenser at those coords or callback returns true, returns true if found. */ - bool DoWithDropSpenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropSpenserCallback a_Callback); // Lua-accessible - - /** Calls the callback for the furnace at the specified coords. - Returns false if there's no furnace at those coords or callback returns true, returns true if found. */ - bool DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback a_Callback); // Lua-accessible - - /** Calls the callback for the hopper at the specified coords. - Returns false if there's no hopper at those coords or callback returns true, returns true if found. */ - bool DoWithHopperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cHopperCallback a_Callback); // Lua-accessible - - /** Calls the callback for the noteblock at the specified coords. - Returns false if there's no noteblock at those coords or callback returns true, returns true if found. */ - bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback a_Callback); // Lua-accessible - - /** Calls the callback for the command block at the specified coords. - Returns false if there's no command block at those coords or callback returns true, returns true if found. */ - bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback a_Callback); // Lua-accessible - - /** Calls the callback for the mob head block at the specified coords. - Returns false if there's no mob head block at those coords or callback returns true, returns true if found. */ - bool DoWithMobHeadAt(int a_BlockX, int a_BlockY, int a_BlockZ, cMobHeadCallback a_Callback); // Lua-accessible - - /** Calls the callback for the flower pot at the specified coords. - Returns false if there's no flower pot at those coords or callback returns true, returns true if found. */ - bool DoWithFlowerPotAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFlowerPotCallback a_Callback); // Lua-accessible - - /** 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); // Lua-accessible + Returns false if there's no block entity at those coords, and whatever the callback returns if found. */ + bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback); // Lua-acessible /** Queues the chunk for preparing - making sure that it's generated and lit. The specified chunk is queued to be loaded or generated, and lit if needed. @@ -324,9 +219,6 @@ public: /** Marks the chunk as failed-to-load */ void ChunkLoadFailed(int a_ChunkX, int a_ChunkZ); - /** Sets the sign text. Returns true if sign text changed. */ - bool SetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4); - /** Marks the chunk as being regenerated - all its clients want that chunk again (used by cWorld::RegenerateChunk()) */ void MarkChunkRegenerating(int a_ChunkX, int a_ChunkZ); |