Cuberite
A lightweight, fast and extensible game server for Minecraft
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
cWorld Class Referencefinal

#include <World.h>

Inheritance diagram for cWorld:
Inheritance graph
[legend]
Collaboration diagram for cWorld:
Collaboration graph
[legend]

Classes

struct  BlockTickQueueItem
 
class  cChunkGeneratorCallbacks
 Implementation of the callbacks that the ChunkGenerator uses to store new chunks and interface to plugins. More...
 
class  cLock
 A simple RAII locker for the chunkmap - locks the chunkmap in its constructor, unlocks it in the destructor. More...
 
class  cTickThread
 

Public Member Functions

bool AddChunkClient (int a_ChunkX, int a_ChunkZ, cClientHandle *a_Client)
 Adds client to a chunk, if not already present; returns true if added, false if present. More...
 
void AddEntity (OwnedEntity a_Entity, cWorld *a_OldWorld=nullptr)
 Adds the entity into its appropriate chunk; takes ownership of the entity ptr. More...
 
bool AreCommandBlocksEnabled (void) const
 
virtual void BroadcastAttachEntity (const cEntity &a_Entity, const cEntity &a_Vehicle) override
 
virtual void BroadcastBlockAction (Vector3i a_BlockPos, Byte a_Byte1, Byte a_Byte2, BLOCKTYPE a_BlockType, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastBlockBreakAnimation (UInt32 a_EntityID, Vector3i a_BlockPos, Int8 a_Stage, 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. More...
 
virtual void BroadcastBossBarUpdateHealth (const cEntity &a_Entity, UInt32 a_UniqueID, float a_FractionFilled) override
 
virtual void BroadcastChat (const AString &a_Message, const cClientHandle *a_Exclude=nullptr, eMessageType a_ChatPrefix=mtCustom) override
 
virtual void BroadcastChat (const cCompositeChat &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatDeath (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatFailure (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatFatal (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatInfo (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatSuccess (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastChatWarning (const AString &a_Message, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastCollectEntity (const cEntity &a_Collected, const cEntity &a_Collector, unsigned a_Count, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastDestroyEntity (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastDetachEntity (const cEntity &a_Entity, const cEntity &a_PreviousVehicle) override
 
virtual void BroadcastDisplayObjective (const AString &a_Objective, cScoreboard::eDisplaySlot a_Display) override
 
virtual void BroadcastEntityAnimation (const cEntity &a_Entity, EntityAnimation a_Animation, 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 BroadcastEntityEquipment (const cEntity &a_Entity, short a_SlotNum, const cItem &a_Item, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastEntityHeadLook (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastEntityLook (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastEntityMetadata (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastEntityPosition (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
void BroadcastEntityProperties (const cEntity &a_Entity)
 
virtual void BroadcastEntityVelocity (const cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastLeashEntity (const cEntity &a_Entity, const cEntity &a_EntityLeashedTo) 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
 
virtual void BroadcastParticleEffect (const AString &a_ParticleName, Vector3f a_Src, Vector3f a_Offset, float a_ParticleData, int a_ParticleAmount, std::array< int, 2 > a_Data, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastPlayerListAddPlayer (const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastPlayerListHeaderFooter (const cCompositeChat &a_Header, const cCompositeChat &a_Footer) override
 
virtual void BroadcastPlayerListRemovePlayer (const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastPlayerListUpdateDisplayName (const cPlayer &a_Player, const AString &a_CustomName, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastPlayerListUpdateGameMode (const cPlayer &a_Player, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastPlayerListUpdatePing () override
 
virtual void BroadcastRemoveEntityEffect (const cEntity &a_Entity, int a_EffectID, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastScoreboardObjective (const AString &a_Name, const AString &a_DisplayName, Byte a_Mode) 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
 
virtual void BroadcastSoundParticleEffect (const EffectID a_EffectID, Vector3i a_SrcPos, int a_Data, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastSpawnEntity (cEntity &a_Entity, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastThunderbolt (Vector3i a_BlockPos, const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastTimeUpdate (const cClientHandle *a_Exclude=nullptr) override
 
virtual void BroadcastUnleashEntity (const cEntity &a_Entity) override
 
virtual void BroadcastWeather (eWeather a_Weather, const cClientHandle *a_Exclude=nullptr) override
 
void CastThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ)
 
void CastThunderbolt (Vector3i a_Block)
 Casts a thunderbolt at the specified coords. More...
 
void ChangeWeather (void)
 Forces a weather change in the next game tick. More...
 
void ChunkLighted (int a_ChunkX, int a_ChunkZ, const cChunkDef::BlockNibbles &a_BlockLight, const cChunkDef::BlockNibbles &a_SkyLight)
 
void ChunkLoadFailed (int a_ChunkX, int a_ChunkZ)
 Marks the chunk as failed-to-load: More...
 
void CollectPickupsByEntity (cEntity &a_Entity)
 
void CompareChunkClients (int a_ChunkX1, int a_ChunkZ1, int a_ChunkX2, int a_ChunkZ2, cClientDiffCallback &a_Callback)
 Compares clients of two chunks, calls the callback accordingly. More...
 
UInt32 CreateProjectile (double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity *a_Creator, const cItem *a_Item, const Vector3d *a_Speed=nullptr)
 OBSOLETE, use the Vector3d-based overload instead. More...
 
UInt32 CreateProjectile (Vector3d a_Pos, cProjectileEntity::eKind a_Kind, cEntity *a_Creator, const cItem *a_Item, const Vector3d *a_Speed=nullptr)
 Creates a projectile of the specified type. More...
 
 cWorld (const AString &a_WorldName, const AString &a_DataPath, cDeadlockDetect &a_DeadlockDetect, const AStringVector &a_WorldNames, eDimension a_Dimension=dimOverworld, const AString &a_LinkedOverworldName={})
 Construct the world and read settings from its ini file. More...
 
bool DigBlock (int a_X, int a_Y, int a_Z, cEntity *a_Digger=nullptr)
 OBSOLETE, use the Vector3-based overload instead. More...
 
bool DigBlock (Vector3i a_BlockPos, const cEntity *a_Digger=nullptr)
 Replaces the specified block with air, and calls the OnBroken block handler. More...
 
virtual void DoExplosionAt (double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void *a_SourceData) override
 Does an explosion with the specified strength at the specified coordinates. More...
 
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 entity at those coords, and whatever the callback returns if found. More...
 
bool DoWithChunk (int a_ChunkX, int a_ChunkZ, cChunkCallback a_Callback)
 Calls the callback for the chunk specified, with ChunkMapCS locked. More...
 
bool DoWithChunkAt (Vector3i a_BlockPos, cChunkCallback a_Callback)
 Calls the callback for the chunk at the block position specified, with ChunkMapCS locked. More...
 
bool DoWithEntityByID (UInt32 a_UniqueID, cEntityCallback a_Callback)
 Calls the callback if the entity with the specified ID is found, with the entity object as the callback param. More...
 
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, otherwise returns the same value as the callback. More...
 
bool DoWithPlayer (const AString &a_PlayerName, cPlayerListCallback a_Callback)
 Calls the callback for the player of the given name; returns true if the player was found and the callback called, false if player not found. More...
 
bool DoWithPlayerByUUID (const cUUID &a_PlayerUUID, cPlayerListCallback a_Callback)
 Finds the player over his uuid and calls the callback. More...
 
bool DropBlockAsPickups (Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
 Digs the specified block, and spawns the appropriate pickups for it. More...
 
void FastSetBlock (Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 Sets the block at the specified coords to the specified value. More...
 
bool FindAndDoWithPlayer (const AString &a_PlayerNameHint, cPlayerListCallback a_Callback)
 Finds a player from a partial or complete player name and calls the callback - case-insensitive. More...
 
void ForceSendChunkTo (int a_ChunkX, int a_ChunkZ, cChunkSender::Priority a_Priority, cClientHandle *a_Client)
 Sends the chunk to the client specified, even if the client already has the chunk. More...
 
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 processed, false if the callback aborted by returning true. More...
 
virtual bool ForEachChunkInRect (int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback &a_Callback) override
 Calls the callback for each chunk in the coords specified (all cords are inclusive). More...
 
bool ForEachEntity (cEntityCallback a_Callback)
 Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true. More...
 
virtual bool ForEachEntityInBox (const cBoundingBox &a_Box, cEntityCallback a_Callback) override
 Calls the callback for each entity that has a nonempty intersection with the specified boundingbox. More...
 
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, false if the callback aborted by returning true. More...
 
bool ForEachLoadedChunk (cFunctionRef< bool(int, int)> a_Callback)
 Calls the callback for each loaded chunk. More...
 
virtual bool ForEachPlayer (cPlayerListCallback a_Callback) override
 Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true. More...
 
void GenerateChunk (int a_ChunkX, int a_ChunkZ)
 Generates the given chunk. More...
 
EMCSBiome GetBiomeAt (int a_BlockX, int a_BlockZ)
 Returns the biome at the specified coords. More...
 
BLOCKTYPE GetBlock (Vector3i a_BlockPos) const
 Returns the block type at the specified position. More...
 
NIBBLETYPE GetBlockBlockLight (Vector3i a_BlockPos) const
 Returns the block-light value at the specified block position. More...
 
bool GetBlockInfo (Vector3i a_BlockPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_Meta, NIBBLETYPE &a_SkyLight, NIBBLETYPE &a_BlockLight) const
 Queries the whole block specification from the world. More...
 
NIBBLETYPE GetBlockMeta (Vector3i a_BlockPos) const
 Returns the block meta at the specified position. More...
 
bool GetBlocks (sSetBlockVector &a_Blocks, bool a_ContinueOnFailure)
 Retrieves block types of the specified blocks. More...
 
NIBBLETYPE GetBlockSkyLight (Vector3i a_BlockPos) const
 Returns the sky light value at the specified block position. More...
 
bool GetBlockTypeMeta (Vector3i a_BlockPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
 Retrieves the block type and meta at the specified coords. More...
 
virtual cBroadcastInterfaceGetBroadcastManager (void) override
 
bool GetChunkData (cChunkCoords a_Coords, cChunkDataCallback &a_Callback) const
 Calls the callback with the chunk's data, if available (with ChunkCS locked). More...
 
cChunkMapGetChunkMap (void)
 
void GetChunkStats (int &a_NumValid, int &a_NumDirty, int &a_NumInLightingQueue)
 Returns the number of chunks loaded and dirty, and in the lighting queue. More...
 
const AStringGetDataPath (void) const
 Returns the data path to the world data. More...
 
int GetDefaultWeatherInterval (eWeather a_Weather) const
 Returns the default weather interval for the specific weather type. More...
 
virtual eDimension GetDimension (void) const override
 
eGameMode GetGameMode (void) const
 Returns the current game mode. More...
 
cChunkGeneratorThreadGetGenerator (void)
 
size_t GetGeneratorQueueLength (void)
 
virtual int GetHeight (int a_BlockX, int a_BlockZ) override
 Returns the world height at the specified coords; waits for the chunk to get loaded / generated. More...
 
const AStringGetIniFileName (void) const
 Returns the name of the world.ini file used by this world. More...
 
cFluidSimulatorGetLavaSimulator (void)
 
size_t GetLightingQueueLength (void)
 
cLightingThreadGetLightingThread (void)
 
AString GetLinkedEndWorldName (void) const
 
AString GetLinkedNetherWorldName (void) const
 
AString GetLinkedOverworldName (void) const
 
cMapManagerGetMapManager (void)
 Returns the associated map manager instance. More...
 
int GetMaxCactusHeight (void) const
 
virtual int GetMaxNetherPortalHeight (void) const override
 
virtual int GetMaxNetherPortalWidth (void) const override
 
int GetMaxSugarcaneHeight (void) const
 
int GetMaxViewDistance (void) const
 
virtual int GetMinNetherPortalHeight (void) const override
 Returns or sets the minumim or maximum netherportal height. More...
 
virtual int GetMinNetherPortalWidth (void) const override
 Returns or sets the minumim or maximum netherportal width. More...
 
const AStringGetName (void) const
 Returns the name of the world. More...
 
size_t GetNumChunks () const
 Returns the number of chunks loaded
More...
 
size_t GetNumUnusedDirtyChunks (void) const
 Returns the number of unused dirty chunks. More...
 
size_t GetPlayerCount () const
 Returns the number of players currently in this world. More...
 
cRedstoneSimulatorGetRedstoneSimulator (void)
 
cScoreboardGetScoreBoard (void)
 Returns the associated scoreboard instance. More...
 
int GetSeed (void) const
 Returns the seed of the world. More...
 
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 coords, true if found. More...
 
cSimulatorManagerGetSimulatorManager (void)
 
NIBBLETYPE GetSkyDarkness ()
 Get the current darkness level based on the time. More...
 
int GetSpawnX (void) const
 
int GetSpawnY (void) const
 
int GetSpawnZ (void) const
 
cWorldStorageGetStorage (void)
 
size_t GetStorageLoadQueueLength (void)
 
size_t GetStorageSaveQueueLength (void)
 
int GetTickRandomNumber (int a_Range)
 Returns a random number in range [0 . More...
 
int GetTicksUntilWeatherChange (void) const
 
virtual cTickTime GetTimeOfDay (void) const override
 
eShrapnelLevel GetTNTShrapnelLevel (void) const
 
cFluidSimulatorGetWaterSimulator (void)
 
eWeather GetWeather (void) const
 Returns the current weather. More...
 
virtual cTickTimeLong GetWorldAge (void) const override
 
cTickTimeLong GetWorldDate () const
 
cTickTimeLong GetWorldTickAge () const
 
int GrowPlantAt (Vector3i a_BlockPos, int a_NumStages=1)
 Grows the plant at the specified position by at most a_NumStages. More...
 
bool GrowRipePlant (int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsByBonemeal=false)
 OBSOLETE, use the Vector3-based overload instead. More...
 
bool GrowRipePlant (Vector3i a_BlockPos)
 Grows the plant at the specified block to its ripe stage. More...
 
bool GrowTree (Vector3i a_BlockPos)
 Grows a tree at the specified coords. More...
 
bool GrowTreeByBiome (Vector3i a_BlockPos)
 Grows a tree at the specified coords, based on the biome in the place. More...
 
bool GrowTreeFromSapling (Vector3i a_BlockPos)
 Grows a tree from the sapling at the specified coords. More...
 
bool GrowTreeImage (const sSetBlockVector &a_Blocks)
 Imprints the specified blocks into the world, as long as each log block replaces only allowed blocks. More...
 
bool HasChunkAnyClients (int a_ChunkX, int a_ChunkZ) const
 
void InitializeSpawn (void)
 
bool IsBlockDirectlyWatered (int a_BlockX, int a_BlockY, int a_BlockZ)
 
bool IsChunkLighted (int a_ChunkX, int a_ChunkZ)
 
bool IsChunkQueued (int a_ChunkX, int a_ChunkZ) const
 Returns true iff the chunk is in the loader / generator queue. More...
 
bool IsChunkValid (int a_ChunkX, int a_ChunkZ) const
 Returns true iff the chunk is present and valid. More...
 
virtual bool IsDaylightCycleEnabled (void) const
 Is the daylight cycle enabled? More...
 
bool IsDeepSnowEnabled (void) const
 
bool IsFarmlandTramplingEnabled (void) const
 Returns true if farmland trampling is enabled. More...
 
bool IsGameModeAdventure (void) const
 Returns true if the world is in Adventure mode. More...
 
bool IsGameModeCreative (void) const
 Returns true if the world is in Creative mode. More...
 
bool IsGameModeSpectator (void) const
 Returns true if the world is in Spectator mode. More...
 
bool IsGameModeSurvival (void) const
 Returns true if the world is in Survival mode. More...
 
bool IsPVPEnabled (void) const
 
bool IsSavingEnabled (void) const
 Get whether saving chunks is enabled. More...
 
bool IsSlimeChunk (int a_ChunkX, int a_ChunkZ) const
 Returns true if slimes should spawn in the chunk. More...
 
bool IsTrapdoorOpen (int a_BlockX, int a_BlockY, int a_BlockZ)
 Is the trapdoor open? Returns false if there is no trapdoor at the specified coords. More...
 
bool IsWeatherRain (void) const
 Returns true if the current weather is rainy. More...
 
bool IsWeatherRainAt (int a_BlockX, int a_BlockZ)
 Returns true if it is raining at the specified location. More...
 
bool IsWeatherStorm (void) const
 Returns true if the current weather is stormy. More...
 
bool IsWeatherStormAt (int a_BlockX, int a_BlockZ)
 Returns true if the weather is stormy at the specified location. More...
 
bool IsWeatherSunny (void) const
 Returns true if the current weather is sunny. More...
 
bool IsWeatherSunnyAt (int a_BlockX, int a_BlockZ) const
 Returns true if it is sunny at the specified location. More...
 
bool IsWeatherWet (void) const
 Returns true if the world currently has any precipitation - rain, storm or snow. More...
 
virtual bool IsWeatherWetAt (int a_BlockX, int a_BlockZ) override
 Returns true if it is raining or storming at the specified location. More...
 
virtual bool IsWeatherWetAtXYZ (Vector3i a_Position) override
 Returns true if it is raining or storming at the specified location, and the rain reaches (the bottom of) the specified block position. More...
 
void MarkChunkDirty (int a_ChunkX, int a_ChunkZ)
 
void MarkChunkSaved (int a_ChunkX, int a_ChunkZ)
 
void MarkChunkSaving (int a_ChunkX, int a_ChunkZ)
 
cItems PickupsFromBlock (Vector3i a_BlockPos, const cEntity *a_Digger=nullptr, const cItem *a_Tool=nullptr)
 Returns all the pickups that would result if the a_Digger dug up the block at a_BlockPos using a_Tool a_Digger is usually a player, but can be nullptr for natural causes. More...
 
void PlaceBlock (const Vector3i a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta)
 Replaces the specified block with another, and calls the OnPlaced block handler. More...
 
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. More...
 
void QueueBlockForTick (int a_BlockX, int a_BlockY, int a_BlockZ, int a_TicksToWait)
 Queues the block to be ticked after the specified number of game ticks. More...
 
void QueueLightChunk (int a_ChunkX, int a_ChunkZ, std::unique_ptr< cChunkCoordCallback > a_Callback={})
 Queues a chunk for lighting; a_Callback is called after the chunk is lighted. More...
 
void QueueSaveAllChunks (void)
 Queues a task to save all chunks onto the tick thread. More...
 
void QueueSetChunkData (SetChunkData &&a_SetChunkData)
 Puts the chunk data into a queue to be set into the chunkmap in the tick thread. More...
 
void QueueTask (std::function< void(cWorld &)> a_Task)
 Queues a task onto the tick thread. More...
 
void QueueUnloadUnusedChunks (void)
 Queues a task to unload unused chunks onto the tick thread. More...
 
void RegenerateChunk (int a_ChunkX, int a_ChunkZ)
 Regenerate the given chunk. More...
 
void RemoveChunkClient (int a_ChunkX, int a_ChunkZ, cClientHandle *a_Client)
 Removes client from the chunk specified. More...
 
void RemoveClientFromChunks (cClientHandle *a_Client)
 Removes the client from all chunks it is present in. More...
 
OwnedEntity RemoveEntity (cEntity &a_Entity)
 Removes the entity from the world. More...
 
void SaveAllChunks (void)
 Saves all chunks immediately. More...
 
void ScheduleTask (cTickTime a_DelayTicks, std::function< void(cWorld &)> a_Task)
 Queues a lambda task onto the tick thread, with the specified delay. More...
 
void SendBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle &a_Client)
 If there is a block entity at the specified coords, sends it to the client specified. More...
 
void SendBlockTo (const Vector3i a_BlockPos, const cPlayer &a_Player)
 Sends the block on those coords to the player. More...
 
virtual void SendBlockTo (int a_BlockX, int a_BlockY, int a_BlockZ, const cPlayer &a_Player)=0
 Sends the block on those coords to the player. More...
 
virtual void SendBlockTo (int a_X, int a_Y, int a_Z, const cPlayer &a_Player) override
 Sends the block at the specified coords to the player. More...
 
void SendChunkTo (int a_ChunkX, int a_ChunkZ, cChunkSender::Priority a_Priority, cClientHandle *a_Client)
 Sends the chunk to the client specified, if the client doesn't have the chunk yet. More...
 
void SendPlayerList (cPlayer *a_DestPlayer)
 
bool SetAreaBiome (const cCuboid &a_Area, EMCSBiome a_Biome)
 Sets the biome at the area. More...
 
bool SetAreaBiome (int a_MinX, int a_MaxX, int a_MinZ, int a_MaxZ, EMCSBiome a_Biome)
 Sets the biome at the area. More...
 
bool SetBiomeAt (int a_BlockX, int a_BlockZ, EMCSBiome a_Biome)
 Sets the biome at the specified coords. More...
 
void SetBlock (Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 Sets the block at the specified coords to the specified value. More...
 
void SetBlockMeta (Vector3i a_BlockPos, NIBBLETYPE a_MetaData)
 Sets the meta for the specified block, while keeping the blocktype. More...
 
void SetChunkAlwaysTicked (int a_ChunkX, int a_ChunkZ, bool a_AlwaysTicked=true)
 Increments (a_AlwaysTicked == true) or decrements (false) the m_AlwaysTicked counter for the specified chunk. More...
 
bool SetCommandBlockCommand (int a_BlockX, int a_BlockY, int a_BlockZ, const AString &a_Command)
 Sets the command block command. More...
 
bool SetCommandBlockCommand (Vector3i a_BlockPos, const AString &a_Command)
 
void SetCommandBlocksEnabled (bool a_Flag)
 
virtual void SetDaylightCycleEnabled (bool a_IsDaylightCycleEnabled)
 Sets the daylight cycle to true / false. More...
 
void SetLinkedEndWorldName (const AString &a_Name)
 
void SetLinkedNetherWorldName (const AString &a_Name)
 
void SetLinkedOverworldName (const AString &a_Name)
 
virtual void SetMaxNetherPortalHeight (int a_NewMaxHeight) override
 
virtual void SetMaxNetherPortalWidth (int a_NewMaxWidth) override
 
void SetMaxViewDistance (int a_MaxViewDistance)
 
virtual void SetMinNetherPortalHeight (int a_NewMinHeight) override
 
virtual void SetMinNetherPortalWidth (int a_NewMinWidth) override
 
void SetNextBlockToTick (const Vector3i a_BlockPos)
 Causes the specified block to be ticked on the next Tick() call. More...
 
void SetSavingEnabled (bool a_IsSavingEnabled)
 Set whether saving chunks is enabled. More...
 
void SetShouldUseChatPrefixes (bool a_Flag)
 
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. More...
 
bool SetSpawn (int a_X, int a_Y, int a_Z)
 Set default spawn at the given coordinates. More...
 
void SetTicksUntilWeatherChange (int a_WeatherInterval)
 
virtual void SetTimeOfDay (cTickTime a_TimeOfDay) override
 
void SetTNTShrapnelLevel (eShrapnelLevel a_Flag)
 
bool SetTrapdoorOpen (int a_BlockX, int a_BlockY, int a_BlockZ, bool a_Open)
 Set the state of a trapdoor. More...
 
void SetWeather (eWeather a_NewWeather)
 Sets the specified weather; resets weather interval; asks and notifies plugins of the change. More...
 
bool ShouldBroadcastAchievementMessages (void) const
 
bool ShouldBroadcastDeathMessages (void) const
 
bool ShouldLavaSpawnFire (void) const
 
bool ShouldUseChatPrefixes (void) const
 
UInt32 SpawnBoat (double a_X, double a_Y, double a_Z, cBoat::eMaterial a_Material)
 
UInt32 SpawnBoat (Vector3d a_Pos, cBoat::eMaterial a_Material)
 Spawns a boat at the given coordinates. More...
 
UInt32 SpawnEnderCrystal (Vector3d a_Pos, bool a_ShowBottom)
 Spawns a new ender crystal at the specified block coords. More...
 
virtual UInt32 SpawnExperienceOrb (double a_X, double a_Y, double a_Z, int a_Reward) override
 OBSOLETE, use the Vector3d-based overload instead. More...
 
UInt32 SpawnExperienceOrb (Vector3d a_Pos, int a_Reward)
 Spawns an experience orb at the given location with the given reward. More...
 
UInt32 SpawnFallingBlock (int a_X, int a_Y, int a_Z, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 OBSOLETE, use the Vector3-based overload instead. More...
 
UInt32 SpawnFallingBlock (Vector3d a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 Spawns an falling block entity at the given position. More...
 
UInt32 SpawnFallingBlock (Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
 Spawns an falling block entity at the given position. More...
 
virtual UInt32 SpawnItemPickup (double a_PosX, double a_PosY, double a_PosZ, const cItem &a_Item, float a_SpeedX=0.f, float a_SpeedY=0.f, float a_SpeedZ=0.f, int a_LifetimeTicks=6000, bool a_CanCombine=true) override
 OBSOLETE, use the Vector3d-based overload instead. More...
 
UInt32 SpawnItemPickup (Vector3d a_Pos, const cItem &a_Item, Vector3f a_Speed, int a_LifetimeTicks=6000, bool a_CanCombine=true)
 Spawns a single pickup containing the specified item. More...
 
virtual void SpawnItemPickups (const cItems &a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed=1.0, bool a_IsPlayerCreated=false) override
 OBSOLETE, use the Vector3d-based overload instead. More...
 
virtual void SpawnItemPickups (const cItems &a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ, bool a_IsPlayerCreated=false) override
 OBSOLETE, use the Vector3d-based overload instead. More...
 
void SpawnItemPickups (const cItems &a_Pickups, Vector3d a_Pos, double a_FlyAwaySpeed=1.0, bool a_IsPlayerCreated=false)
 Spawns item pickups for each item in the list. More...
 
void SpawnItemPickups (const cItems &a_Pickups, Vector3d a_Pos, Vector3d a_Speed, bool a_IsPlayerCreated=false)
 Spawns item pickups for each item in the list. More...
 
void SpawnItemPickups (const cItems &a_Pickups, Vector3i a_BlockPos, double a_FlyAwaySpeed=1.0, bool a_IsPlayerCreated=false)
 Spawns item pickups for each item in the list. More...
 
UInt32 SpawnMinecart (double a_X, double a_Y, double a_Z, int a_MinecartType, const cItem &a_Content=cItem(), int a_BlockHeight=1)
 OBSOLETE, use the Vector3d-based overload instead. More...
 
UInt32 SpawnMinecart (Vector3d a_Pos, int a_MinecartType, const cItem &a_Content=cItem(), int a_BlockHeight=1)
 Spawns an minecart at the given coordinates. More...
 
virtual UInt32 SpawnMob (double a_PosX, double a_PosY, double a_PosZ, eMonsterType a_MonsterType, bool a_Baby=false) override
 Spawns a mob of the specified type. More...
 
UInt32 SpawnMobFinalize (std::unique_ptr< cMonster > a_Monster)
 Wraps cEntity::Initialize, doing Monster-specific things before spawning the monster. More...
 
UInt32 SpawnPrimedTNT (double a_X, double a_Y, double a_Z, int a_FuseTimeInSec=80, double a_InitialVelocityCoeff=1, bool a_ShouldPlayFuseSound=true)
 
UInt32 SpawnPrimedTNT (Vector3d a_Pos, int a_FuseTimeInSec=80, double a_InitialVelocityCoeff=1, bool a_ShouldPlayFuseSound=true)
 Spawns a new primed TNT entity at the specified block coords and specified fuse duration. More...
 
std::vector< UInt32SpawnSplitExperienceOrbs (double a_X, double a_Y, double a_Z, int a_Reward)
 OBSOLETE, use the Vector3d-based overload instead. More...
 
virtual std::vector< UInt32SpawnSplitExperienceOrbs (Vector3d a_Pos, int a_Reward) override
 Spawns experience orbs of the specified total value at the given location. More...
 
void Start ()
 Starts threads that belong to this world. More...
 
void Stop (cDeadlockDetect &a_DeadlockDetect)
 Stops threads that belong to this world (part of deinit). More...
 
void TabCompleteUserName (const AString &a_Text, AStringVector &a_Results)
 Appends all usernames starting with a_Text (case-insensitive) into Results. More...
 
void TickQueuedBlocks (void)
 Processes the blocks queued for ticking with a delay (m_BlockTickQueue[]) More...
 
bool TryGetHeight (int a_BlockX, int a_BlockZ, int &a_Height)
 Retrieves the world height at the specified coords; returns false if chunk not loaded / generated. More...
 
void UseBlockEntity (cPlayer *a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
 a_Player is using block entity at [x, y, z], handle that: More...
 
bool VillagersShouldHarvestCrops (void) const
 
virtual void WakeUpSimulators (Vector3i a_Block) override
 Wakes up the simulators for the specified block. More...
 
void WakeUpSimulatorsInArea (const cCuboid &a_Area)
 Wakes up the simulators for the specified area of blocks. More...
 
virtual bool WriteBlockArea (cBlockArea &a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) override
 Writes the block area into the specified coords. More...
 
virtual ~cWorld () override
 
- Public Member Functions inherited from cForEachChunkProvider
virtual ~cForEachChunkProvider ()
 
- Public Member Functions inherited from cWorldInterface
void SendBlockTo (const Vector3i a_BlockPos, const cPlayer &a_Player)
 Sends the block on those coords to the player. More...
 
virtual ~cWorldInterface ()
 
- Public Member Functions inherited from cBroadcastInterface
virtual ~cBroadcastInterface ()
 

Private Member Functions

bool CanSpawnAt (int a_X, int &a_Y, int a_Z)
 Can the specified coordinates be used as a spawn point? Returns true if spawn position is valid and sets a_Y to the valid spawn height. More...
 
bool CheckPlayerSpawnPoint (int a_PosX, int a_PosY, int a_PosZ)
 Check if player starting point is acceptable. More...
 
bool CheckPlayerSpawnPoint (Vector3i a_Pos)
 
eWeather ChooseNewWeather (void)
 Chooses a reasonable transition from the current weather to a new weather. More...
 
void GenerateRandomSpawn (int a_MaxSpawnRadius)
 Generates a random spawnpoint on solid land by walking chunks and finding their biomes. More...
 
bool GetLargeTreeAdjustment (Vector3i &a_BlockPos, NIBBLETYPE a_SaplingMeta)
 Checks if the sapling at the specified block coord is a part of a large-tree sapling (2x2). More...
 
void InitializeAndLoadMobSpawningValues (cIniFile &a_IniFile)
 Sets mob spawning values if nonexistant to their dimension specific defaults. More...
 
cFluidSimulatorInitializeFluidSimulator (cIniFile &a_IniFile, const char *a_FluidName, BLOCKTYPE a_SimulateBlock, BLOCKTYPE a_StationaryBlock)
 Creates a new fluid simulator, loads its settings from the inifile (a_FluidName section) More...
 
cRedstoneSimulatorInitializeRedstoneSimulator (cIniFile &a_IniFile)
 Creates a new redstone simulator. More...
 
void Tick (std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec)
 
void TickClients (std::chrono::milliseconds a_Dt)
 Ticks all clients that are in this world. More...
 
void TickMobs (std::chrono::milliseconds a_Dt)
 Handles the mob spawning / moving / destroying each tick. More...
 
void TickQueuedChunkDataSets ()
 Sets the chunk data queued in the m_SetChunkDataQueue queue into their chunk. More...
 
void TickQueuedEntityAdditions (void)
 Adds the entities queued in the m_EntitiesToAdd queue into their chunk. More...
 
void TickQueuedTasks (void)
 Executes all tasks queued onto the tick thread. More...
 
void TickWeather (float a_Dt)
 Handles the weather in each tick. More...
 
void UnloadUnusedChunks (void)
 Unloads all chunks immediately. More...
 
void UpdateSkyDarkness (void)
 

Private Attributes

std::set< eMonsterTypem_AllowedMobs
 
bool m_bAnimals
 
bool m_bCommandBlocksEnabled
 Whether command blocks are enabled or not. More...
 
bool m_bEnabledPVP
 
bool m_bFarmlandTramplingEnabled
 
std::vector< BlockTickQueueItem * > m_BlockTickQueue
 
std::vector< BlockTickQueueItem * > m_BlockTickQueueCopy
 
bool m_BroadcastAchievementMessages
 
bool m_BroadcastDeathMessages
 
bool m_bUseChatPrefixes
 Whether prefixes such as [INFO] are prepended to SendMessageXXX() / BroadcastChatXXX() functions. More...
 
cChunkMap m_ChunkMap
 
cChunkSender m_ChunkSender
 
cCriticalSection m_CSEntitiesToAdd
 Guards m_EntitiesToAdd. More...
 
cCriticalSection m_CSSetChunkDataQueue
 CS protecting m_SetChunkDataQueue. More...
 
cCriticalSection m_CSTasks
 Guards the m_Tasks. More...
 
AString m_DataPath
 The path to the root directory for the world files. More...
 
eDimension m_Dimension
 The dimension of the world, used by the client to provide correct lighting scheme. More...
 
std::vector< std::pair< OwnedEntity, cWorld * > > m_EntitiesToAdd
 List of entities that are scheduled for adding, waiting for the Tick thread to add them. More...
 
std::unique_ptr< cFireSimulatorm_FireSimulator
 
eGameMode m_GameMode
 
cChunkGeneratorThread m_Generator
 The thread responsible for generating chunks. More...
 
cChunkGeneratorCallbacks m_GeneratorCallbacks
 The callbacks that the ChunkGenerator uses to store new chunks and interface to plugins. More...
 
AString m_IniFileName
 
bool m_IsDaylightCycleEnabled
 
bool m_IsDeepSnowEnabled
 
std::atomic< bool > m_IsSavingEnabled
 Whether or not writing chunks to disk is currently enabled. More...
 
bool m_IsSpawnExplicitlySet
 
std::chrono::milliseconds m_LastChunkCheck
 
std::chrono::milliseconds m_LastSave
 
std::map< cMonster::eFamily, cTickTimeLongm_LastSpawnMonster
 
cFluidSimulatorm_LavaSimulator
 
cLightingThread m_Lighting
 
AString m_LinkedEndWorldName
 Name of the End world - where End portals should teleport. More...
 
AString m_LinkedNetherWorldName
 Name of the nether world - where Nether portals should teleport. More...
 
AString m_LinkedOverworldName
 The name of the overworld that portals in this world should link to. More...
 
cMapManager m_MapManager
 
int m_MaxCactusHeight
 
int m_MaxNetherPortalHeight
 
int m_MaxNetherPortalWidth
 
unsigned int m_MaxPlayers
 
int m_MaxRainTicks
 
int m_MaxSugarcaneHeight
 
int m_MaxSunnyTicks
 
int m_MaxThunderStormTicks
 
int m_MaxViewDistance
 The maximum view distance that a player can have in this world. More...
 
int m_MinNetherPortalHeight
 
int m_MinNetherPortalWidth
 
int m_MinRainTicks
 
int m_MinSunnyTicks
 
int m_MinThunderStormTicks
 
std::vector< cPlayer * > m_Players
 
cRedstoneSimulatorm_RedstoneSimulator
 
std::unique_ptr< cSandSimulatorm_SandSimulator
 
cScoreboard m_Scoreboard
 
std::vector< SetChunkDatam_SetChunkDataQueue
 Queue for the chunk data to be set into m_ChunkMap by the tick thread. More...
 
bool m_ShouldLavaSpawnFire
 
std::unique_ptr< cSimulatorManagerm_SimulatorManager
 
NIBBLETYPE m_SkyDarkness
 
int m_SpawnX
 
int m_SpawnY
 
int m_SpawnZ
 
cWorldStorage m_Storage
 
int m_StorageCompressionFactor
 
AString m_StorageSchema
 Name of the storage schema used to load and save chunks. More...
 
std::vector< std::pair< std::chrono::milliseconds, std::function< void(cWorld &)> > > m_Tasks
 Tasks that have been queued onto the tick thread, possibly to be executed at target tick in the future; guarded by m_CSTasks. More...
 
cTickThread m_TickThread
 
eShrapnelLevel m_TNTShrapnelLevel
 The level of DoExplosionAt() projecting random affected blocks as FallingBlock entities See the eShrapnelLevel enumeration for details. More...
 
size_t m_UnusedDirtyChunksCap
 The maximum number of allowed unused dirty chunks for this world. More...
 
bool m_VillagersShouldHarvestCrops
 
cFluidSimulatorm_WaterSimulator
 
eWeather m_Weather
 
int m_WeatherInterval
 
std::chrono::milliseconds m_WorldAge
 The age of the world. More...
 
std::chrono::milliseconds m_WorldDate
 The fully controllable age of the world. More...
 
AString m_WorldName
 
cTickTimeLong m_WorldTickAge
 The time since this world began, in ticks. More...
 

Detailed Description

Definition at line 47 of file World.h.

Constructor & Destructor Documentation

◆ cWorld()

cWorld::cWorld ( const AString a_WorldName,
const AString a_DataPath,
cDeadlockDetect a_DeadlockDetect,
const AStringVector a_WorldNames,
eDimension  a_Dimension = dimOverworld,
const AString a_LinkedOverworldName = {} 
)

Construct the world and read settings from its ini file.

Parameters
a_DeadlockDetectis used for tracking this world's age, detecting a possible deadlock.
a_WorldNamesis a list of all world names, used to validate linked worlds

Definition at line 137 of file World.cpp.

◆ ~cWorld()

cWorld::~cWorld ( )
overridevirtual

Definition at line 449 of file World.cpp.

Member Function Documentation

◆ AddChunkClient()

bool cWorld::AddChunkClient ( int  a_ChunkX,
int  a_ChunkZ,
cClientHandle a_Client 
)

Adds client to a chunk, if not already present; returns true if added, false if present.

Definition at line 2496 of file World.cpp.

◆ AddEntity()

void cWorld::AddEntity ( OwnedEntity  a_Entity,
cWorld a_OldWorld = nullptr 
)

Adds the entity into its appropriate chunk; takes ownership of the entity ptr.

The entity is added lazily - this function only puts it in a queue that is then processed by the Tick thread. If a_OldWorld is provided, a corresponding ENTITY_CHANGED_WORLD event is triggerred after the addition.

Definition at line 2759 of file World.cpp.

◆ AreCommandBlocksEnabled()

bool cWorld::AreCommandBlocksEnabled ( void  ) const
inline

Definition at line 705 of file World.h.

◆ BroadcastAttachEntity()

void cWorld::BroadcastAttachEntity ( const cEntity a_Entity,
const cEntity a_Vehicle 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 109 of file Broadcaster.cpp.

◆ BroadcastBlockAction()

void cWorld::BroadcastBlockAction ( Vector3i  a_BlockPos,
Byte  a_Byte1,
Byte  a_Byte2,
BLOCKTYPE  a_BlockType,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 122 of file Broadcaster.cpp.

◆ BroadcastBlockBreakAnimation()

void cWorld::BroadcastBlockBreakAnimation ( UInt32  a_EntityID,
Vector3i  a_BlockPos,
Int8  a_Stage,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 135 of file Broadcaster.cpp.

◆ BroadcastBlockEntity()

void cWorld::BroadcastBlockEntity ( Vector3i  a_BlockPos,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

If there is a block entity at the specified coods, sends it to all clients except a_Exclude.

Implements cBroadcastInterface.

Definition at line 148 of file Broadcaster.cpp.

◆ BroadcastBossBarUpdateHealth()

void cWorld::BroadcastBossBarUpdateHealth ( const cEntity a_Entity,
UInt32  a_UniqueID,
float  a_FractionFilled 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 174 of file Broadcaster.cpp.

◆ BroadcastChat() [1/2]

void cWorld::BroadcastChat ( const AString a_Message,
const cClientHandle a_Exclude = nullptr,
eMessageType  a_ChatPrefix = mtCustom 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 187 of file Broadcaster.cpp.

◆ BroadcastChat() [2/2]

void cWorld::BroadcastChat ( const cCompositeChat a_Message,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 205 of file Broadcaster.cpp.

◆ BroadcastChatDeath()

virtual void cWorld::BroadcastChatDeath ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 166 of file World.h.

◆ BroadcastChatFailure()

virtual void cWorld::BroadcastChatFailure ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 162 of file World.h.

◆ BroadcastChatFatal()

virtual void cWorld::BroadcastChatFatal ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 165 of file World.h.

◆ BroadcastChatInfo()

virtual void cWorld::BroadcastChatInfo ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 161 of file World.h.

◆ BroadcastChatSuccess()

virtual void cWorld::BroadcastChatSuccess ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 163 of file World.h.

◆ BroadcastChatWarning()

virtual void cWorld::BroadcastChatWarning ( const AString a_Message,
const cClientHandle a_Exclude = nullptr 
)
inlineoverridevirtual

Implements cBroadcastInterface.

Definition at line 164 of file World.h.

◆ BroadcastCollectEntity()

void cWorld::BroadcastCollectEntity ( const cEntity a_Collected,
const cEntity a_Collector,
unsigned  a_Count,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 218 of file Broadcaster.cpp.

◆ BroadcastDestroyEntity()

void cWorld::BroadcastDestroyEntity ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 231 of file Broadcaster.cpp.

◆ BroadcastDetachEntity()

void cWorld::BroadcastDetachEntity ( const cEntity a_Entity,
const cEntity a_PreviousVehicle 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 244 of file Broadcaster.cpp.

◆ BroadcastDisplayObjective()

void cWorld::BroadcastDisplayObjective ( const AString a_Objective,
cScoreboard::eDisplaySlot  a_Display 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 257 of file Broadcaster.cpp.

◆ BroadcastEntityAnimation()

void cWorld::BroadcastEntityAnimation ( const cEntity a_Entity,
EntityAnimation  a_Animation,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 374 of file Broadcaster.cpp.

◆ BroadcastEntityEffect()

void cWorld::BroadcastEntityEffect ( const cEntity a_Entity,
int  a_EffectID,
int  a_Amplifier,
int  a_Duration,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 270 of file Broadcaster.cpp.

◆ BroadcastEntityEquipment()

void cWorld::BroadcastEntityEquipment ( const cEntity a_Entity,
short  a_SlotNum,
const cItem a_Item,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 283 of file Broadcaster.cpp.

◆ BroadcastEntityHeadLook()

void cWorld::BroadcastEntityHeadLook ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 296 of file Broadcaster.cpp.

◆ BroadcastEntityLook()

void cWorld::BroadcastEntityLook ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 309 of file Broadcaster.cpp.

◆ BroadcastEntityMetadata()

void cWorld::BroadcastEntityMetadata ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 322 of file Broadcaster.cpp.

◆ BroadcastEntityPosition()

void cWorld::BroadcastEntityPosition ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 335 of file Broadcaster.cpp.

◆ BroadcastEntityProperties()

void cWorld::BroadcastEntityProperties ( const cEntity a_Entity)

Definition at line 348 of file Broadcaster.cpp.

◆ BroadcastEntityVelocity()

void cWorld::BroadcastEntityVelocity ( const cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 361 of file Broadcaster.cpp.

◆ BroadcastLeashEntity()

void cWorld::BroadcastLeashEntity ( const cEntity a_Entity,
const cEntity a_EntityLeashedTo 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 387 of file Broadcaster.cpp.

◆ BroadcastParticleEffect() [1/2]

void cWorld::BroadcastParticleEffect ( const AString a_ParticleName,
Vector3f  a_Src,
Vector3f  a_Offset,
float  a_ParticleData,
int  a_ParticleAmount,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 400 of file Broadcaster.cpp.

◆ BroadcastParticleEffect() [2/2]

void cWorld::BroadcastParticleEffect ( const AString a_ParticleName,
Vector3f  a_Src,
Vector3f  a_Offset,
float  a_ParticleData,
int  a_ParticleAmount,
std::array< int, 2 >  a_Data,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 413 of file Broadcaster.cpp.

◆ BroadcastPlayerListAddPlayer()

void cWorld::BroadcastPlayerListAddPlayer ( const cPlayer a_Player,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 426 of file Broadcaster.cpp.

◆ BroadcastPlayerListHeaderFooter()

void cWorld::BroadcastPlayerListHeaderFooter ( const cCompositeChat a_Header,
const cCompositeChat a_Footer 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 439 of file Broadcaster.cpp.

◆ BroadcastPlayerListRemovePlayer()

void cWorld::BroadcastPlayerListRemovePlayer ( const cPlayer a_Player,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 452 of file Broadcaster.cpp.

◆ BroadcastPlayerListUpdateDisplayName()

void cWorld::BroadcastPlayerListUpdateDisplayName ( const cPlayer a_Player,
const AString a_CustomName,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 465 of file Broadcaster.cpp.

◆ BroadcastPlayerListUpdateGameMode()

void cWorld::BroadcastPlayerListUpdateGameMode ( const cPlayer a_Player,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 478 of file Broadcaster.cpp.

◆ BroadcastPlayerListUpdatePing()

void cWorld::BroadcastPlayerListUpdatePing ( )
overridevirtual

Implements cBroadcastInterface.

Definition at line 491 of file Broadcaster.cpp.

◆ BroadcastRemoveEntityEffect()

void cWorld::BroadcastRemoveEntityEffect ( const cEntity a_Entity,
int  a_EffectID,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 504 of file Broadcaster.cpp.

◆ BroadcastScoreboardObjective()

void cWorld::BroadcastScoreboardObjective ( const AString a_Name,
const AString a_DisplayName,
Byte  a_Mode 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 517 of file Broadcaster.cpp.

◆ BroadcastScoreUpdate()

void cWorld::BroadcastScoreUpdate ( const AString a_Objective,
const AString a_Player,
cObjective::Score  a_Score,
Byte  a_Mode 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 530 of file Broadcaster.cpp.

◆ BroadcastSoundEffect()

void cWorld::BroadcastSoundEffect ( const AString a_SoundName,
Vector3d  a_Position,
float  a_Volume,
float  a_Pitch,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 543 of file Broadcaster.cpp.

◆ BroadcastSoundParticleEffect()

void cWorld::BroadcastSoundParticleEffect ( const EffectID  a_EffectID,
Vector3i  a_SrcPos,
int  a_Data,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 556 of file Broadcaster.cpp.

◆ BroadcastSpawnEntity()

void cWorld::BroadcastSpawnEntity ( cEntity a_Entity,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 569 of file Broadcaster.cpp.

◆ BroadcastThunderbolt()

void cWorld::BroadcastThunderbolt ( Vector3i  a_BlockPos,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 582 of file Broadcaster.cpp.

◆ BroadcastTimeUpdate()

void cWorld::BroadcastTimeUpdate ( const cClientHandle a_Exclude = nullptr)
overridevirtual

Implements cBroadcastInterface.

Definition at line 595 of file Broadcaster.cpp.

◆ BroadcastUnleashEntity()

void cWorld::BroadcastUnleashEntity ( const cEntity a_Entity)
overridevirtual

Implements cBroadcastInterface.

Definition at line 608 of file Broadcaster.cpp.

◆ BroadcastWeather()

void cWorld::BroadcastWeather ( eWeather  a_Weather,
const cClientHandle a_Exclude = nullptr 
)
overridevirtual

Implements cBroadcastInterface.

Definition at line 621 of file Broadcaster.cpp.

◆ CanSpawnAt()

bool cWorld::CanSpawnAt ( int  a_X,
int &  a_Y,
int  a_Z 
)
private

Can the specified coordinates be used as a spawn point? Returns true if spawn position is valid and sets a_Y to the valid spawn height.

Definition at line 782 of file World.cpp.

◆ CastThunderbolt() [1/2]

void cWorld::CastThunderbolt ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ 
)

Definition at line 460 of file World.cpp.

◆ CastThunderbolt() [2/2]

void cWorld::CastThunderbolt ( Vector3i  a_Block)

Casts a thunderbolt at the specified coords.

Definition at line 470 of file World.cpp.

◆ ChangeWeather()

void cWorld::ChangeWeather ( void  )

Forces a weather change in the next game tick.

Definition at line 585 of file World.cpp.

◆ CheckPlayerSpawnPoint() [1/2]

bool cWorld::CheckPlayerSpawnPoint ( int  a_PosX,
int  a_PosY,
int  a_PosZ 
)
inlineprivate

Check if player starting point is acceptable.

Definition at line 1144 of file World.h.

◆ CheckPlayerSpawnPoint() [2/2]

bool cWorld::CheckPlayerSpawnPoint ( Vector3i  a_Pos)
private

Definition at line 855 of file World.cpp.

◆ ChooseNewWeather()

eWeather cWorld::ChooseNewWeather ( void  )
private

Chooses a reasonable transition from the current weather to a new weather.

Definition at line 894 of file World.cpp.

◆ ChunkLighted()

void cWorld::ChunkLighted ( int  a_ChunkX,
int  a_ChunkZ,
const cChunkDef::BlockNibbles a_BlockLight,
const cChunkDef::BlockNibbles a_SkyLight 
)

Definition at line 2189 of file World.cpp.

◆ ChunkLoadFailed()

void cWorld::ChunkLoadFailed ( int  a_ChunkX,
int  a_ChunkZ 
)

Marks the chunk as failed-to-load:

Definition at line 2551 of file World.cpp.

◆ CollectPickupsByEntity()

void cWorld::CollectPickupsByEntity ( cEntity a_Entity)

Definition at line 2257 of file World.cpp.

◆ CompareChunkClients()

void cWorld::CompareChunkClients ( int  a_ChunkX1,
int  a_ChunkZ1,
int  a_ChunkX2,
int  a_ChunkZ2,
cClientDiffCallback a_Callback 
)

Compares clients of two chunks, calls the callback accordingly.

Definition at line 2487 of file World.cpp.

◆ CreateProjectile() [1/2]

UInt32 cWorld::CreateProjectile ( double  a_PosX,
double  a_PosY,
double  a_PosZ,
cProjectileEntity::eKind  a_Kind,
cEntity a_Creator,
const cItem a_Item,
const Vector3d a_Speed = nullptr 
)

OBSOLETE, use the Vector3d-based overload instead.

Creates a projectile of the specified type. Returns the projectile's UniqueID if successful, cEntity::INVALID_ID otherwise Item parameter is currently used for Fireworks to correctly set entity metadata based on item metadata.

Definition at line 2969 of file World.cpp.

◆ CreateProjectile() [2/2]

UInt32 cWorld::CreateProjectile ( Vector3d  a_Pos,
cProjectileEntity::eKind  a_Kind,
cEntity a_Creator,
const cItem a_Item,
const Vector3d a_Speed = nullptr 
)

Creates a projectile of the specified type.

Returns the projectile's UniqueID if successful, cEntity::INVALID_ID otherwise Item parameter is currently used for Fireworks to correctly set entity metadata based on item metadata.

Definition at line 2948 of file World.cpp.

◆ DigBlock() [1/2]

bool cWorld::DigBlock ( int  a_X,
int  a_Y,
int  a_Z,
cEntity a_Digger = nullptr 
)
inline

OBSOLETE, use the Vector3-based overload instead.

Replaces the specified block with air, and calls the apropriate block handlers (OnBreaking(), OnBroken()). Wakes up the simulators. Doesn't produce pickups, use DropBlockAsPickups() for that instead. Returns true on success, false if the chunk is not loaded.

Definition at line 558 of file World.h.

◆ DigBlock() [2/2]

bool cWorld::DigBlock ( Vector3i  a_BlockPos,
const cEntity a_Digger = nullptr 
)

Replaces the specified block with air, and calls the OnBroken block handler.

Wakes up the simulators. Doesn't produce pickups, use DropBlockAsPickups() for that instead. Returns true on success, false if the chunk is not loaded.

Definition at line 2069 of file World.cpp.

◆ DoExplosionAt()

void cWorld::DoExplosionAt ( double  a_ExplosionSize,
double  a_BlockX,
double  a_BlockY,
double  a_BlockZ,
bool  a_CanCauseFire,
eExplosionSource  a_Source,
void *  a_SourceData 
)
overridevirtual

Does an explosion with the specified strength at the specified coordinates.

Executes the HOOK_EXPLODING and HOOK_EXPLODED hooks as part of the processing. a_SourceData exact type depends on the a_Source, see the declaration of the esXXX constants in Defines.h for details. Exported to Lua manually in ManualBindings_World.cpp in order to support the variable a_SourceData param.

Implements cWorldInterface.

Definition at line 1384 of file World.cpp.

◆ DoWithBlockEntityAt()

bool cWorld::DoWithBlockEntityAt ( Vector3i  a_Position,
cBlockEntityCallback  a_Callback 
)
overridevirtual

Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, and whatever the callback returns if found.

Implements cWorldInterface.

Definition at line 1420 of file World.cpp.

◆ DoWithChunk()

bool cWorld::DoWithChunk ( int  a_ChunkX,
int  a_ChunkZ,
cChunkCallback  a_Callback 
)

Calls the callback for the chunk specified, with ChunkMapCS locked.

Returns false if the chunk doesn't exist, otherwise returns the same value as the callback

Definition at line 1451 of file World.cpp.

◆ DoWithChunkAt()

bool cWorld::DoWithChunkAt ( Vector3i  a_BlockPos,
cChunkCallback  a_Callback 
)

Calls the callback for the chunk at the block position specified, with ChunkMapCS locked.

Returns false if the chunk isn't loaded, otherwise returns the same value as the callback

Definition at line 1460 of file World.cpp.

◆ DoWithEntityByID()

bool cWorld::DoWithEntityByID ( UInt32  a_UniqueID,
cEntityCallback  a_Callback 
)

Calls the callback if the entity with the specified ID is found, with the entity object as the callback param.

Returns true if entity found and callback returned false.

Definition at line 2464 of file World.cpp.

◆ DoWithNearestPlayer()

bool cWorld::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, otherwise returns the same value as the callback.

Definition at line 2356 of file World.cpp.

◆ DoWithPlayer()

bool cWorld::DoWithPlayer ( const AString a_PlayerName,
cPlayerListCallback  a_Callback 
)

Calls the callback for the player of the given name; returns true if the player was found and the callback called, false if player not found.

Callback return value is ignored. If there are multiple players of the same name, only (random) one is processed by the callback.

Definition at line 2284 of file World.cpp.

◆ DoWithPlayerByUUID()

bool cWorld::DoWithPlayerByUUID ( const cUUID a_PlayerUUID,
cPlayerListCallback  a_Callback 
)

Finds the player over his uuid and calls the callback.

Definition at line 2339 of file World.cpp.

◆ DropBlockAsPickups()

bool cWorld::DropBlockAsPickups ( Vector3i  a_BlockPos,
const cEntity a_Digger = nullptr,
const cItem a_Tool = nullptr 
)

Digs the specified block, and spawns the appropriate pickups for it.

a_Digger is an optional entity causing the digging, usually the player. a_Tool is an optional item used to dig up the block, used by the handlers (empty hand vs shears produce different pickups from leaves). An empty hand is assumed if a_Tool is nullptr. Returns true on success, false if the chunk is not loaded.

Definition at line 2090 of file World.cpp.

◆ FastSetBlock()

void cWorld::FastSetBlock ( Vector3i  a_BlockPos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
inline

Sets the block at the specified coords to the specified value.

The replacement doesn't trigger block updates, nor wake up simulators. The replaced blocks aren't checked for block entities (block entity is leaked if it exists at this block)

Definition at line 356 of file World.h.

◆ FindAndDoWithPlayer()

bool cWorld::FindAndDoWithPlayer ( const AString a_PlayerNameHint,
cPlayerListCallback  a_Callback 
)

Finds a player from a partial or complete player name and calls the callback - case-insensitive.

Definition at line 2303 of file World.cpp.

◆ ForceSendChunkTo()

void cWorld::ForceSendChunkTo ( int  a_ChunkX,
int  a_ChunkZ,
cChunkSender::Priority  a_Priority,
cClientHandle a_Client 
)

Sends the chunk to the client specified, even if the client already has the chunk.

If the chunk's not valid, the request is postponed (ChunkSender will send that chunk when it becomes valid + lighted).

Definition at line 2532 of file World.cpp.

◆ ForEachBlockEntityInChunk()

bool cWorld::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 processed, false if the callback aborted by returning true.

Definition at line 1375 of file World.cpp.

◆ ForEachChunkInRect()

bool cWorld::ForEachChunkInRect ( int  a_MinChunkX,
int  a_MaxChunkX,
int  a_MinChunkZ,
int  a_MaxChunkZ,
cChunkDataCallback &  a_Callback 
)
overridevirtual

Calls the callback for each chunk in the coords specified (all cords are inclusive).

Returns true if all chunks have been processed successfully

Implements cForEachChunkProvider.

Definition at line 2694 of file World.cpp.

◆ ForEachEntity()

bool cWorld::ForEachEntity ( cEntityCallback  a_Callback)

Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true.

Definition at line 2427 of file World.cpp.

◆ ForEachEntityInBox()

bool cWorld::ForEachEntityInBox ( const cBoundingBox a_Box,
cEntityCallback  a_Callback 
)
overridevirtual

Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.

Returns true if all entities processed, false if the callback aborted by returning true. If any chunk in the box is missing, ignores the entities in that chunk silently.

Implements cWorldInterface.

Definition at line 2445 of file World.cpp.

◆ ForEachEntityInChunk()

bool cWorld::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, false if the callback aborted by returning true.

Definition at line 2436 of file World.cpp.

◆ ForEachLoadedChunk()

bool cWorld::ForEachLoadedChunk ( cFunctionRef< bool(int, int)>  a_Callback)

Calls the callback for each loaded chunk.

Returns true if all chunks have been processed successfully

Definition at line 2703 of file World.cpp.

◆ ForEachPlayer()

bool cWorld::ForEachPlayer ( cPlayerListCallback  a_Callback)
overridevirtual

Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true.

Implements cWorldInterface.

Definition at line 2266 of file World.cpp.

◆ GenerateChunk()

void cWorld::GenerateChunk ( int  a_ChunkX,
int  a_ChunkZ 
)

Generates the given chunk.

Definition at line 2667 of file World.cpp.

◆ GenerateRandomSpawn()

void cWorld::GenerateRandomSpawn ( int  a_MaxSpawnRadius)
private

Generates a random spawnpoint on solid land by walking chunks and finding their biomes.

Definition at line 700 of file World.cpp.

◆ GetBiomeAt()

EMCSBiome cWorld::GetBiomeAt ( int  a_BlockX,
int  a_BlockZ 
)

Returns the biome at the specified coords.

Reads the biome from the chunk, if loaded, otherwise uses the world generator to provide the biome value

Definition at line 1694 of file World.cpp.

◆ GetBlock()

BLOCKTYPE cWorld::GetBlock ( Vector3i  a_BlockPos) const
inline

Returns the block type at the specified position.

Returns 0 if the chunk is not valid.

Definition at line 363 of file World.h.

◆ GetBlockBlockLight()

NIBBLETYPE cWorld::GetBlockBlockLight ( Vector3i  a_BlockPos) const

Returns the block-light value at the specified block position.

Returns 0 if chunk not valid.

Definition at line 1770 of file World.cpp.

◆ GetBlockInfo()

bool cWorld::GetBlockInfo ( Vector3i  a_BlockPos,
BLOCKTYPE a_BlockType,
NIBBLETYPE a_Meta,
NIBBLETYPE a_SkyLight,
NIBBLETYPE a_BlockLight 
) const

Queries the whole block specification from the world.

Returns true if all block info was retrieved successfully, false if not (invalid chunk / bad position). Exported in ManualBindings_World.cpp.

Definition at line 1788 of file World.cpp.

◆ GetBlockMeta()

NIBBLETYPE cWorld::GetBlockMeta ( Vector3i  a_BlockPos) const
inline

Returns the block meta at the specified position.

Returns 0 if the chunk is not valid.

Definition at line 370 of file World.h.

◆ GetBlocks()

bool cWorld::GetBlocks ( sSetBlockVector a_Blocks,
bool  a_ContinueOnFailure 
)

Retrieves block types of the specified blocks.

If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read.

Definition at line 2060 of file World.cpp.

◆ GetBlockSkyLight()

NIBBLETYPE cWorld::GetBlockSkyLight ( Vector3i  a_BlockPos) const

Returns the sky light value at the specified block position.

The sky light is "raw" - not affected by time-of-day. Returns 0 if chunk not valid.

Definition at line 1761 of file World.cpp.

◆ GetBlockTypeMeta()

bool cWorld::GetBlockTypeMeta ( Vector3i  a_BlockPos,
BLOCKTYPE a_BlockType,
NIBBLETYPE a_BlockMeta 
) const

Retrieves the block type and meta at the specified coords.

Stores the result into a_BlockType and a_BlockMeta. Returns true if successful, false if chunk not present. TODO: Export in ManualBindings_World.cpp.

Definition at line 1779 of file World.cpp.

◆ GetBroadcastManager()

virtual cBroadcastInterface& cWorld::GetBroadcastManager ( void  )
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 203 of file World.h.

◆ GetChunkData()

bool cWorld::GetChunkData ( cChunkCoords  a_Coords,
cChunkDataCallback &  a_Callback 
) const

Calls the callback with the chunk's data, if available (with ChunkCS locked).

Returns true if the chunk was reported successfully, false if not (chunk not present or callback failed).

Definition at line 2202 of file World.cpp.

◆ GetChunkMap()

cChunkMap* cWorld::GetChunkMap ( void  )
inline

Definition at line 852 of file World.h.

◆ GetChunkStats()

void cWorld::GetChunkStats ( int &  a_NumValid,
int &  a_NumDirty,
int &  a_NumInLightingQueue 
)

Returns the number of chunks loaded and dirty, and in the lighting queue.

Definition at line 2828 of file World.cpp.

◆ GetDataPath()

const AString& cWorld::GetDataPath ( void  ) const
inline

Returns the data path to the world data.

Definition at line 694 of file World.h.

◆ GetDefaultWeatherInterval()

int cWorld::GetDefaultWeatherInterval ( eWeather  a_Weather) const

Returns the default weather interval for the specific weather type.

Returns -1 for any unknown weather.

Definition at line 531 of file World.cpp.

◆ GetDimension()

virtual eDimension cWorld::GetDimension ( void  ) const
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 133 of file World.h.

◆ GetGameMode()

eGameMode cWorld::GetGameMode ( void  ) const
inline

Returns the current game mode.

Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable

Definition at line 108 of file World.h.

◆ GetGenerator()

cChunkGeneratorThread& cWorld::GetGenerator ( void  )
inline

Definition at line 850 of file World.h.

◆ GetGeneratorQueueLength()

size_t cWorld::GetGeneratorQueueLength ( void  )
inline

Definition at line 766 of file World.h.

◆ GetHeight()

int cWorld::GetHeight ( int  a_BlockX,
int  a_BlockZ 
)
overridevirtual

Returns the world height at the specified coords; waits for the chunk to get loaded / generated.

Implements cWorldInterface.

Definition at line 2123 of file World.cpp.

◆ GetIniFileName()

const AString& cWorld::GetIniFileName ( void  ) const
inline

Returns the name of the world.ini file used by this world.

Definition at line 697 of file World.h.

◆ GetLargeTreeAdjustment()

bool cWorld::GetLargeTreeAdjustment ( Vector3i a_BlockPos,
NIBBLETYPE  a_SaplingMeta 
)
private

Checks if the sapling at the specified block coord is a part of a large-tree sapling (2x2).

If so, adjusts the coords so that they point to the northwest (XM ZM) corner of the sapling area and returns true. Returns false if not a part of large-tree sapling.

Definition at line 1530 of file World.cpp.

◆ GetLavaSimulator()

cFluidSimulator* cWorld::GetLavaSimulator ( void  )
inline

Definition at line 600 of file World.h.

◆ GetLightingQueueLength()

size_t cWorld::GetLightingQueueLength ( void  )
inline

Definition at line 767 of file World.h.

◆ GetLightingThread()

cLightingThread& cWorld::GetLightingThread ( void  )
inline

Definition at line 771 of file World.h.

◆ GetLinkedEndWorldName()

AString cWorld::GetLinkedEndWorldName ( void  ) const
inline

Definition at line 724 of file World.h.

◆ GetLinkedNetherWorldName()

AString cWorld::GetLinkedNetherWorldName ( void  ) const
inline

Definition at line 721 of file World.h.

◆ GetLinkedOverworldName()

AString cWorld::GetLinkedOverworldName ( void  ) const
inline

Definition at line 727 of file World.h.

◆ GetMapManager()

cMapManager& cWorld::GetMapManager ( void  )
inline

Returns the associated map manager instance.

Definition at line 703 of file World.h.

◆ GetMaxCactusHeight()

int cWorld::GetMaxCactusHeight ( void  ) const
inline

Definition at line 859 of file World.h.

◆ GetMaxNetherPortalHeight()

virtual int cWorld::GetMaxNetherPortalHeight ( void  ) const
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 738 of file World.h.

◆ GetMaxNetherPortalWidth()

virtual int cWorld::GetMaxNetherPortalWidth ( void  ) const
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 732 of file World.h.

◆ GetMaxSugarcaneHeight()

int cWorld::GetMaxSugarcaneHeight ( void  ) const
inline

Definition at line 858 of file World.h.

◆ GetMaxViewDistance()

int cWorld::GetMaxViewDistance ( void  ) const
inline

Definition at line 711 of file World.h.

◆ GetMinNetherPortalHeight()

virtual int cWorld::GetMinNetherPortalHeight ( void  ) const
inlineoverridevirtual

Returns or sets the minumim or maximum netherportal height.

Implements cWorldInterface.

Definition at line 737 of file World.h.

◆ GetMinNetherPortalWidth()

virtual int cWorld::GetMinNetherPortalWidth ( void  ) const
inlineoverridevirtual

Returns or sets the minumim or maximum netherportal width.

Implements cWorldInterface.

Definition at line 731 of file World.h.

◆ GetName()

const AString& cWorld::GetName ( void  ) const
inline

Returns the name of the world.

Definition at line 691 of file World.h.

◆ GetNumChunks()

size_t cWorld::GetNumChunks ( void  ) const

Returns the number of chunks loaded

Definition at line 2810 of file World.cpp.

◆ GetNumUnusedDirtyChunks()

size_t cWorld::GetNumUnusedDirtyChunks ( void  ) const

Returns the number of unused dirty chunks.

That's the number of chunks that we can save and then unload.

Definition at line 2819 of file World.cpp.

◆ GetPlayerCount()

size_t cWorld::GetPlayerCount ( ) const

Returns the number of players currently in this world.

Definition at line 2454 of file World.cpp.

◆ GetRedstoneSimulator()

cRedstoneSimulator* cWorld::GetRedstoneSimulator ( void  )
inline

Definition at line 601 of file World.h.

◆ GetScoreBoard()

cScoreboard& cWorld::GetScoreBoard ( void  )
inline

Returns the associated scoreboard instance.

Definition at line 700 of file World.h.

◆ GetSeed()

int cWorld::GetSeed ( void  ) const
inline

Returns the seed of the world.

Definition at line 846 of file World.h.

◆ GetSignLines()

bool cWorld::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 coords, true if found.

Definition at line 1429 of file World.cpp.

◆ GetSimulatorManager()

cSimulatorManager* cWorld::GetSimulatorManager ( void  )
inline

Definition at line 597 of file World.h.

◆ GetSkyDarkness()

NIBBLETYPE cWorld::GetSkyDarkness ( )
inline

Get the current darkness level based on the time.

Definition at line 886 of file World.h.

◆ GetSpawnX()

int cWorld::GetSpawnX ( void  ) const
inline

Definition at line 585 of file World.h.

◆ GetSpawnY()

int cWorld::GetSpawnY ( void  ) const
inline

Definition at line 586 of file World.h.

◆ GetSpawnZ()

int cWorld::GetSpawnZ ( void  ) const
inline

Definition at line 587 of file World.h.

◆ GetStorage()

cWorldStorage& cWorld::GetStorage ( void  )
inline

Definition at line 851 of file World.h.

◆ GetStorageLoadQueueLength()

size_t cWorld::GetStorageLoadQueueLength ( void  )
inline

Definition at line 768 of file World.h.

◆ GetStorageSaveQueueLength()

size_t cWorld::GetStorageSaveQueueLength ( void  )
inline

Definition at line 769 of file World.h.

◆ GetTickRandomNumber()

int cWorld::GetTickRandomNumber ( int  a_Range)

Returns a random number in range [0 .

. a_Range].

Definition at line 2978 of file World.cpp.

◆ GetTicksUntilWeatherChange()

int cWorld::GetTicksUntilWeatherChange ( void  ) const
inline

Definition at line 86 of file World.h.

◆ GetTimeOfDay()

cTickTime cWorld::GetTimeOfDay ( void  ) const
overridevirtual

Implements cWorldInterface.

Definition at line 480 of file World.cpp.

◆ GetTNTShrapnelLevel()

eShrapnelLevel cWorld::GetTNTShrapnelLevel ( void  ) const
inline

Definition at line 708 of file World.h.

◆ GetWaterSimulator()

cFluidSimulator* cWorld::GetWaterSimulator ( void  )
inline

Definition at line 599 of file World.h.

◆ GetWeather()

eWeather cWorld::GetWeather ( void  ) const
inline

Returns the current weather.

Instead of comparing values directly to the weather constants, use IsWeatherXXX() functions, if possible

Definition at line 808 of file World.h.

◆ GetWorldAge()

cTickTimeLong cWorld::GetWorldAge ( void  ) const
overridevirtual

Implements cWorldInterface.

Definition at line 491 of file World.cpp.

◆ GetWorldDate()

cTickTimeLong cWorld::GetWorldDate ( ) const

Definition at line 500 of file World.cpp.

◆ GetWorldTickAge()

cTickTimeLong cWorld::GetWorldTickAge ( ) const

Definition at line 509 of file World.cpp.

◆ GrowPlantAt()

int cWorld::GrowPlantAt ( Vector3i  a_BlockPos,
int  a_NumStages = 1 
)

Grows the plant at the specified position by at most a_NumStages.

The block's Grow handler is invoked. Returns the number of stages the plant has grown, 0 if not a plant.

Definition at line 1676 of file World.cpp.

◆ GrowRipePlant() [1/2]

bool cWorld::GrowRipePlant ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
bool  a_IsByBonemeal = false 
)
inline

OBSOLETE, use the Vector3-based overload instead.

Grows the plant at the specified block to its ripe stage. a_IsByBonemeal is obsolete, do not use. Returns true if grown, false if not (invalid chunk, non-growable block, already ripe).

Definition at line 667 of file World.h.

◆ GrowRipePlant() [2/2]

bool cWorld::GrowRipePlant ( Vector3i  a_BlockPos)

Grows the plant at the specified block to its ripe stage.

Returns true if grown, false if not (invalid chunk, non-growable block, already ripe).

Definition at line 1685 of file World.cpp.

◆ GrowTree()

bool cWorld::GrowTree ( Vector3i  a_BlockPos)

Grows a tree at the specified coords.

If the specified block is a sapling, the tree is grown from that sapling. Otherwise a tree is grown based on the biome. Returns true if the tree was grown, false if not (invalid chunk, insufficient space). Exported in DeprecatedBindings due to the obsolete int-based overload.

Definition at line 1469 of file World.cpp.

◆ GrowTreeByBiome()

bool cWorld::GrowTreeByBiome ( Vector3i  a_BlockPos)

Grows a tree at the specified coords, based on the biome in the place.

Returns true if the tree was grown, false if not (invalid chunk, insufficient space). Exported in DeprecatedBindings due to the obsolete int-based overload.

Definition at line 1616 of file World.cpp.

◆ GrowTreeFromSapling()

bool cWorld::GrowTreeFromSapling ( Vector3i  a_BlockPos)

Grows a tree from the sapling at the specified coords.

If the sapling is a part of a large-tree sapling (2x2), a large tree growth is attempted. Returns true if the tree was grown, false if not (invalid chunk, insufficient space). Exported in DeprecatedBindings due to the obsolete int-based overload and obsolete additional SaplingMeta param.

Definition at line 1487 of file World.cpp.

◆ GrowTreeImage()

bool cWorld::GrowTreeImage ( const sSetBlockVector a_Blocks)

Imprints the specified blocks into the world, as long as each log block replaces only allowed blocks.

a_Blocks specifies the logs, leaves, vines and possibly other blocks that comprise a single tree. Returns true if the tree is imprinted successfully, false otherwise.

Definition at line 1631 of file World.cpp.

◆ HasChunkAnyClients()

bool cWorld::HasChunkAnyClients ( int  a_ChunkX,
int  a_ChunkZ 
) const

Definition at line 2229 of file World.cpp.

◆ InitializeAndLoadMobSpawningValues()

void cWorld::InitializeAndLoadMobSpawningValues ( cIniFile a_IniFile)
private

Sets mob spawning values if nonexistant to their dimension specific defaults.

Definition at line 917 of file World.cpp.

◆ InitializeFluidSimulator()

cFluidSimulator * cWorld::InitializeFluidSimulator ( cIniFile a_IniFile,
const char *  a_FluidName,
BLOCKTYPE  a_SimulateBlock,
BLOCKTYPE  a_StationaryBlock 
)
private

Creates a new fluid simulator, loads its settings from the inifile (a_FluidName section)

Definition at line 3081 of file World.cpp.

◆ InitializeRedstoneSimulator()

cRedstoneSimulator * cWorld::InitializeRedstoneSimulator ( cIniFile a_IniFile)
private

Creates a new redstone simulator.

Definition at line 3046 of file World.cpp.

◆ InitializeSpawn()

void cWorld::InitializeSpawn ( void  )

Definition at line 658 of file World.cpp.

◆ IsBlockDirectlyWatered()

bool cWorld::IsBlockDirectlyWatered ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ 
)

Definition at line 2883 of file World.cpp.

◆ IsChunkLighted()

bool cWorld::IsChunkLighted ( int  a_ChunkX,
int  a_ChunkZ 
)

Definition at line 2685 of file World.cpp.

◆ IsChunkQueued()

bool cWorld::IsChunkQueued ( int  a_ChunkX,
int  a_ChunkZ 
) const

Returns true iff the chunk is in the loader / generator queue.

Definition at line 2211 of file World.cpp.

◆ IsChunkValid()

bool cWorld::IsChunkValid ( int  a_ChunkX,
int  a_ChunkZ 
) const

Returns true iff the chunk is present and valid.

Definition at line 2220 of file World.cpp.

◆ IsDaylightCycleEnabled()

virtual bool cWorld::IsDaylightCycleEnabled ( void  ) const
inlinevirtual

Is the daylight cycle enabled?

Definition at line 89 of file World.h.

◆ IsDeepSnowEnabled()

bool cWorld::IsDeepSnowEnabled ( void  ) const
inline

Definition at line 127 of file World.h.

◆ IsFarmlandTramplingEnabled()

bool cWorld::IsFarmlandTramplingEnabled ( void  ) const
inline

Returns true if farmland trampling is enabled.

Definition at line 125 of file World.h.

◆ IsGameModeAdventure()

bool cWorld::IsGameModeAdventure ( void  ) const
inline

Returns true if the world is in Adventure mode.

Definition at line 117 of file World.h.

◆ IsGameModeCreative()

bool cWorld::IsGameModeCreative ( void  ) const
inline

Returns true if the world is in Creative mode.

Definition at line 111 of file World.h.

◆ IsGameModeSpectator()

bool cWorld::IsGameModeSpectator ( void  ) const
inline

Returns true if the world is in Spectator mode.

Definition at line 120 of file World.h.

◆ IsGameModeSurvival()

bool cWorld::IsGameModeSurvival ( void  ) const
inline

Returns true if the world is in Survival mode.

Definition at line 114 of file World.h.

◆ IsPVPEnabled()

bool cWorld::IsPVPEnabled ( void  ) const
inline

Definition at line 122 of file World.h.

◆ IsSavingEnabled()

bool cWorld::IsSavingEnabled ( void  ) const
inline

Get whether saving chunks is enabled.

Definition at line 81 of file World.h.

◆ IsSlimeChunk()

bool cWorld::IsSlimeChunk ( int  a_ChunkX,
int  a_ChunkZ 
) const

Returns true if slimes should spawn in the chunk.

Definition at line 3235 of file World.cpp.

◆ IsTrapdoorOpen()

bool cWorld::IsTrapdoorOpen ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ 
)

Is the trapdoor open? Returns false if there is no trapdoor at the specified coords.

Definition at line 2616 of file World.cpp.

◆ IsWeatherRain()

bool cWorld::IsWeatherRain ( void  ) const
inline

Returns true if the current weather is rainy.

Definition at line 817 of file World.h.

◆ IsWeatherRainAt()

bool cWorld::IsWeatherRainAt ( int  a_BlockX,
int  a_BlockZ 
)
inline

Returns true if it is raining at the specified location.

This takes into account biomes.

Definition at line 820 of file World.h.

◆ IsWeatherStorm()

bool cWorld::IsWeatherStorm ( void  ) const
inline

Returns true if the current weather is stormy.

Definition at line 826 of file World.h.

◆ IsWeatherStormAt()

bool cWorld::IsWeatherStormAt ( int  a_BlockX,
int  a_BlockZ 
)
inline

Returns true if the weather is stormy at the specified location.

This takes into account biomes.

Definition at line 829 of file World.h.

◆ IsWeatherSunny()

bool cWorld::IsWeatherSunny ( void  ) const
inline

Returns true if the current weather is sunny.

Definition at line 811 of file World.h.

◆ IsWeatherSunnyAt()

bool cWorld::IsWeatherSunnyAt ( int  a_BlockX,
int  a_BlockZ 
) const

Returns true if it is sunny at the specified location.

This takes into account biomes.

Definition at line 595 of file World.cpp.

◆ IsWeatherWet()

bool cWorld::IsWeatherWet ( void  ) const
inline

Returns true if the world currently has any precipitation - rain, storm or snow.

Definition at line 835 of file World.h.

◆ IsWeatherWetAt()

bool cWorld::IsWeatherWetAt ( int  a_BlockX,
int  a_BlockZ 
)
overridevirtual

Returns true if it is raining or storming at the specified location.

This takes into account biomes.

Implements cWorldInterface.

Definition at line 604 of file World.cpp.

◆ IsWeatherWetAtXYZ()

bool cWorld::IsWeatherWetAtXYZ ( Vector3i  a_Position)
overridevirtual

Returns true if it is raining or storming at the specified location, and the rain reaches (the bottom of) the specified block position.

Implements cWorldInterface.

Definition at line 613 of file World.cpp.

◆ MarkChunkDirty()

void cWorld::MarkChunkDirty ( int  a_ChunkX,
int  a_ChunkZ 
)

Definition at line 2150 of file World.cpp.

◆ MarkChunkSaved()

void cWorld::MarkChunkSaved ( int  a_ChunkX,
int  a_ChunkZ 
)

Definition at line 2168 of file World.cpp.

◆ MarkChunkSaving()

void cWorld::MarkChunkSaving ( int  a_ChunkX,
int  a_ChunkZ 
)

Definition at line 2159 of file World.cpp.

◆ PickupsFromBlock()

cItems cWorld::PickupsFromBlock ( Vector3i  a_BlockPos,
const cEntity a_Digger = nullptr,
const cItem a_Tool = nullptr 
)

Returns all the pickups that would result if the a_Digger dug up the block at a_BlockPos using a_Tool a_Digger is usually a player, but can be nullptr for natural causes.

a_Tool is an optional item used to dig up the block, used by the handlers (empty hand vs shears produce different pickups from leaves). An empty hand is assumed if a_Tool is nullptr. Returns an empty cItems object if the chunk is not present.

Definition at line 2105 of file World.cpp.

◆ PlaceBlock()

void cWorld::PlaceBlock ( const Vector3i  a_Position,
const BLOCKTYPE  a_BlockType,
const NIBBLETYPE  a_BlockMeta 
)

Replaces the specified block with another, and calls the OnPlaced block handler.

The OnBroken block handler is called for the replaced block. Wakes up the simulators. If the chunk for any of the blocks is not loaded, the set operation is ignored silently.

Definition at line 2043 of file World.cpp.

◆ PrepareChunk()

void cWorld::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.

The specified chunk is queued to be loaded or generated, and lit if needed. The specified callback is called after the chunk has been prepared. If there's no preparation to do, only the callback is called. It is legal to call with no callback.

Definition at line 2542 of file World.cpp.

◆ QueueBlockForTick()

void cWorld::QueueBlockForTick ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
int  a_TicksToWait 
)

Queues the block to be ticked after the specified number of game ticks.

Definition at line 2868 of file World.cpp.

◆ QueueLightChunk()

void cWorld::QueueLightChunk ( int  a_ChunkX,
int  a_ChunkZ,
std::unique_ptr< cChunkCoordCallback a_Callback = {} 
)

Queues a chunk for lighting; a_Callback is called after the chunk is lighted.

Definition at line 2676 of file World.cpp.

◆ QueueSaveAllChunks()

void cWorld::QueueSaveAllChunks ( void  )

Queues a task to save all chunks onto the tick thread.

The prefferred way of saving chunks from external sources

Definition at line 2725 of file World.cpp.

◆ QueueSetChunkData()

void cWorld::QueueSetChunkData ( SetChunkData &&  a_SetChunkData)

Puts the chunk data into a queue to be set into the chunkmap in the tick thread.

Modifies the a_SetChunkData - moves the entities contained in it into the queue.

Definition at line 2177 of file World.cpp.

◆ QueueTask()

void cWorld::QueueTask ( std::function< void(cWorld &)>  a_Task)

Queues a task onto the tick thread.

The task object will be deleted once the task is finished

Definition at line 2734 of file World.cpp.

◆ QueueUnloadUnusedChunks()

void cWorld::QueueUnloadUnusedChunks ( void  )

Queues a task to unload unused chunks onto the tick thread.

The prefferred way of unloading.

Definition at line 2248 of file World.cpp.

◆ RegenerateChunk()

void cWorld::RegenerateChunk ( int  a_ChunkX,
int  a_ChunkZ 
)

Regenerate the given chunk.

Definition at line 2657 of file World.cpp.

◆ RemoveChunkClient()

void cWorld::RemoveChunkClient ( int  a_ChunkX,
int  a_ChunkZ,
cClientHandle a_Client 
)

Removes client from the chunk specified.

Definition at line 2505 of file World.cpp.

◆ RemoveClientFromChunks()

void cWorld::RemoveClientFromChunks ( cClientHandle a_Client)

Removes the client from all chunks it is present in.

Definition at line 2514 of file World.cpp.

◆ RemoveEntity()

OwnedEntity cWorld::RemoveEntity ( cEntity a_Entity)

Removes the entity from the world.

Returns an owning reference to the found entity.

Definition at line 2769 of file World.cpp.

◆ SaveAllChunks()

void cWorld::SaveAllChunks ( void  )

Saves all chunks immediately.

Dangerous interface, may deadlock, use QueueSaveAllChunks() instead

Definition at line 2712 of file World.cpp.

◆ ScheduleTask()

void cWorld::ScheduleTask ( cTickTime  a_DelayTicks,
std::function< void(cWorld &)>  a_Task 
)

Queues a lambda task onto the tick thread, with the specified delay.

Definition at line 2744 of file World.cpp.

◆ SendBlockEntity()

void cWorld::SendBlockEntity ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
cClientHandle a_Client 
)

If there is a block entity at the specified coords, sends it to the client specified.

Definition at line 2141 of file World.cpp.

◆ SendBlockTo() [1/3]

void cWorldInterface::SendBlockTo
inline

Sends the block on those coords to the player.

Definition at line 60 of file WorldInterface.h.

◆ SendBlockTo() [2/3]

virtual void cWorldInterface::SendBlockTo

Sends the block on those coords to the player.

◆ SendBlockTo() [3/3]

void cWorld::SendBlockTo ( int  a_X,
int  a_Y,
int  a_Z,
const cPlayer a_Player 
)
overridevirtual

Sends the block at the specified coords to the player.

Used mainly when plugins disable block-placing or block-breaking, to restore the previous block.

Implements cWorldInterface.

Definition at line 2114 of file World.cpp.

◆ SendChunkTo()

void cWorld::SendChunkTo ( int  a_ChunkX,
int  a_ChunkZ,
cChunkSender::Priority  a_Priority,
cClientHandle a_Client 
)

Sends the chunk to the client specified, if the client doesn't have the chunk yet.

If chunk not valid, the request is postponed (ChunkSender will send that chunk when it becomes valid + lighted).

Definition at line 2523 of file World.cpp.

◆ SendPlayerList()

void cWorld::SendPlayerList ( cPlayer a_DestPlayer)

Definition at line 2410 of file World.cpp.

◆ SetAreaBiome() [1/2]

bool cWorld::SetAreaBiome ( const cCuboid a_Area,
EMCSBiome  a_Biome 
)

Sets the biome at the area.

Returns true if successful, false if any subarea failed (chunk not loaded). (Re)sends the chunks to their relevant clients if successful. The cuboid needn't be sorted.

Definition at line 1721 of file World.cpp.

◆ SetAreaBiome() [2/2]

bool cWorld::SetAreaBiome ( int  a_MinX,
int  a_MaxX,
int  a_MinZ,
int  a_MaxZ,
EMCSBiome  a_Biome 
)

Sets the biome at the area.

Returns true if successful, false if any subarea failed (chunk not loaded). (Re)sends the chunks to their relevant clients if successful.

Definition at line 1712 of file World.cpp.

◆ SetBiomeAt()

bool cWorld::SetBiomeAt ( int  a_BlockX,
int  a_BlockZ,
EMCSBiome  a_Biome 
)

Sets the biome at the specified coords.

Returns true if successful, false if not (chunk not loaded). Doesn't resend the chunk to clients, use ForceSendChunkTo() for that.

Definition at line 1703 of file World.cpp.

◆ SetBlock()

void cWorld::SetBlock ( Vector3i  a_BlockPos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)

Sets the block at the specified coords to the specified value.

Full processing, incl. updating neighbors, is performed.

Definition at line 1743 of file World.cpp.

◆ SetBlockMeta()

void cWorld::SetBlockMeta ( Vector3i  a_BlockPos,
NIBBLETYPE  a_MetaData 
)

Sets the meta for the specified block, while keeping the blocktype.

Ignored if the chunk is invalid.

Definition at line 1752 of file World.cpp.

◆ SetChunkAlwaysTicked()

void cWorld::SetChunkAlwaysTicked ( int  a_ChunkX,
int  a_ChunkZ,
bool  a_AlwaysTicked = true 
)

Increments (a_AlwaysTicked == true) or decrements (false) the m_AlwaysTicked counter for the specified chunk.

If the m_AlwaysTicked counter is greater than zero, the chunk is ticked in the tick-thread regardless of whether it has any clients or not. This function allows nesting and task-concurrency (multiple separate tasks can request ticking and as long as at least one requests is active the chunk will be ticked).

Definition at line 3037 of file World.cpp.

◆ SetCommandBlockCommand() [1/2]

bool cWorld::SetCommandBlockCommand ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
const AString a_Command 
)

Sets the command block command.

Returns true if command changed.

Definition at line 2598 of file World.cpp.

◆ SetCommandBlockCommand() [2/2]

bool cWorld::SetCommandBlockCommand ( Vector3i  a_BlockPos,
const AString a_Command 
)
inline

Definition at line 321 of file World.h.

◆ SetCommandBlocksEnabled()

void cWorld::SetCommandBlocksEnabled ( bool  a_Flag)
inline

Definition at line 706 of file World.h.

◆ SetDaylightCycleEnabled()

virtual void cWorld::SetDaylightCycleEnabled ( bool  a_IsDaylightCycleEnabled)
inlinevirtual

Sets the daylight cycle to true / false.

Definition at line 92 of file World.h.

◆ SetLinkedEndWorldName()

void cWorld::SetLinkedEndWorldName ( const AString a_Name)
inline

Definition at line 725 of file World.h.

◆ SetLinkedNetherWorldName()

void cWorld::SetLinkedNetherWorldName ( const AString a_Name)
inline

Definition at line 722 of file World.h.

◆ SetLinkedOverworldName()

void cWorld::SetLinkedOverworldName ( const AString a_Name)
inline

Definition at line 728 of file World.h.

◆ SetMaxNetherPortalHeight()

virtual void cWorld::SetMaxNetherPortalHeight ( int  a_NewMaxHeight)
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 740 of file World.h.

◆ SetMaxNetherPortalWidth()

virtual void cWorld::SetMaxNetherPortalWidth ( int  a_NewMaxWidth)
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 734 of file World.h.

◆ SetMaxViewDistance()

void cWorld::SetMaxViewDistance ( int  a_MaxViewDistance)

Definition at line 1734 of file World.cpp.

◆ SetMinNetherPortalHeight()

virtual void cWorld::SetMinNetherPortalHeight ( int  a_NewMinHeight)
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 739 of file World.h.

◆ SetMinNetherPortalWidth()

virtual void cWorld::SetMinNetherPortalWidth ( int  a_NewMinWidth)
inlineoverridevirtual

Implements cWorldInterface.

Definition at line 733 of file World.h.

◆ SetNextBlockToTick()

void cWorld::SetNextBlockToTick ( const Vector3i  a_BlockPos)

Causes the specified block to be ticked on the next Tick() call.

Only one block coord per chunk may be set, a second call overwrites the first call

Definition at line 622 of file World.cpp.

◆ SetSavingEnabled()

void cWorld::SetSavingEnabled ( bool  a_IsSavingEnabled)
inline

Set whether saving chunks is enabled.

Definition at line 84 of file World.h.

◆ SetShouldUseChatPrefixes()

void cWorld::SetShouldUseChatPrefixes ( bool  a_Flag)
inline

Definition at line 715 of file World.h.

◆ SetSignLines()

bool cWorld::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.

a_Player is the player who this change belongs to, may be nullptr. Returns true if sign text changed.

Definition at line 2560 of file World.cpp.

◆ SetSpawn()

bool cWorld::SetSpawn ( int  a_X,
int  a_Y,
int  a_Z 
)

Set default spawn at the given coordinates.

Returns false if the new spawn couldn't be stored in the INI file.

Definition at line 631 of file World.cpp.

◆ SetTicksUntilWeatherChange()

void cWorld::SetTicksUntilWeatherChange ( int  a_WeatherInterval)
inline

Definition at line 98 of file World.h.

◆ SetTimeOfDay()

void cWorld::SetTimeOfDay ( cTickTime  a_TimeOfDay)
overridevirtual

Implements cWorldInterface.

Definition at line 518 of file World.cpp.

◆ SetTNTShrapnelLevel()

void cWorld::SetTNTShrapnelLevel ( eShrapnelLevel  a_Flag)
inline

Definition at line 709 of file World.h.

◆ SetTrapdoorOpen()

bool cWorld::SetTrapdoorOpen ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
bool  a_Open 
)

Set the state of a trapdoor.

Returns true if the trapdoor was updated, false if there was no trapdoor at those coords.

Definition at line 2633 of file World.cpp.

◆ SetWeather()

void cWorld::SetWeather ( eWeather  a_NewWeather)

Sets the specified weather; resets weather interval; asks and notifies plugins of the change.

Definition at line 556 of file World.cpp.

◆ ShouldBroadcastAchievementMessages()

bool cWorld::ShouldBroadcastAchievementMessages ( void  ) const
inline

Definition at line 718 of file World.h.

◆ ShouldBroadcastDeathMessages()

bool cWorld::ShouldBroadcastDeathMessages ( void  ) const
inline

Definition at line 717 of file World.h.

◆ ShouldLavaSpawnFire()

bool cWorld::ShouldLavaSpawnFire ( void  ) const
inline

Definition at line 129 of file World.h.

◆ ShouldUseChatPrefixes()

bool cWorld::ShouldUseChatPrefixes ( void  ) const
inline

Definition at line 714 of file World.h.

◆ SpawnBoat() [1/2]

UInt32 cWorld::SpawnBoat ( double  a_X,
double  a_Y,
double  a_Z,
cBoat::eMaterial  a_Material 
)
inline

Definition at line 480 of file World.h.

◆ SpawnBoat() [2/2]

UInt32 cWorld::SpawnBoat ( Vector3d  a_Pos,
cBoat::eMaterial  a_Material 
)

Spawns a boat at the given coordinates.

Returns the UniqueID of the spawned boat, or cEntity::INVALID_ID on failure.

Definition at line 1986 of file World.cpp.

◆ SpawnEnderCrystal()

UInt32 cWorld::SpawnEnderCrystal ( Vector3d  a_Pos,
bool  a_ShowBottom 
)

Spawns a new ender crystal at the specified block coords.

Returns the UniqueID of the created entity, or cEntity::INVALID_ID on failure.

Definition at line 2028 of file World.cpp.

◆ SpawnExperienceOrb() [1/2]

virtual UInt32 cWorld::SpawnExperienceOrb ( double  a_X,
double  a_Y,
double  a_Z,
int  a_Reward 
)
inlineoverridevirtual

OBSOLETE, use the Vector3d-based overload instead.

Spawns an experience orb at the given location with the given reward. Returns the UniqueID of the spawned experience orb, or cEntity::INVALID_ID on failure.

Implements cWorldInterface.

Definition at line 497 of file World.h.

◆ SpawnExperienceOrb() [2/2]

UInt32 cWorld::SpawnExperienceOrb ( Vector3d  a_Pos,
int  a_Reward 
)

Spawns an experience orb at the given location with the given reward.

Returns the UniqueID of the spawned experience orb, or cEntity::INVALID_ID on failure.

Definition at line 1894 of file World.cpp.

◆ SpawnFallingBlock() [1/3]

UInt32 cWorld::SpawnFallingBlock ( int  a_X,
int  a_Y,
int  a_Z,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
inline

OBSOLETE, use the Vector3-based overload instead.

Spawns an falling block entity at the given position. Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure.

Definition at line 462 of file World.h.

◆ SpawnFallingBlock() [2/3]

UInt32 cWorld::SpawnFallingBlock ( Vector3d  a_Pos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)

Spawns an falling block entity at the given position.

Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure.

Definition at line 1878 of file World.cpp.

◆ SpawnFallingBlock() [3/3]

UInt32 cWorld::SpawnFallingBlock ( Vector3i  a_BlockPos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
inline

Spawns an falling block entity at the given position.

Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure.

Definition at line 453 of file World.h.

◆ SpawnItemPickup() [1/2]

virtual UInt32 cWorld::SpawnItemPickup ( double  a_PosX,
double  a_PosY,
double  a_PosZ,
const cItem a_Item,
float  a_SpeedX = 0.f,
float  a_SpeedY = 0.f,
float  a_SpeedZ = 0.f,
int  a_LifetimeTicks = 6000,
bool  a_CanCombine = true 
)
inlineoverridevirtual

OBSOLETE, use the Vector3d-based overload instead.

Spawns a single pickup containing the specified item.

Implements cWorldInterface.

Definition at line 442 of file World.h.

◆ SpawnItemPickup() [2/2]

UInt32 cWorld::SpawnItemPickup ( Vector3d  a_Pos,
const cItem a_Item,
Vector3f  a_Speed,
int  a_LifetimeTicks = 6000,
bool  a_CanCombine = true 
)

Spawns a single pickup containing the specified item.

Definition at line 1863 of file World.cpp.

◆ SpawnItemPickups() [1/5]

virtual void cWorld::SpawnItemPickups ( const cItems a_Pickups,
double  a_BlockX,
double  a_BlockY,
double  a_BlockZ,
double  a_FlyAwaySpeed = 1.0,
bool  a_IsPlayerCreated = false 
)
inlineoverridevirtual

OBSOLETE, use the Vector3d-based overload instead.

Spawns item pickups for each item in the list. May compress pickups if too many entities.

Implements cWorldInterface.

Definition at line 422 of file World.h.

◆ SpawnItemPickups() [2/5]

virtual void cWorld::SpawnItemPickups ( const cItems a_Pickups,
double  a_BlockX,
double  a_BlockY,
double  a_BlockZ,
double  a_SpeedX,
double  a_SpeedY,
double  a_SpeedZ,
bool  a_IsPlayerCreated = false 
)
inlineoverridevirtual

OBSOLETE, use the Vector3d-based overload instead.

Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified.

Implements cWorldInterface.

Definition at line 432 of file World.h.

◆ SpawnItemPickups() [3/5]

void cWorld::SpawnItemPickups ( const cItems a_Pickups,
Vector3d  a_Pos,
double  a_FlyAwaySpeed = 1.0,
bool  a_IsPlayerCreated = false 
)

Spawns item pickups for each item in the list.

May compress pickups if too many entities.

Definition at line 1818 of file World.cpp.

◆ SpawnItemPickups() [4/5]

void cWorld::SpawnItemPickups ( const cItems a_Pickups,
Vector3d  a_Pos,
Vector3d  a_Speed,
bool  a_IsPlayerCreated = false 
)

Spawns item pickups for each item in the list.

May compress pickups if too many entities. All pickups get the speed specified.

Definition at line 1844 of file World.cpp.

◆ SpawnItemPickups() [5/5]

void cWorld::SpawnItemPickups ( const cItems a_Pickups,
Vector3i  a_BlockPos,
double  a_FlyAwaySpeed = 1.0,
bool  a_IsPlayerCreated = false 
)

Spawns item pickups for each item in the list.

The initial position of the pickups is at the center of the specified block, with a small random offset. May compress pickups if too many entities.

Definition at line 1806 of file World.cpp.

◆ SpawnMinecart() [1/2]

UInt32 cWorld::SpawnMinecart ( double  a_X,
double  a_Y,
double  a_Z,
int  a_MinecartType,
const cItem a_Content = cItem(),
int  a_BlockHeight = 1 
)
inline

OBSOLETE, use the Vector3d-based overload instead.

Spawns an minecart at the given coordinates. Returns the UniqueID of the spawned minecart, or cEntity::INVALID_ID on failure.

Definition at line 474 of file World.h.

◆ SpawnMinecart() [2/2]

UInt32 cWorld::SpawnMinecart ( Vector3d  a_Pos,
int  a_MinecartType,
const cItem a_Content = cItem(),
int  a_BlockHeight = 1 
)

Spawns an minecart at the given coordinates.

Returns the UniqueID of the spawned minecart, or cEntity::INVALID_ID on failure.

Definition at line 1958 of file World.cpp.

◆ SpawnMob()

UInt32 cWorld::SpawnMob ( double  a_PosX,
double  a_PosY,
double  a_PosZ,
eMonsterType  a_MonsterType,
bool  a_Baby = false 
)
overridevirtual

Spawns a mob of the specified type.

Returns the mob's UniqueID if recognized and spawned, cEntity::INVALID_ID otherwise

Implements cWorldInterface.

Definition at line 2897 of file World.cpp.

◆ SpawnMobFinalize()

UInt32 cWorld::SpawnMobFinalize ( std::unique_ptr< cMonster a_Monster)

Wraps cEntity::Initialize, doing Monster-specific things before spawning the monster.

Takes ownership of the given Monster reference.

Definition at line 2918 of file World.cpp.

◆ SpawnPrimedTNT() [1/2]

UInt32 cWorld::SpawnPrimedTNT ( double  a_X,
double  a_Y,
double  a_Z,
int  a_FuseTimeInSec = 80,
double  a_InitialVelocityCoeff = 1,
bool  a_ShouldPlayFuseSound = true 
)
inline

Definition at line 519 of file World.h.

◆ SpawnPrimedTNT() [2/2]

UInt32 cWorld::SpawnPrimedTNT ( Vector3d  a_Pos,
int  a_FuseTimeInSec = 80,
double  a_InitialVelocityCoeff = 1,
bool  a_ShouldPlayFuseSound = true 
)

Spawns a new primed TNT entity at the specified block coords and specified fuse duration.

Initial velocity is given based on the relative coefficient provided. Returns the UniqueID of the created entity, or cEntity::INVALID_ID on failure.

Definition at line 2001 of file World.cpp.

◆ SpawnSplitExperienceOrbs() [1/2]

std::vector<UInt32> cWorld::SpawnSplitExperienceOrbs ( double  a_X,
double  a_Y,
double  a_Z,
int  a_Reward 
)
inline

OBSOLETE, use the Vector3d-based overload instead.

Spawns experience orbs of the specified total value at the given location. The orbs' values are split according to regular Minecraft rules. Returns an vector of UniqueID of all the orbs.

Definition at line 511 of file World.h.

◆ SpawnSplitExperienceOrbs() [2/2]

std::vector< UInt32 > cWorld::SpawnSplitExperienceOrbs ( Vector3d  a_Pos,
int  a_Reward 
)
overridevirtual

Spawns experience orbs of the specified total value at the given location.

The orbs' values are split according to regular Minecraft rules. Returns an vector of UniqueID of all the orbs.

Implements cWorldInterface.

Definition at line 1915 of file World.cpp.

◆ Start()

void cWorld::Start ( void  )

Starts threads that belong to this world.

Definition at line 687 of file World.cpp.

◆ Stop()

void cWorld::Stop ( cDeadlockDetect a_DeadlockDetect)

Stops threads that belong to this world (part of deinit).

a_DeadlockDetect is used for tracking this world's age, detecting a possible deadlock.

Definition at line 956 of file World.cpp.

◆ TabCompleteUserName()

void cWorld::TabCompleteUserName ( const AString a_Text,
AStringVector a_Results 
)

Appends all usernames starting with a_Text (case-insensitive) into Results.

Definition at line 2987 of file World.cpp.

◆ Tick()

void cWorld::Tick ( std::chrono::milliseconds  a_Dt,
std::chrono::milliseconds  a_LastTickDurationMSec 
)
private

Definition at line 1002 of file World.cpp.

◆ TickClients()

void cWorld::TickClients ( std::chrono::milliseconds  a_Dt)
private

Ticks all clients that are in this world.

Definition at line 1076 of file World.cpp.

◆ TickMobs()

void cWorld::TickMobs ( std::chrono::milliseconds  a_Dt)
private

Handles the mob spawning / moving / destroying each tick.

Definition at line 1122 of file World.cpp.

◆ TickQueuedBlocks()

void cWorld::TickQueuedBlocks ( void  )

Processes the blocks queued for ticking with a delay (m_BlockTickQueue[])

Definition at line 2838 of file World.cpp.

◆ TickQueuedChunkDataSets()

void cWorld::TickQueuedChunkDataSets ( )
private

Sets the chunk data queued in the m_SetChunkDataQueue queue into their chunk.

Definition at line 1208 of file World.cpp.

◆ TickQueuedEntityAdditions()

void cWorld::TickQueuedEntityAdditions ( void  )
private

Adds the entities queued in the m_EntitiesToAdd queue into their chunk.

If the entity was a player, he is also added to the m_Players list.

Definition at line 1250 of file World.cpp.

◆ TickQueuedTasks()

void cWorld::TickQueuedTasks ( void  )
private

Executes all tasks queued onto the tick thread.

Definition at line 1289 of file World.cpp.

◆ TickWeather()

void cWorld::TickWeather ( float  a_Dt)
private

Handles the weather in each tick.

Definition at line 1088 of file World.cpp.

◆ TryGetHeight()

bool cWorld::TryGetHeight ( int  a_BlockX,
int  a_BlockZ,
int &  a_Height 
)

Retrieves the world height at the specified coords; returns false if chunk not loaded / generated.

Definition at line 2132 of file World.cpp.

◆ UnloadUnusedChunks()

void cWorld::UnloadUnusedChunks ( void  )
private

Unloads all chunks immediately.

Definition at line 2238 of file World.cpp.

◆ UpdateSkyDarkness()

void cWorld::UpdateSkyDarkness ( void  )
private

Definition at line 1326 of file World.cpp.

◆ UseBlockEntity()

void cWorld::UseBlockEntity ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ 
)
inline

a_Player is using block entity at [x, y, z], handle that:

Definition at line 619 of file World.h.

◆ VillagersShouldHarvestCrops()

bool cWorld::VillagersShouldHarvestCrops ( void  ) const
inline

Definition at line 131 of file World.h.

◆ WakeUpSimulators()

void cWorld::WakeUpSimulators ( Vector3i  a_Block)
overridevirtual

Wakes up the simulators for the specified block.

Implements cWorldInterface.

Definition at line 1357 of file World.cpp.

◆ WakeUpSimulatorsInArea()

void cWorld::WakeUpSimulatorsInArea ( const cCuboid a_Area)

Wakes up the simulators for the specified area of blocks.

Definition at line 1366 of file World.cpp.

◆ WriteBlockArea()

bool cWorld::WriteBlockArea ( cBlockArea a_Area,
int  a_MinBlockX,
int  a_MinBlockY,
int  a_MinBlockZ,
int  a_DataTypes 
)
overridevirtual

Writes the block area into the specified coords.

Returns true if all chunks have been processed. Prefer cBlockArea::Write() instead, this is the internal implementation; cBlockArea does error checking, too. a_DataTypes is a bitmask of cBlockArea::baXXX constants ORed together. Doesn't wake up simulators, use WakeUpSimulatorsInArea() for that.

Implements cForEachChunkProvider.

Definition at line 1797 of file World.cpp.

Member Data Documentation

◆ m_AllowedMobs

std::set<eMonsterType> cWorld::m_AllowedMobs
private

Definition at line 1030 of file World.h.

◆ m_bAnimals

bool cWorld::m_bAnimals
private

Definition at line 1029 of file World.h.

◆ m_bCommandBlocksEnabled

bool cWorld::m_bCommandBlocksEnabled
private

Whether command blocks are enabled or not.

Definition at line 1058 of file World.h.

◆ m_bEnabledPVP

bool cWorld::m_bEnabledPVP
private

Definition at line 1004 of file World.h.

◆ m_bFarmlandTramplingEnabled

bool cWorld::m_bFarmlandTramplingEnabled
private

Definition at line 1005 of file World.h.

◆ m_BlockTickQueue

std::vector<BlockTickQueueItem *> cWorld::m_BlockTickQueue
private

Definition at line 1010 of file World.h.

◆ m_BlockTickQueueCopy

std::vector<BlockTickQueueItem *> cWorld::m_BlockTickQueueCopy
private

Definition at line 1011 of file World.h.

◆ m_BroadcastAchievementMessages

bool cWorld::m_BroadcastAchievementMessages
private

Definition at line 978 of file World.h.

◆ m_BroadcastDeathMessages

bool cWorld::m_BroadcastDeathMessages
private

Definition at line 977 of file World.h.

◆ m_bUseChatPrefixes

bool cWorld::m_bUseChatPrefixes
private

Whether prefixes such as [INFO] are prepended to SendMessageXXX() / BroadcastChatXXX() functions.

Definition at line 1061 of file World.h.

◆ m_ChunkMap

cChunkMap cWorld::m_ChunkMap
private

Definition at line 1027 of file World.h.

◆ m_ChunkSender

cChunkSender cWorld::m_ChunkSender
private

Definition at line 1088 of file World.h.

◆ m_CSEntitiesToAdd

cCriticalSection cWorld::m_CSEntitiesToAdd
private

Guards m_EntitiesToAdd.

Definition at line 1099 of file World.h.

◆ m_CSSetChunkDataQueue

cCriticalSection cWorld::m_CSSetChunkDataQueue
private

CS protecting m_SetChunkDataQueue.

Definition at line 1105 of file World.h.

◆ m_CSTasks

cCriticalSection cWorld::m_CSTasks
private

Guards the m_Tasks.

Definition at line 1093 of file World.h.

◆ m_DataPath

AString cWorld::m_DataPath
private

The path to the root directory for the world files.

Does not including trailing path specifier.

Definition at line 947 of file World.h.

◆ m_Dimension

eDimension cWorld::m_Dimension
private

The dimension of the world, used by the client to provide correct lighting scheme.

Definition at line 964 of file World.h.

◆ m_EntitiesToAdd

std::vector<std::pair<OwnedEntity, cWorld *> > cWorld::m_EntitiesToAdd
private

List of entities that are scheduled for adding, waiting for the Tick thread to add them.

Definition at line 1102 of file World.h.

◆ m_FireSimulator

std::unique_ptr<cFireSimulator> cWorld::m_FireSimulator
private

Definition at line 1017 of file World.h.

◆ m_GameMode

eGameMode cWorld::m_GameMode
private

Definition at line 1003 of file World.h.

◆ m_Generator

cChunkGeneratorThread cWorld::m_Generator
private

The thread responsible for generating chunks.

Definition at line 1080 of file World.h.

◆ m_GeneratorCallbacks

cChunkGeneratorCallbacks cWorld::m_GeneratorCallbacks
private

The callbacks that the ChunkGenerator uses to store new chunks and interface to plugins.

Definition at line 1086 of file World.h.

◆ m_IniFileName

AString cWorld::m_IniFileName
private

Definition at line 953 of file World.h.

◆ m_IsDaylightCycleEnabled

bool cWorld::m_IsDaylightCycleEnabled
private

Definition at line 980 of file World.h.

◆ m_IsDeepSnowEnabled

bool cWorld::m_IsDeepSnowEnabled
private

Definition at line 1006 of file World.h.

◆ m_IsSavingEnabled

std::atomic<bool> cWorld::m_IsSavingEnabled
private

Whether or not writing chunks to disk is currently enabled.

Definition at line 961 of file World.h.

◆ m_IsSpawnExplicitlySet

bool cWorld::m_IsSpawnExplicitlySet
private

Definition at line 966 of file World.h.

◆ m_LastChunkCheck

std::chrono::milliseconds cWorld::m_LastChunkCheck
private

Definition at line 997 of file World.h.

◆ m_LastSave

std::chrono::milliseconds cWorld::m_LastSave
private

Definition at line 998 of file World.h.

◆ m_LastSpawnMonster

std::map<cMonster::eFamily, cTickTimeLong> cWorld::m_LastSpawnMonster
private

Definition at line 999 of file World.h.

◆ m_LavaSimulator

cFluidSimulator* cWorld::m_LavaSimulator
private

Definition at line 1016 of file World.h.

◆ m_Lighting

cLightingThread cWorld::m_Lighting
private

Definition at line 1089 of file World.h.

◆ m_LinkedEndWorldName

AString cWorld::m_LinkedEndWorldName
private

Name of the End world - where End portals should teleport.

Only used when this world is an Overworld.

Definition at line 1077 of file World.h.

◆ m_LinkedNetherWorldName

AString cWorld::m_LinkedNetherWorldName
private

Name of the nether world - where Nether portals should teleport.

Only used when this world is an Overworld.

Definition at line 1073 of file World.h.

◆ m_LinkedOverworldName

AString cWorld::m_LinkedOverworldName
private

The name of the overworld that portals in this world should link to.

Only has effect if this world is a Nether or End world.

Definition at line 951 of file World.h.

◆ m_MapManager

cMapManager cWorld::m_MapManager
private

Definition at line 1083 of file World.h.

◆ m_MaxCactusHeight

int cWorld::m_MaxCactusHeight
private

Definition at line 1038 of file World.h.

◆ m_MaxNetherPortalHeight

int cWorld::m_MaxNetherPortalHeight
private

Definition at line 975 of file World.h.

◆ m_MaxNetherPortalWidth

int cWorld::m_MaxNetherPortalWidth
private

Definition at line 973 of file World.h.

◆ m_MaxPlayers

unsigned int cWorld::m_MaxPlayers
private

Definition at line 1025 of file World.h.

◆ m_MaxRainTicks

int cWorld::m_MaxRainTicks
private

Definition at line 1035 of file World.h.

◆ m_MaxSugarcaneHeight

int cWorld::m_MaxSugarcaneHeight
private

Definition at line 1039 of file World.h.

◆ m_MaxSunnyTicks

int cWorld::m_MaxSunnyTicks
private

Definition at line 1034 of file World.h.

◆ m_MaxThunderStormTicks

int cWorld::m_MaxThunderStormTicks
private

Definition at line 1036 of file World.h.

◆ m_MaxViewDistance

int cWorld::m_MaxViewDistance
private

The maximum view distance that a player can have in this world.

Definition at line 1069 of file World.h.

◆ m_MinNetherPortalHeight

int cWorld::m_MinNetherPortalHeight
private

Definition at line 974 of file World.h.

◆ m_MinNetherPortalWidth

int cWorld::m_MinNetherPortalWidth
private

Definition at line 972 of file World.h.

◆ m_MinRainTicks

int cWorld::m_MinRainTicks
private

Definition at line 1035 of file World.h.

◆ m_MinSunnyTicks

int cWorld::m_MinSunnyTicks
private

Definition at line 1034 of file World.h.

◆ m_MinThunderStormTicks

int cWorld::m_MinThunderStormTicks
private

Definition at line 1036 of file World.h.

◆ m_Players

std::vector<cPlayer *> cWorld::m_Players
private

Definition at line 1021 of file World.h.

◆ m_RedstoneSimulator

cRedstoneSimulator* cWorld::m_RedstoneSimulator
private

Definition at line 1018 of file World.h.

◆ m_SandSimulator

std::unique_ptr<cSandSimulator> cWorld::m_SandSimulator
private

Definition at line 1014 of file World.h.

◆ m_Scoreboard

cScoreboard cWorld::m_Scoreboard
private

Definition at line 1082 of file World.h.

◆ m_SetChunkDataQueue

std::vector<SetChunkData> cWorld::m_SetChunkDataQueue
private

Queue for the chunk data to be set into m_ChunkMap by the tick thread.

Protected by m_CSSetChunkDataQueue

Definition at line 1108 of file World.h.

◆ m_ShouldLavaSpawnFire

bool cWorld::m_ShouldLavaSpawnFire
private

Definition at line 1007 of file World.h.

◆ m_SimulatorManager

std::unique_ptr<cSimulatorManager> cWorld::m_SimulatorManager
private

Definition at line 1013 of file World.h.

◆ m_SkyDarkness

NIBBLETYPE cWorld::m_SkyDarkness
private

Definition at line 1001 of file World.h.

◆ m_SpawnX

int cWorld::m_SpawnX
private

Definition at line 967 of file World.h.

◆ m_SpawnY

int cWorld::m_SpawnY
private

Definition at line 968 of file World.h.

◆ m_SpawnZ

int cWorld::m_SpawnZ
private

Definition at line 969 of file World.h.

◆ m_Storage

cWorldStorage cWorld::m_Storage
private

Definition at line 1023 of file World.h.

◆ m_StorageCompressionFactor

int cWorld::m_StorageCompressionFactor
private

Definition at line 958 of file World.h.

◆ m_StorageSchema

AString cWorld::m_StorageSchema
private

Name of the storage schema used to load and save chunks.

Definition at line 956 of file World.h.

◆ m_Tasks

std::vector<std::pair<std::chrono::milliseconds, std::function<void(cWorld &)> > > cWorld::m_Tasks
private

Tasks that have been queued onto the tick thread, possibly to be executed at target tick in the future; guarded by m_CSTasks.

Definition at line 1096 of file World.h.

◆ m_TickThread

cTickThread cWorld::m_TickThread
private

Definition at line 1090 of file World.h.

◆ m_TNTShrapnelLevel

eShrapnelLevel cWorld::m_TNTShrapnelLevel
private

The level of DoExplosionAt() projecting random affected blocks as FallingBlock entities See the eShrapnelLevel enumeration for details.

Definition at line 1066 of file World.h.

◆ m_UnusedDirtyChunksCap

size_t cWorld::m_UnusedDirtyChunksCap
private

The maximum number of allowed unused dirty chunks for this world.

Loaded from config, enforced every 10 seconds by freeing some unused dirty chunks if this was exceeded.

Definition at line 942 of file World.h.

◆ m_VillagersShouldHarvestCrops

bool cWorld::m_VillagersShouldHarvestCrops
private

Definition at line 1008 of file World.h.

◆ m_WaterSimulator

cFluidSimulator* cWorld::m_WaterSimulator
private

Definition at line 1015 of file World.h.

◆ m_Weather

eWeather cWorld::m_Weather
private

Definition at line 1032 of file World.h.

◆ m_WeatherInterval

int cWorld::m_WeatherInterval
private

Definition at line 1033 of file World.h.

◆ m_WorldAge

std::chrono::milliseconds cWorld::m_WorldAge
private

The age of the world.

Monotonic, always increasing each game tick, persistent across server restart. We need sub-tick precision here, that's why we store the time in milliseconds and calculate ticks off of it.

Definition at line 985 of file World.h.

◆ m_WorldDate

std::chrono::milliseconds cWorld::m_WorldDate
private

The fully controllable age of the world.

A value used to calculate the current day, and time of day. Settable by plugins and players, and persistent. We need sub-tick precision here, that's why we store the time in milliseconds and calculate ticks off of it.

Definition at line 990 of file World.h.

◆ m_WorldName

AString cWorld::m_WorldName
private

Definition at line 944 of file World.h.

◆ m_WorldTickAge

cTickTimeLong cWorld::m_WorldTickAge
private

The time since this world began, in ticks.

Monotonic, but does not persist across restarts. Used for less important but heavy tasks that run periodically. These tasks don't need to follow wallclock time, and slowing their rate down if TPS drops is desirable.

Definition at line 995 of file World.h.


The documentation for this class was generated from the following files: