1
0
cuberite-2a/src/Blocks/WorldInterface.h

46 lines
1.9 KiB
C
Raw Normal View History

#pragma once
#include "BroadcastInterface.h"
#include "../Mobs/Monster.h"
class cItems;
class cWorldInterface
{
public:
virtual ~cWorldInterface() {}
virtual Int64 GetTimeOfDay(void) const = 0;
virtual Int64 GetWorldAge(void) const = 0;
virtual eDimension GetDimension(void) const = 0;
2014-02-01 13:06:32 +00:00
virtual cBroadcastInterface & GetBroadcastManager() = 0;
virtual void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void * a_SourceData) = 0;
/** Spawns item pickups for each item in the list. May compress pickups if too many entities: */
virtual void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0, bool IsPlayerCreated = false) = 0;
/** Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified: */
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 IsPlayerCreated = false) = 0;
/** Spawns a mob of the specified type. Returns the mob's EntityID if recognized and spawned, <0 otherwise */
virtual int SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eType a_MonsterType) = 0;
2014-03-06 12:35:53 +00:00
/** Sends the block on those coords to the player */
2014-03-05 18:33:43 +00:00
virtual void SendBlockTo(int a_BlockX, int a_BlockY, int a_BlockZ, cPlayer * a_Player) = 0;
/** Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true */
virtual bool ForEachPlayer(cItemCallback<cPlayer> & a_Callback) = 0;
virtual void SetTimeOfDay(Int64 a_TimeOfDay) = 0;
2014-06-05 16:58:29 +00:00
/** Returns true if the current weather has any precipitation - rain or storm
Does not check if biome has no downfall, use cChunk::GetBiomeAt(RelX, RelZ) for that
*/
2014-05-29 15:58:40 +00:00
virtual bool IsWeatherWet(void) const = 0;
};