7 #include "tolua++/include/tolua++.h"
10 #include "ManualBindings.h"
43 a_NextIndex = a_Index + 1;
47 a_NextIndex = a_Index + 3;
71 template <
class BlockEntityType,
BLOCKTYPE... BlockTypes>
108 return L.
ApiParamError(fmt::format(FMT_STRING(
"Expected a valid callback function for parameter {}"), OffsetIndex));
114 if constexpr (
sizeof...(BlockTypes) != 0)
116 if (((a_BlockEntity.
GetBlockType() != BlockTypes) && ...))
156 Ty1 * Self =
nullptr;
160 if ((Self ==
nullptr) || (Box ==
nullptr))
162 return L.
ApiParamError(fmt::format(FMT_STRING(
"Invalid world ({}) or boundingbox ({})"), fmt::ptr(Self), fmt::ptr(Box)));
166 return L.
ApiParamError(
"Expected a valid callback function for parameter #2");
169 bool res = (Self->*ForEachFn)(*Box, [&](Ty2 & a_Item)
192 template <
class BlockEntityType,
BLOCKTYPE... BlockTypes>
215 return L.
ApiParamError(
"Error in function call '#funcname#': Invalid 'self'");
219 return L.
ApiParamError(
"Expected a valid callback function for parameter #4");
225 if constexpr (
sizeof...(BlockTypes) != 0)
227 if (((a_BlockEntity.
GetBlockType() != BlockTypes) && ...))
269 LOGWARN(
"BroadcastBlockAction with 3 position arguments is deprecated, use vector-parametered version instead.");
318 if (VolumeIndex != 4)
321 LOGWARN(
"BroadcastSoundEffect with 3 position arguments is deprecated, use vector-parametered version instead.");
373 LOGWARN(
"BroadcastSoundParticleEffect with 3 position arguments is deprecated, use vector-parametered version instead.");
395 World->BroadcastSoundParticleEffect(
static_cast<EffectID>(EffectId), SrcPos, Data, ExcludeClient);
411 int OffsetIndex, ParticleDataIndex;
422 if ((OffsetIndex != 4) || (ParticleDataIndex != 5))
425 LOGWARN(
"BroadcastParticleEffect with 3 position and 3 offset arguments is deprecated, use vector-parametered version instead.");
440 !L.
GetStackValues(ParticleDataIndex, ParticleData, ParticleAmount)
449 std::array<int, 2> Data;
450 bool HasData = L.
GetStackValues(ParticleDataIndex + 3, Data[0], Data[1]);
454 World->BroadcastParticleEffect(Name, SrcPos, Offset, ParticleData, ParticleAmount, Data, ExcludeClient);
458 World->BroadcastParticleEffect(Name, SrcPos, Offset, ParticleData, ParticleAmount, ExcludeClient);
488 if (!L.
GetStackValues(1, world, chunkCoords, onChunkAvailable, onAllChunksAvailable))
490 LOGWARNING(
"cWorld:ChunkStay(): Cannot read parameters, bailing out.");
495 if (world ==
nullptr)
497 LOGWARNING(
"World:ChunkStay(): invalid world parameter");
501 ASSERT(chunkCoords !=
nullptr);
504 auto chunkStay = std::make_unique<cLuaChunkStay>();
505 if (!chunkStay->AddChunks(*chunkCoords))
511 chunkStay.release()->Enable(*world->
GetChunkMap(), std::move(onChunkAvailable), std::move(onAllChunksAvailable));
539 double ExplosionSize;
540 int BlockX, BlockY, BlockZ;
543 if (!L.
GetStackValues(1,
World, ExplosionSize, BlockX, BlockY, BlockZ, CanCauseFire, SourceTypeInt))
545 LOGWARNING(
"World:DoExplosionAt(): invalid parameters");
549 if ((SourceTypeInt < 0) || (SourceTypeInt >=
esMax))
551 LOGWARNING(
"World:DoExplosionAt(): Invalid source type");
557 switch (SourceTypeInt)
589 SourceData =
nullptr;
595 LOGWARNING(
"cWorld:DoExplosionAt(): invalid SourceType parameter: %d", SourceTypeInt);
602 World->DoExplosionAt(ExplosionSize, BlockX, BlockY, BlockZ, CanCauseFire, SourceType, SourceData);
631 if (PlayerUUID.
IsNil())
633 return L.
ApiParamError(
"Expected a non-nil UUID for parameter #1");
637 return L.
ApiParamError(
"Expected a valid callback function for parameter #2");
679 bool CheckLineOfSight =
true, IgnoreSpectators =
true;
680 L.
GetStackValues(1, Self, Position, RangeLimit, FnRef, CheckLineOfSight, IgnoreSpectators);
684 return L.
ApiParamError(
"Expected a valid callback function for parameter #3");
693 }, CheckLineOfSight, IgnoreSpectators);
724 if (OffsetIndex != 3)
727 LOGWARN(
"FastSetBlock with 3 position arguments is deprecated, use vector-parametered version instead.");
745 if (
World ==
nullptr)
747 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
752 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
755 World->FastSetBlock(Position,
Type, Meta);
789 return L.
ApiParamError(
"Expected a valid callback function for parameter #4");
824 cPluginLua * Plugin = cManualBindings::GetLuaPlugin(tolua_S);
825 if (Plugin ==
nullptr)
832 if (
World ==
nullptr)
834 LOGWARNING(
"World:ForEachLoadedChunk(): invalid world parameter");
842 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Could not get function reference of parameter #2");
846 bool ret =
World->ForEachLoadedChunk(
847 [&L, &FnRef](
int a_ChunkX,
int a_ChunkZ) ->
bool
883 if (OffsetIndex != 3)
886 LOGWARN(
"GetBlock with 3 position arguments is deprecated, use vector-parametered version instead.");
901 if (
World ==
nullptr)
903 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
939 if (OffsetIndex != 3)
942 LOGWARN(
"GetBlockBlockLight with 3 position arguments is deprecated, use vector-parametered version instead.");
957 if (
World ==
nullptr)
959 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
964 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
967 L.
Push(
World->GetBlockBlockLight(Position));
996 if (OffsetIndex != 3)
999 LOGWARN(
"GetBlockInfo with 3 position arguments is deprecated, use vector-parametered version instead.");
1014 if (
World ==
nullptr)
1016 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1021 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
1025 NIBBLETYPE BlockMeta, BlockSkyLight, BlockBlockLight;
1028 bool res =
World->GetBlockInfo(Position,
BlockType, BlockMeta, BlockSkyLight, BlockBlockLight);
1034 L.
Push(
BlockType, BlockMeta, BlockSkyLight, BlockBlockLight);
1063 if (OffsetIndex != 3)
1066 LOGWARN(
"GetBlockMeta with 3 position arguments is deprecated, use vector-parametered version instead.");
1081 if (
World ==
nullptr)
1083 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1119 if (OffsetIndex != 3)
1122 LOGWARN(
"GetBlockSkyLight with 3 position arguments is deprecated, use vector-parametered version instead.");
1137 if (
World ==
nullptr)
1139 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1144 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
1147 L.
Push(
World->GetBlockSkyLight(Position));
1176 if (OffsetIndex != 3)
1179 LOGWARN(
"GetBlockTypeMeta with 3 position arguments is deprecated, use vector-parametered version instead.");
1194 if (
World ==
nullptr)
1196 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1209 bool res =
World->GetBlockTypeMeta(Position,
BlockType, BlockMeta);
1246 if (Self ==
nullptr)
1248 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1252 AString Line1, Line2, Line3, Line4;
1253 bool res = Self->
GetSignLines(BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4);
1259 L.
Push(Line1, Line2, Line3, Line4);
1284 if (Self ==
nullptr)
1293 L.
Push(Time.count());
1316 if (Self ==
nullptr)
1325 L.
Push(
static_cast<lua_Number
>(Time.count()));
1365 cWorld * world =
nullptr;
1368 auto Callback = std::make_unique<cCallback>();
1369 L.
GetStackValues(1, world, chunkX, chunkZ, Callback->m_LuaCallback);
1370 if (world ==
nullptr)
1372 LOGWARNING(
"World:PrepareChunk(): invalid world parameter");
1378 world->
PrepareChunk(chunkX, chunkZ, std::move(Callback));
1404 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Cannot read parameters");
1406 if (
World ==
nullptr)
1408 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Not called on an object instance");
1410 if (!Task->IsValid())
1412 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Could not store the callback parameter");
1417 Task->Call(&a_World);
1447 if (OffsetIndex != 3)
1450 LOGWARN(
"SetBlock with 3 position arguments is deprecated, use vector-parametered version instead.");
1468 if (
World ==
nullptr)
1470 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1475 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
1506 if (OffsetIndex != 3)
1509 LOGWARN(
"SetBlockMeta with 3 position arguments is deprecated, use vector-parametered version instead.");
1526 if (
World ==
nullptr)
1528 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1533 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'position'");
1536 World->SetBlockMeta(Position, Meta);
1565 AString Line1, Line2, Line3, Line4;
1566 L.
GetStackValues(1, Self, BlockX, BlockY, BlockZ, Line1, Line2, Line3, Line4);
1567 if (Self ==
nullptr)
1569 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Invalid 'self'");
1573 bool res = Self->
SetSignLines({BlockX, BlockY, BlockZ}, Line1, Line2, Line3, Line4);
1599 cTickTime::rep Time;
1601 if (Self ==
nullptr)
1632 auto Task = std::make_shared<cLuaState::cCallback>();
1635 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Cannot read parameters");
1637 if (
World ==
nullptr)
1639 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Not called on an object instance");
1641 if (!Task->IsValid())
1643 return cManualBindings::lua_do_error(tolua_S,
"Error in function call '#funcname#': Could not store the callback parameter");
1648 Task->Call(&a_World);
1675 if (
self ==
nullptr)
1677 tolua_error(tolua_S,
"Invalid 'self' in function 'SpawnSplitExperienceOrbs'",
nullptr);
1682 L.
Push(self->SpawnExperienceOrb(Position, Reward));
1712 if (
self ==
nullptr)
1714 tolua_error(tolua_S,
"Invalid 'self' in function 'TryGetHeight'",
nullptr);
1720 bool res =
self->TryGetHeight(BlockX, BlockZ, Height);
1734 void cManualBindings::BindWorld(lua_State * tolua_S)
1736 tolua_beginmodule(tolua_S,
nullptr);
1737 tolua_beginmodule(tolua_S,
"cWorld");
1744 tolua_function(tolua_S,
"DoWithBeaconAt", DoWithBlockEntityAt<cBeaconEntity, E_BLOCK_BEACON>);
1745 tolua_function(tolua_S,
"DoWithBedAt", DoWithBlockEntityAt<cBedEntity, E_BLOCK_BED>);
1746 tolua_function(tolua_S,
"DoWithBlockEntityAt", DoWithBlockEntityAt<cBlockEntity>);
1747 tolua_function(tolua_S,
"DoWithBrewingstandAt", DoWithBlockEntityAt<cBrewingstandEntity, E_BLOCK_BREWING_STAND>);
1748 tolua_function(tolua_S,
"DoWithChestAt", DoWithBlockEntityAt<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>);
1749 tolua_function(tolua_S,
"DoWithCommandBlockAt", DoWithBlockEntityAt<cCommandBlockEntity, E_BLOCK_COMMAND_BLOCK>);
1750 tolua_function(tolua_S,
"DoWithDispenserAt", DoWithBlockEntityAt<cDispenserEntity, E_BLOCK_DISPENSER>);
1751 tolua_function(tolua_S,
"DoWithDropSpenserAt", DoWithBlockEntityAt<cDropSpenserEntity, E_BLOCK_DISPENSER, E_BLOCK_DROPPER>);
1752 tolua_function(tolua_S,
"DoWithDropperAt", DoWithBlockEntityAt<cDropperEntity, E_BLOCK_DROPPER>);
1753 tolua_function(tolua_S,
"DoWithEntityByID", DoWithID<cWorld, cEntity, &cWorld::DoWithEntityByID>);
1754 tolua_function(tolua_S,
"DoWithFlowerPotAt", DoWithBlockEntityAt<cFlowerPotEntity, E_BLOCK_FLOWER_POT>);
1755 tolua_function(tolua_S,
"DoWithFurnaceAt", DoWithBlockEntityAt<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>);
1756 tolua_function(tolua_S,
"DoWithHopperAt", DoWithBlockEntityAt<cHopperEntity, E_BLOCK_HOPPER>);
1757 tolua_function(tolua_S,
"DoWithMobHeadAt", DoWithBlockEntityAt<cMobHeadEntity, E_BLOCK_HEAD>);
1759 tolua_function(tolua_S,
"DoWithNoteBlockAt", DoWithBlockEntityAt<cNoteEntity, E_BLOCK_NOTE_BLOCK>);
1760 tolua_function(tolua_S,
"DoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::DoWithPlayer>);
1763 tolua_function(tolua_S,
"FindAndDoWithPlayer", DoWith<cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>);
1764 tolua_function(tolua_S,
"ForEachBlockEntityInChunk", ForEachBlockEntityInChunk<cBlockEntity>);
1765 tolua_function(tolua_S,
"ForEachBrewingstandInChunk", ForEachBlockEntityInChunk<cBrewingstandEntity, E_BLOCK_BREWING_STAND>);
1766 tolua_function(tolua_S,
"ForEachChestInChunk", ForEachBlockEntityInChunk<cChestEntity, E_BLOCK_CHEST, E_BLOCK_TRAPPED_CHEST>);
1767 tolua_function(tolua_S,
"ForEachEntity", ForEach<cWorld, cEntity, &cWorld::ForEachEntity>);
1768 tolua_function(tolua_S,
"ForEachEntityInBox", ForEachInBox<cWorld, cEntity, &cWorld::ForEachEntityInBox>);
1770 tolua_function(tolua_S,
"ForEachFurnaceInChunk", ForEachBlockEntityInChunk<cFurnaceEntity, E_BLOCK_FURNACE, E_BLOCK_LIT_FURNACE>);
1772 tolua_function(tolua_S,
"ForEachPlayer", ForEach<cWorld, cPlayer, &cWorld::ForEachPlayer>);
1791 tolua_endmodule(tolua_S);
1792 tolua_endmodule(tolua_S);
static int ForEachBlockEntityInChunk(lua_State *tolua_S)
static bool GetStackVectorOr3Numbers(cLuaState &L, int a_Index, Vector3< T > &a_Return)
Get a vector from the stack, which may be represented in lua as either a Vector3<T> or 3 numbers.
static int tolua_cWorld_BroadcastSoundParticleEffect(lua_State *tolua_S)
static int tolua_cWorld_GetBlockBlockLight(lua_State *tolua_S)
static int tolua_cWorld_GetBlockSkyLight(lua_State *tolua_S)
static int tolua_cWorld_GetWorldAge(lua_State *tolua_S)
static int tolua_cWorld_DoExplosionAt(lua_State *tolua_S)
static int tolua_cWorld_PrepareChunk(lua_State *tolua_S)
static int tolua_cWorld_GetBlock(lua_State *tolua_S)
static int tolua_cWorld_DoWithNearestPlayer(lua_State *tolua_S)
static int tolua_cWorld_ForEachLoadedChunk(lua_State *tolua_S)
static int tolua_cWorld_SetTimeOfDay(lua_State *tolua_S)
static int tolua_cWorld_QueueTask(lua_State *tolua_S)
static int ForEachInBox(lua_State *tolua_S)
static int tolua_cWorld_ForEachEntityInChunk(lua_State *tolua_S)
static int tolua_cWorld_BroadcastSoundEffect(lua_State *tolua_S)
static int tolua_cWorld_SetSignLines(lua_State *tolua_S)
static bool CheckParamVectorOr3Numbers(cLuaState &L, const char *a_VectorName, int a_Index, int &a_NextIndex)
Check that a Lua parameter is either a vector or 3 numbers in sequence.
static int tolua_cWorld_ChunkStay(lua_State *tolua_S)
static int tolua_cWorld_DoWithPlayerByUUID(lua_State *tolua_S)
static int tolua_cWorld_ScheduleTask(lua_State *tolua_S)
static int tolua_cWorld_FastSetBlock(lua_State *tolua_S)
static int tolua_cWorld_SetBlock(lua_State *tolua_S)
static int tolua_cWorld_GetBlockTypeMeta(lua_State *tolua_S)
static int tolua_cWorld_GetBlockMeta(lua_State *tolua_S)
static int tolua_cWorld_BroadcastBlockAction(lua_State *tolua_S)
static int tolua_cWorld_SetBlockMeta(lua_State *tolua_S)
static int tolua_cWorld_TryGetHeight(lua_State *tolua_S)
static int tolua_cWorld_SpawnSplitExperienceOrbs(lua_State *tolua_S)
static int tolua_cWorld_GetTimeOfDay(lua_State *tolua_S)
static int tolua_cWorld_GetBlockInfo(lua_State *tolua_S)
static int DoWithBlockEntityAt(lua_State *tolua_S)
Template for the bindings for the DoWithXYZAt(X, Y, Z) functions that don't need to check their coord...
static int tolua_cWorld_GetSignLines(lua_State *tolua_S)
static int tolua_cWorld_BroadcastParticleEffect(lua_State *tolua_S)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
eExplosionSource
The source of an explosion.
std::chrono::duration< signed int, std::ratio_multiply< std::chrono::milliseconds::period, std::ratio< 50 > >> cTickTime
void LOGWARNING(std::string_view a_Format, const Args &... args)
Utilities to allow casting a cWorld to one of its interfaces without including World....
Encapsulates a Lua state and provides some syntactic sugar for common operations.
bool CheckParamFunction(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are functions; also logs warning if not.
bool CheckParamUserType(int a_StartParam, const char *a_UserType, int a_EndParam=-1)
Returns true if the specified parameters on the stack are of the specified usertype; also logs warnin...
void Push(Arg1 &&a_Arg1, Arg2 &&a_Arg2, Args &&... a_Args)
Pushes multiple arguments onto the Lua stack.
void LogStackValues(const char *a_Header=nullptr)
Logs all the elements' types on the API stack, with an optional header for the listing.
void LogStackTrace(int a_StartingDepth=0)
Logs all items in the current stack trace to the server console.
std::unique_ptr< cOptionalCallback > cOptionalCallbackPtr
bool CheckParamEnd(int a_Param)
Returns true if the specified parameter on the stack is nil (indicating an end-of-parameters)
bool IsParamUserType(int a_ParamIdx, const AString &a_UserType)
Returns true if the specified parameter is of the specified class.
std::unique_ptr< cStackTable > cStackTablePtr
bool CheckParamBool(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are bools; also logs warning if not.
bool Call(const FnT &a_Function, Args &&... args)
Call the specified Lua function.
bool CheckParamSelf(const char *a_SelfClassName)
Returns true if the first parameter is an instance of the expected class name.
bool CheckParamFunctionOrNil(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are functions or nils; also logs warning if not...
bool CheckParamString(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are strings; also logs warning if not.
bool CheckParamUUID(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are UUIDs; also logs warning if not Accepts eit...
bool CheckParamNumber(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are numbers; also logs warning if not.
bool CheckParamTable(int a_StartParam, int a_EndParam=-1)
Returns true if the specified parameters on the stack are tables; also logs warning if not.
bool GetStackValue(int a_StackPos, AString &a_Value)
int ApiParamError(std::string_view a_Msg)
Prints the message, prefixed with the current function name, then logs the stack contents and raises ...
bool GetStackValues(int a_StartStackPos, Arg1 &&a_Arg1, Args &&... args)
Retrieves a list of values from the Lua stack, starting at the specified index.
std::shared_ptr< cCallback > cCallbackSharedPtr
Used for storing references to object in the global registry.
bool IsValid(void) const
Returns true if the reference is valid.
Same thing as cCallback, but GetStackValue() won't fail if the callback value is nil.
BLOCKTYPE GetBlockType() const
Represents two sets of coords, minimum and maximum for each direction.
Wraps the chunk coords into a single structure.
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
Interface class used as a callback for operations that involve chunk coords.
virtual void Call(cChunkCoords a_Coords, bool a_IsSuccess)=0
Called with the chunk's coords, and an optional operation status flag for operations that support it.
bool IsNil() const
Returns true if this contains the "nil" UUID with all bits set to 0.
bool DoWithPlayerByUUID(const cUUID &a_PlayerUUID, cPlayerListCallback a_Callback)
Finds the player over his uuid and calls the callback.
void PrepareChunk(int a_ChunkX, int a_ChunkZ, std::unique_ptr< cChunkCoordCallback > a_CallAfter={})
Queues the chunk for preparing - making sure that it's generated and lit.
virtual cTickTimeLong GetWorldAge(void) const override
bool ForEachBlockEntityInChunk(int a_ChunkX, int a_ChunkZ, cBlockEntityCallback a_Callback)
Calls the callback for each block entity in the specified chunk; returns true if all block entities p...
bool SetSignLines(Vector3i a_BlockPos, const AString &a_Line1, const AString &a_Line2, const AString &a_Line3, const AString &a_Line4, cPlayer *a_Player=nullptr)
Sets the sign text, asking plugins for permission first.
virtual void BroadcastBlockAction(Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
bool GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString &a_Line1, AString &a_Line2, AString &a_Line3, AString &a_Line4)
Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coo...
virtual cTickTime GetTimeOfDay(void) const override
virtual bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback) override
Calls the callback for the block entity at the specified coords; returns false if there's no block en...
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override
bool DoWithNearestPlayer(Vector3d a_Pos, double a_RangeLimit, cPlayerListCallback a_Callback, bool a_CheckLineOfSight=true, bool a_IgnoreSpectator=true)
Calls the callback for nearest player for given position, Returns false if player not found,...
cChunkMap * GetChunkMap(void)
bool ForEachEntityInChunk(int a_ChunkX, int a_ChunkZ, cEntityCallback a_Callback)
Calls the callback for each entity in the specified chunk; returns true if all entities processed,...
virtual void SetTimeOfDay(cTickTime a_TimeOfDay) override