====== cWorld ======
cWorld is the game world, at the moment there can only be one world. The world manages all [[api:centity | Entities]], [[api:cChunk | Chunks]], [[api:cPlayer | Players]] and the time.
===== Class definition =====
<code cpp>
class cWorld
{
	static float GetTime();
	long long GetWorldTime();
	void SetWorldTime(long long a_WorldTime);
	LuaTable GetAllPlayers();
	unsigned int GetNumPlayers();
	cPlayer* GetPlayer( const _cstring  a_PlayerName );
	void SetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockMeta );
	void FastSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_BlockMeta );
	char GetBlock( int a_X, int a_Y, int a_Z );
	char GetBlockMeta( int a_X, int a_Y, int a_Z );
	void SetBlockMeta( int a_X, int a_Y, int a_Z, char a_MetaData );
	bool DigBlock( int a_X, int a_Y, int a_Z, cItem & a_PickupItem );
	void SendBlockTo( int a_X, int a_Y, int a_Z, cPlayer* a_Player );
        void SpawnItemPickups( const cItems & a_Pickups, double a_X, double a_Y, double a_Z, double a_SpeedX, double a_SpeedY, double a_SpeedZ );
	const double & GetSpawnX();
	const double & GetSpawnY();
	const double & GetSpawnZ();
	cBlockEntity* GetBlockEntity( int a_X, int a_Y, int a_Z );
};
</code>
===== Functions =====

==== GetTime() ====
''GetTime()'' returns the time since the world was created in seconds (non minecraft-time).

==== GetWorldTime() ====
''GetWorldTime()'' returns the minecraft world time. This time ranges between 0 and 24000.

==== SetWorldTime() ====
Sets the time of the world. Use this to change day into night, or night into day or simply to freeze time.

==== GetAllPlayers() ====
''GetAllPlayers()'' returns a Lua table with all players. Example:
<code lua>
local World = cRoot:Get():GetWorld()
local PlayerList = World:GetAllPlayers()
for i, Player in ipairs( PlayerList ) do
	Log("Player " .. Player:GetName() .. " is in the server!")
end
</code>

==== GetNumPlayers() ====
''GetNumPlayers()'' simply returns how many players are in the server.

==== GetPlayer() ====
''GetPlayer()'' searches for a player with the name that matches the given string and returns a [[cplayer]]. When the exact name cannot be found it will try to autocomplete the name.
For example if the player ''l33th4x'' is in the server, ''GetPlayer()'' will return this player if the parameter is ''l33t'', as long as it does not match multiple players.

==== SetBlock() ====
''SetBlock()'' will set the block at the given coordinates to the given block type with given meta data

==== FastSetBlock() ====
''FastSetBlock()'' is the same as ''SetBlock()'' but faster, because it will not 'tick' the block and its neighbours
==== GetBlock() ====
''GetBlock()'' returns the BlockID of the block at the given coordinates.

==== GetBlockMeta() ====
''GetBlockMeta()'' returns the block meta of the block at the given coordinates.

==== SetBlockMeta() ====
''SetBlockMeta()'' sets the metadata of the block at the given coordinates.

==== DigBlock() ====
Call ''DigBlock()'' to dig a block at the given coordinates. This function will spawn a pickup of given item, if not empty. It always returns true.

==== SendBlockTo() ====
Calling this function will replicate the block at the given coordinates to the given player. 'a_Player' cannot be 'nil'.

==== GetSpawnX() GetSpawnY() GetSpawnZ() ====
''GetSpawnX()'', ''GetSpawnY()'' and ''GetSpawnZ()'' respectively return the x, y and z coordinates of the default spawn position.

==== GetBlockEntity() ====
''GetBlockEntity()'' returns the [[api:cBlockEntity | cBlockEntity]] at given coordinates, or ''nil''.

==== SpawnItemPickups() ====
''SpawnItemPickups()'' Spawns a pickup(s) at the given coordinates.
