Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | List of all members
cWorldInterface Class Referenceabstract

#include <WorldInterface.h>

Inheritance diagram for cWorldInterface:
Inheritance graph
[legend]

Public Member Functions

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
 
virtual bool DoWithBlockEntityAt (Vector3i a_Position, cBlockEntityCallback a_Callback)=0
 Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, true if found. More...
 
virtual bool ForEachEntityInBox (const cBoundingBox &a_Box, cEntityCallback a_Callback)=0
 Calls the callback for each entity that has a nonempty intersection with the specified boundingbox. More...
 
virtual bool ForEachPlayer (cPlayerListCallback a_Callback)=0
 Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true. More...
 
virtual cBroadcastInterfaceGetBroadcastManager ()=0
 
virtual eDimension GetDimension (void) const =0
 
virtual int GetHeight (int a_BlockX, int a_BlockZ)=0
 Returns the world height at the specified coords; waits for the chunk to get loaded / generated. More...
 
virtual int GetMaxNetherPortalHeight (void) const =0
 
virtual int GetMaxNetherPortalWidth (void) const =0
 
virtual int GetMinNetherPortalHeight (void) const =0
 Returns or sets the minumim or maximum netherportal height. More...
 
virtual int GetMinNetherPortalWidth (void) const =0
 Returns or sets the minumim or maximum netherportal width. More...
 
virtual cTickTime GetTimeOfDay (void) const =0
 
virtual cTickTimeLong GetWorldAge (void) const =0
 
virtual bool IsWeatherWetAt (int a_BlockX, int a_BlockZ)=0
 Returns true if it is raining or storming at the specified location. More...
 
virtual bool IsWeatherWetAtXYZ (Vector3i a_Pos)=0
 Returns true if it is raining or storming at the specified location, and the rain reaches the specified block position. 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 SetMaxNetherPortalHeight (int a_NewMaxHeight)=0
 
virtual void SetMaxNetherPortalWidth (int a_NewMaxWidth)=0
 
virtual void SetMinNetherPortalHeight (int a_NewMinHeight)=0
 
virtual void SetMinNetherPortalWidth (int a_NewMinWidth)=0
 
virtual void SetTimeOfDay (cTickTime a_TimeOfDay)=0
 
virtual UInt32 SpawnExperienceOrb (double a_X, double a_Y, double a_Z, int a_Reward)=0
 Spawns an experience orb at the given location with the given reward. 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)=0
 
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. 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 IsPlayerCreated=false)=0
 Spawns item pickups for each item in the list. More...
 
virtual UInt32 SpawnMob (double a_PosX, double a_PosY, double a_PosZ, eMonsterType a_MonsterType, bool a_Baby)=0
 Spawns a mob of the specified type. More...
 
virtual std::vector< UInt32SpawnSplitExperienceOrbs (Vector3d a_Pos, int a_Reward)=0
 Spawns experience orbs of the specified total value at the given location. More...
 
virtual void WakeUpSimulators (Vector3i a_Block)=0
 Wakes up the simulators for the specified block. More...
 
virtual ~cWorldInterface ()
 

Detailed Description

Definition at line 19 of file WorldInterface.h.

Constructor & Destructor Documentation

◆ ~cWorldInterface()

virtual cWorldInterface::~cWorldInterface ( )
inlinevirtual

Definition at line 22 of file WorldInterface.h.

Member Function Documentation

◆ DoExplosionAt()

virtual void cWorldInterface::DoExplosionAt ( double  a_ExplosionSize,
double  a_BlockX,
double  a_BlockY,
double  a_BlockZ,
bool  a_CanCauseFire,
eExplosionSource  a_Source,
void *  a_SourceData 
)
pure virtual

Implemented in cWorld.

◆ DoWithBlockEntityAt()

virtual bool cWorldInterface::DoWithBlockEntityAt ( Vector3i  a_Position,
cBlockEntityCallback  a_Callback 
)
pure virtual

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

Implemented in cWorld.

◆ ForEachEntityInBox()

virtual bool cWorldInterface::ForEachEntityInBox ( const cBoundingBox a_Box,
cEntityCallback  a_Callback 
)
pure virtual

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.

Implemented in cWorld.

◆ ForEachPlayer()

virtual bool cWorldInterface::ForEachPlayer ( cPlayerListCallback  a_Callback)
pure virtual

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

Implemented in cWorld.

◆ GetBroadcastManager()

virtual cBroadcastInterface& cWorldInterface::GetBroadcastManager ( )
pure virtual

Implemented in cWorld.

◆ GetDimension()

virtual eDimension cWorldInterface::GetDimension ( void  ) const
pure virtual

Implemented in cWorld.

◆ GetHeight()

virtual int cWorldInterface::GetHeight ( int  a_BlockX,
int  a_BlockZ 
)
pure virtual

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

Implemented in cWorld.

◆ GetMaxNetherPortalHeight()

virtual int cWorldInterface::GetMaxNetherPortalHeight ( void  ) const
pure virtual

Implemented in cWorld.

◆ GetMaxNetherPortalWidth()

virtual int cWorldInterface::GetMaxNetherPortalWidth ( void  ) const
pure virtual

Implemented in cWorld.

◆ GetMinNetherPortalHeight()

virtual int cWorldInterface::GetMinNetherPortalHeight ( void  ) const
pure virtual

Returns or sets the minumim or maximum netherportal height.

Implemented in cWorld.

◆ GetMinNetherPortalWidth()

virtual int cWorldInterface::GetMinNetherPortalWidth ( void  ) const
pure virtual

Returns or sets the minumim or maximum netherportal width.

Implemented in cWorld.

◆ GetTimeOfDay()

virtual cTickTime cWorldInterface::GetTimeOfDay ( void  ) const
pure virtual

Implemented in cWorld.

◆ GetWorldAge()

virtual cTickTimeLong cWorldInterface::GetWorldAge ( void  ) const
pure virtual

Implemented in cWorld.

◆ IsWeatherWetAt()

virtual bool cWorldInterface::IsWeatherWetAt ( int  a_BlockX,
int  a_BlockZ 
)
pure virtual

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

This takes into account biomes.

Implemented in cWorld.

◆ IsWeatherWetAtXYZ()

virtual bool cWorldInterface::IsWeatherWetAtXYZ ( Vector3i  a_Pos)
pure virtual

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

Implemented in cWorld.

◆ SendBlockTo() [1/2]

void cWorldInterface::SendBlockTo ( const Vector3i  a_BlockPos,
const cPlayer a_Player 
)
inline

Sends the block on those coords to the player.

Definition at line 60 of file WorldInterface.h.

◆ SendBlockTo() [2/2]

virtual void cWorldInterface::SendBlockTo ( int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
const cPlayer a_Player 
)
pure virtual

Sends the block on those coords to the player.

Implemented in cWorld.

◆ SetMaxNetherPortalHeight()

virtual void cWorldInterface::SetMaxNetherPortalHeight ( int  a_NewMaxHeight)
pure virtual

Implemented in cWorld.

◆ SetMaxNetherPortalWidth()

virtual void cWorldInterface::SetMaxNetherPortalWidth ( int  a_NewMaxWidth)
pure virtual

Implemented in cWorld.

◆ SetMinNetherPortalHeight()

virtual void cWorldInterface::SetMinNetherPortalHeight ( int  a_NewMinHeight)
pure virtual

Implemented in cWorld.

◆ SetMinNetherPortalWidth()

virtual void cWorldInterface::SetMinNetherPortalWidth ( int  a_NewMinWidth)
pure virtual

Implemented in cWorld.

◆ SetTimeOfDay()

virtual void cWorldInterface::SetTimeOfDay ( cTickTime  a_TimeOfDay)
pure virtual

Implemented in cWorld.

◆ SpawnExperienceOrb()

virtual UInt32 cWorldInterface::SpawnExperienceOrb ( double  a_X,
double  a_Y,
double  a_Z,
int  a_Reward 
)
pure virtual

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.

Implemented in cWorld.

◆ SpawnItemPickup()

virtual UInt32 cWorldInterface::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 
)
pure virtual

Implemented in cWorld.

◆ SpawnItemPickups() [1/2]

virtual void cWorldInterface::SpawnItemPickups ( const cItems a_Pickups,
double  a_BlockX,
double  a_BlockY,
double  a_BlockZ,
double  a_FlyAwaySpeed = 1.0,
bool  IsPlayerCreated = false 
)
pure virtual

Spawns item pickups for each item in the list.

May compress pickups if too many entities:

Implemented in cWorld.

◆ SpawnItemPickups() [2/2]

virtual void cWorldInterface::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 
)
pure virtual

Spawns item pickups for each item in the list.

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

Implemented in cWorld.

◆ SpawnMob()

virtual UInt32 cWorldInterface::SpawnMob ( double  a_PosX,
double  a_PosY,
double  a_PosZ,
eMonsterType  a_MonsterType,
bool  a_Baby 
)
pure virtual

Spawns a mob of the specified type.

Returns the mob's UniqueID if recognized and spawned, or cEntity::INVALID_ID on failure.

Implemented in cWorld.

◆ SpawnSplitExperienceOrbs()

virtual std::vector<UInt32> cWorldInterface::SpawnSplitExperienceOrbs ( Vector3d  a_Pos,
int  a_Reward 
)
pure virtual

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.

Implemented in cWorld.

◆ WakeUpSimulators()

virtual void cWorldInterface::WakeUpSimulators ( Vector3i  a_Block)
pure virtual

Wakes up the simulators for the specified block.

Implemented in cWorld.


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