24 template <
typename Func>
45 template <
typename Func>
51 for (auto * Client : a_Chunk.GetAllClients())
53 if (Client != a_Exclude)
70 template <
typename Func>
83 template <
typename Func>
90 for (
auto * Client : Chunk->GetAllClients())
92 if (Client != a_Exclude)
100 ForClientsWithChunk({ a_Entity.
GetChunkX(), a_Entity.
GetChunkZ() }, a_World, a_Exclude, std::move(a_Func));
111 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
124 ForClientsWithChunkAtPos(a_BlockPos, *
this, a_Exclude, [&](
cClientHandle & a_Client)
126 a_Client.
SendBlockAction(a_BlockPos,
static_cast<char>(a_Byte1),
static_cast<char>(a_Byte2), a_BlockType);
137 ForClientsWithChunkAtPos(a_BlockPos, *
this, a_Exclude, [&](
cClientHandle & a_Client)
153 if (Entity ==
nullptr)
160 if (Client != a_Exclude)
162 Entity->SendTo(*Client);
176 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
194 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
196 a_Client.
SendChat(a_Message, a_ChatPrefix);
207 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
220 ForClientsWithEntity(a_Collected, *
this, a_Exclude, [&](
cClientHandle & a_Client)
233 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
246 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
259 ForClientsInWorld(*
this,
nullptr, [&](
cClientHandle & a_Client)
272 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
285 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
298 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
311 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
324 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
337 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
350 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
363 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
376 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
389 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
402 ForClientsWithChunkAtPos(a_Src, *
this, a_Exclude, [&](
cClientHandle & a_Client)
404 a_Client.
SendParticleEffect(a_ParticleName, a_Src, a_Offset, a_ParticleData, a_ParticleAmount);
415 ForClientsWithChunkAtPos(a_Src, *
this, a_Exclude, [&](
cClientHandle & a_Client)
417 a_Client.
SendParticleEffect(a_ParticleName, a_Src, a_Offset, a_ParticleData, a_ParticleAmount, a_Data);
428 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
441 ForClientsInWorld(*
this,
nullptr, [&](
cClientHandle & a_Client)
454 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
467 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
480 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
493 ForClientsInWorld(*
this,
nullptr, [&](
cClientHandle & a_Client)
506 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
519 ForClientsInWorld(*
this,
nullptr, [&](
cClientHandle & a_Client)
532 ForClientsInWorld(*
this,
nullptr, [&](
cClientHandle & a_Client)
545 ForClientsWithChunkAtPos(a_Position, *
this, a_Exclude, [&](
cClientHandle & a_Client)
558 ForClientsWithChunkAtPos(a_SrcPos, *
this, a_Exclude, [&](
cClientHandle & a_Client)
571 ForClientsWithEntity(a_Entity, *
this, a_Exclude, [&](
cClientHandle & a_Client)
584 ForClientsWithChunkAtPos(a_BlockPos, *
this, a_Exclude, [&](
cClientHandle & a_Client)
597 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
610 ForClientsWithEntity(a_Entity, *
this,
nullptr, [&](
cClientHandle & a_Client)
623 ForClientsInWorld(*
this, a_Exclude, [&](
cClientHandle & a_Client)
unsigned char BLOCKTYPE
The datatype used by blockdata.
cBlockEntity * GetBlockEntity(Vector3i a_AbsPos)
Returns the block entity at the specified (absolute) coords.
const auto & GetAllClients(void) const
Wraps the chunk coords into a single structure.
static void BlockToChunk(int a_X, int a_Z, int &a_ChunkX, int &a_ChunkZ)
Converts absolute block coords to chunk coords:
bool IsLoggedIn(void) const
void SendParticleEffect(const AString &a_ParticleName, Vector3f a_Source, Vector3f a_Offset, float a_ParticleData, int a_ParticleAmount)
void SendLeashEntity(const cEntity &a_Entity, const cEntity &a_EntityLeashedTo)
void SendEntityProperties(const cEntity &a_Entity)
void SendEntityHeadLook(const cEntity &a_Entity)
void SendPlayerListUpdateDisplayName(const cPlayer &a_Player, const AString &a_CustomName)
void SendDestroyEntity(const cEntity &a_Entity)
void SendScoreboardObjective(const AString &a_Name, const AString &a_DisplayName, Byte a_Mode)
void SendThunderbolt(Vector3i a_BlockPos)
void SendPlayerListUpdateGameMode(const cPlayer &a_Player)
void SendEntityPosition(const cEntity &a_Entity)
void SendSoundParticleEffect(const EffectID a_EffectID, Vector3i a_Source, int a_Data)
void SendScoreUpdate(const AString &a_Objective, const AString &a_Player, cObjective::Score a_Score, Byte a_Mode)
void SendTimeUpdate(cTickTimeLong a_WorldAge, cTickTimeLong a_WorldDate, bool a_DoDaylightCycle)
bool IsDestroyed(void) const
void SendUnleashEntity(const cEntity &a_Entity)
void SendWeather(eWeather a_Weather)
void SendPlayerListHeaderFooter(const cCompositeChat &a_Header, const cCompositeChat &a_Footer)
void SendBlockBreakAnim(UInt32 a_EntityID, Vector3i a_BlockPos, char a_Stage)
void SendSoundEffect(const AString &a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
void SendEntityMetadata(const cEntity &a_Entity)
void SendRemoveEntityEffect(const cEntity &a_Entity, int a_EffectID)
void SendPlayerListUpdatePing()
void SendEntityVelocity(const cEntity &a_Entity)
void SendEntityEquipment(const cEntity &a_Entity, short a_SlotNum, const cItem &a_Item)
void SendEntityEffect(const cEntity &a_Entity, int a_EffectID, int a_Amplifier, int a_Duration)
void SendBlockAction(Vector3i a_BlockPos, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType)
void SendBossBarUpdateHealth(UInt32 a_UniqueID, float a_FractionFilled)
void SendDetachEntity(const cEntity &a_Entity, const cEntity &a_PreviousVehicle)
void SendPlayerListAddPlayer(const cPlayer &a_Player)
void SendEntityLook(const cEntity &a_Entity)
void SendCollectEntity(const cEntity &a_Collected, const cEntity &a_Collector, unsigned a_Count)
void SendDisplayObjective(const AString &a_Objective, cScoreboard::eDisplaySlot a_Display)
void SendChat(const AString &a_Message, eMessageType a_ChatPrefix, const AString &a_AdditionalData="")
void SendPlayerListRemovePlayer(const cPlayer &a_Player)
void SendEntityAnimation(const cEntity &a_Entity, EntityAnimation a_Animation)
void SendAttachEntity(const cEntity &a_Entity, const cEntity &a_Vehicle)
Container for a single chat message composed of multiple functional parts.
int GetChunkZ(void) const
cChunk * GetParentChunk()
Returns the chunk responsible for ticking this entity.
int GetChunkX(void) const
virtual void SpawnOn(cClientHandle &a_Client)=0
Descendants override this function to send a command to the specified client to spawn the entity on t...
cClientHandle * GetClientHandle(void) const
virtual void BroadcastUnleashEntity(const cEntity &a_Entity) override
virtual void BroadcastScoreboardObjective(const AString &a_Name, const AString &a_DisplayName, Byte a_Mode) override
virtual void BroadcastThunderbolt(Vector3i a_BlockPos, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastPlayerListUpdateGameMode(const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
void BroadcastEntityProperties(const cEntity &a_Entity)
virtual void BroadcastPlayerListUpdatePing() override
bool DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback)
Calls the callback for the chunk at the block position specified, with ChunkMapCS locked.
virtual void BroadcastTimeUpdate(const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastDetachEntity(const cEntity &a_Entity, const cEntity &a_PreviousVehicle) override
virtual void BroadcastAttachEntity(const cEntity &a_Entity, const cEntity &a_Vehicle) override
virtual void BroadcastEntityMetadata(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastPlayerListAddPlayer(const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastEntityAnimation(const cEntity &a_Entity, EntityAnimation a_Animation, const cClientHandle *a_Exclude=nullptr) override
bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback a_Callback)
Calls the callback for the chunk specified, with ChunkMapCS locked.
virtual void BroadcastCollectEntity(const cEntity &a_Collected, const cEntity &a_Collector, unsigned a_Count, const cClientHandle *a_Exclude=nullptr) override
virtual cTickTimeLong GetWorldAge(void) const override
virtual void BroadcastPlayerListHeaderFooter(const cCompositeChat &a_Header, const cCompositeChat &a_Footer) override
virtual void BroadcastEntityHeadLook(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastParticleEffect(const AString &a_ParticleName, Vector3f a_Src, Vector3f a_Offset, float a_ParticleData, int a_ParticleAmount, const cClientHandle *a_Exclude=nullptr) override
bool ShouldBroadcastDeathMessages(void) const
virtual void BroadcastBossBarUpdateHealth(const cEntity &a_Entity, UInt32 a_UniqueID, float a_FractionFilled) override
virtual void BroadcastSoundParticleEffect(const EffectID a_EffectID, Vector3i a_SrcPos, int a_Data, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastEntityEquipment(const cEntity &a_Entity, short a_SlotNum, const cItem &a_Item, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastSpawnEntity(cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastPlayerListUpdateDisplayName(const cPlayer &a_Player, const AString &a_CustomName, const cClientHandle *a_Exclude=nullptr) override
virtual bool IsDaylightCycleEnabled(void) const
Is the daylight cycle enabled?
virtual void BroadcastEntityLook(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastEntityVelocity(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastWeather(eWeather a_Weather, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastBlockEntity(Vector3i a_BlockPos, const cClientHandle *a_Exclude=nullptr) override
If there is a block entity at the specified coods, sends it to all clients except a_Exclude.
virtual void BroadcastLeashEntity(const cEntity &a_Entity, const cEntity &a_EntityLeashedTo) override
virtual void BroadcastBlockBreakAnimation(UInt32 a_EntityID, Vector3i a_BlockPos, Int8 a_Stage, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastChat(const AString &a_Message, const cClientHandle *a_Exclude=nullptr, eMessageType a_ChatPrefix=mtCustom) override
virtual void BroadcastBlockAction(Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastEntityPosition(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastEntityEffect(const cEntity &a_Entity, int a_EffectID, int a_Amplifier, int a_Duration, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastDestroyEntity(const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastScoreUpdate(const AString &a_Objective, const AString &a_Player, cObjective::Score a_Score, Byte a_Mode) override
virtual void BroadcastSoundEffect(const AString &a_SoundName, Vector3d a_Position, float a_Volume, float a_Pitch, const cClientHandle *a_Exclude=nullptr) override
cTickTimeLong GetWorldDate() const
virtual void BroadcastPlayerListRemovePlayer(const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
virtual void BroadcastDisplayObjective(const AString &a_Objective, cScoreboard::eDisplaySlot a_Display) override
virtual bool ForEachPlayer(cPlayerListCallback a_Callback) override
Calls the callback for each player in the list; returns true if all players processed,...
virtual void BroadcastRemoveEntityEffect(const cEntity &a_Entity, int a_EffectID, const cClientHandle *a_Exclude=nullptr) override
A simple RAII locker for the chunkmap - locks the chunkmap in its constructor, unlocks it in the dest...