Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cPlugin Class Referenceabstract

#include <Plugin.h>

Inheritance diagram for cPlugin:
Inheritance graph
[legend]

Public Member Functions

 cPlugin (const AString &a_FolderName)
 Creates a new instance. More...
 
const AStringGetFolderName (void) const
 Returns the name of the folder (in the Plugins folder) from which the plugin is loaded. More...
 
const AStringGetLoadError (void) const
 Returns the error encountered while loading the plugin. More...
 
AString GetLocalFolder (void) const
 Returns the folder relative to the MCS Executable, from which the plugin is loaded. More...
 
const AStringGetName (void) const
 
cPluginManager::ePluginStatus GetStatus (void) const
 
int GetVersion (void) const
 
bool IsLoaded (void) const
 
virtual bool Load (void)=0
 Loads and initializes the plugin. More...
 
virtual bool OnBlockSpread (cWorld &a_World, int a_BlockX, int a_BlockY, int a_BlockZ, eSpreadSource a_Source)=0
 Calls the specified hook with the params given. More...
 
virtual bool OnBlockToPickups (cWorld &a_World, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, const cBlockEntity *a_BlockEntity, const cEntity *a_Digger, const cItem *a_Tool, cItems &a_Pickups)=0
 
virtual bool OnBrewingCompleted (cWorld &a_World, cBrewingstandEntity &a_BrewingstandEntity)=0
 
virtual bool OnBrewingCompleting (cWorld &a_World, cBrewingstandEntity &a_BrewingstandEntity)=0
 
virtual bool OnChat (cPlayer &a_Player, AString &a_Message)=0
 
virtual bool OnChunkAvailable (cWorld &a_World, int a_ChunkX, int a_ChunkZ)=0
 
virtual bool OnChunkGenerated (cWorld &a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc *a_ChunkDesc)=0
 
virtual bool OnChunkGenerating (cWorld &a_World, int a_ChunkX, int a_ChunkZ, cChunkDesc *a_ChunkDesc)=0
 
virtual bool OnChunkUnloaded (cWorld &a_World, int a_ChunkX, int a_ChunkZ)=0
 
virtual bool OnChunkUnloading (cWorld &a_World, int a_ChunkX, int a_ChunkZ)=0
 
virtual bool OnCollectingPickup (cPlayer &a_Player, cPickup &a_Pickup)=0
 
virtual bool OnCraftingNoRecipe (cPlayer &a_Player, cCraftingGrid &a_Grid, cCraftingRecipe &a_Recipe)=0
 
virtual void OnDisable (void)
 Called as the last call into the plugin before it is unloaded. More...
 
virtual bool OnDisconnect (cClientHandle &a_Client, const AString &a_Reason)=0
 
virtual bool OnDropSpense (cWorld &a_World, cDropSpenserEntity &a_DropSpenser, int a_SlotNum)=0
 
virtual bool OnEntityAddEffect (cEntity &a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier)=0
 
virtual bool OnEntityChangedWorld (cEntity &a_Entity, cWorld &a_World)=0
 
virtual bool OnEntityChangingWorld (cEntity &a_Entity, cWorld &a_World)=0
 
virtual bool OnEntityTeleport (cEntity &a_Entity, const Vector3d &a_OldPosition, const Vector3d &a_NewPosition)=0
 
virtual bool OnExecuteCommand (cPlayer *a_Player, const AStringVector &a_Split, const AString &a_EntireCommand, cPluginManager::CommandResult &a_Result)=0
 
virtual bool OnExploded (cWorld &a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void *a_SourceData)=0
 
virtual bool OnExploding (cWorld &a_World, double &a_ExplosionSize, bool &a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void *a_SourceData)=0
 
virtual bool OnHandshake (cClientHandle &a_Client, const AString &a_Username)=0
 
virtual bool OnHopperPullingItem (cWorld &a_World, cHopperEntity &a_Hopper, int a_DstSlotNum, cBlockEntityWithItems &a_SrcEntity, int a_SrcSlotNum)=0
 
virtual bool OnHopperPushingItem (cWorld &a_World, cHopperEntity &a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems &a_DstEntity, int a_DstSlotNum)=0
 
virtual bool OnKilled (cEntity &a_Victim, TakeDamageInfo &a_TDI, AString &a_DeathMessage)=0
 
virtual bool OnKilling (cEntity &a_Victim, cEntity *a_Killer, TakeDamageInfo &a_TDI)=0
 
virtual bool OnLogin (cClientHandle &a_Client, UInt32 a_ProtocolVersion, const AString &a_Username)=0
 
virtual bool OnLoginForge (cClientHandle &a_Client, const AStringMap &a_Mods)=0
 
virtual bool OnPlayerAnimation (cPlayer &a_Player, int a_Animation)=0
 
virtual bool OnPlayerBreakingBlock (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)=0
 
virtual bool OnPlayerBrokenBlock (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)=0
 
virtual bool OnPlayerCrouched (cPlayer &a_Player)=0
 
virtual bool OnPlayerDestroyed (cPlayer &a_Player)=0
 
virtual bool OnPlayerEating (cPlayer &a_Player)=0
 
virtual bool OnPlayerFished (cPlayer &a_Player, const cItems &a_Reward, const int ExperienceAmount)=0
 
virtual bool OnPlayerFishing (cPlayer &a_Player, cItems &a_Reward, int &ExperienceAmount)=0
 
virtual bool OnPlayerFoodLevelChange (cPlayer &a_Player, int a_NewFoodLevel)=0
 
virtual bool OnPlayerJoined (cPlayer &a_Player)=0
 
virtual bool OnPlayerLeftClick (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, char a_Status)=0
 
virtual bool OnPlayerMoving (cPlayer &a_Player, const Vector3d &a_OldPosition, const Vector3d &a_NewPosition, bool a_PreviousIsOnGround)=0
 
virtual bool OnPlayerOpeningWindow (cPlayer &a_Player, cWindow &a_Window)=0
 
virtual bool OnPlayerPlacedBlock (cPlayer &a_Player, const sSetBlock &a_BlockChange)=0
 
virtual bool OnPlayerPlacingBlock (cPlayer &a_Player, const sSetBlock &a_BlockChange)=0
 
virtual bool OnPlayerRightClick (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)=0
 
virtual bool OnPlayerRightClickingEntity (cPlayer &a_Player, cEntity &a_Entity)=0
 
virtual bool OnPlayerShooting (cPlayer &a_Player)=0
 
virtual bool OnPlayerSpawned (cPlayer &a_Player)=0
 
virtual bool OnPlayerTossingItem (cPlayer &a_Player)=0
 
virtual bool OnPlayerUsedBlock (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)=0
 
virtual bool OnPlayerUsedItem (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)=0
 
virtual bool OnPlayerUsingBlock (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)=0
 
virtual bool OnPlayerUsingItem (cPlayer &a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)=0
 
virtual bool OnPluginMessage (cClientHandle &a_Client, const AString &a_Channel, ContiguousByteBufferView a_Message)=0
 
virtual bool OnPluginsLoaded (void)=0
 
virtual bool OnPostCrafting (cPlayer &a_Player, cCraftingGrid &a_Grid, cCraftingRecipe &a_Recipe)=0
 
virtual bool OnPreCrafting (cPlayer &a_Player, cCraftingGrid &a_Grid, cCraftingRecipe &a_Recipe)=0
 
virtual bool OnProjectileHitBlock (cProjectileEntity &a_Projectile, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Face, const Vector3d &a_BlockHitPos)=0
 
virtual bool OnProjectileHitEntity (cProjectileEntity &a_Projectile, cEntity &a_HitEntity)=0
 
virtual bool OnServerPing (cClientHandle &a_ClientHandle, AString &a_ServerDescription, int &a_OnlinePlayersCount, int &a_MaxPlayersCount, AString &a_Favicon)=0
 
virtual bool OnSpawnedEntity (cWorld &a_World, cEntity &a_Entity)=0
 
virtual bool OnSpawnedMonster (cWorld &a_World, cMonster &a_Monster)=0
 
virtual bool OnSpawningEntity (cWorld &a_World, cEntity &a_Entity)=0
 
virtual bool OnSpawningMonster (cWorld &a_World, cMonster &a_Monster)=0
 
virtual bool OnTakeDamage (cEntity &a_Receiver, TakeDamageInfo &a_TakeDamageInfo)=0
 
virtual bool OnUpdatedSign (cWorld &a_World, int a_BlockX, int a_BlockY, int a_BlockZ, const AString &a_Line1, const AString &a_Line2, const AString &a_Line3, const AString &a_Line4, cPlayer *a_Player)=0
 
virtual bool OnUpdatingSign (cWorld &a_World, int a_BlockX, int a_BlockY, int a_BlockZ, AString &a_Line1, AString &a_Line2, AString &a_Line3, AString &a_Line4, cPlayer *a_Player)=0
 
virtual bool OnWeatherChanged (cWorld &a_World)=0
 
virtual bool OnWeatherChanging (cWorld &a_World, eWeather &a_NewWeather)=0
 
virtual bool OnWorldStarted (cWorld &a_World)=0
 
virtual bool OnWorldTick (cWorld &a_World, std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec)=0
 
void SetName (const AString &a_Name)
 
void SetVersion (int a_Version)
 
virtual void Tick (float a_Dt)=0
 
virtual void Unload (void)
 Unloads the plugin. More...
 
virtual ~cPlugin ()
 

Static Public Member Functions

static const char * GetClassStatic (void)
 

Protected Member Functions

void SetLoadError (const AString &a_LoadError)
 Sets m_LoadError to the specified string and m_Status to psError. More...
 

Protected Attributes

AString m_FolderName
 Name of the folder (in the Plugins folder) from which the plugin is loaded. More...
 
AString m_LoadError
 The error encountered while loading the plugin. More...
 
AString m_Name
 The name of the plugin, used to identify the plugin in the system and for inter-plugin calls. More...
 
cPluginManager::ePluginStatus m_Status
 
int m_Version
 

Friends

class cPluginManager
 

Detailed Description

Definition at line 19 of file Plugin.h.

Constructor & Destructor Documentation

◆ cPlugin()

cPlugin::cPlugin ( const AString a_FolderName)

Creates a new instance.

a_FolderName is the name of the folder (in the Plugins folder) from which the plugin is loaded. The plugin's name defaults to the folder name.

Definition at line 10 of file Plugin.cpp.

◆ ~cPlugin()

cPlugin::~cPlugin ( )
virtual

Definition at line 22 of file Plugin.cpp.

Member Function Documentation

◆ GetClassStatic()

static const char* cPlugin::GetClassStatic ( void  )
inlinestatic

Definition at line 139 of file Plugin.h.

◆ GetFolderName()

const AString& cPlugin::GetFolderName ( void  ) const
inline

Returns the name of the folder (in the Plugins folder) from which the plugin is loaded.

Definition at line 125 of file Plugin.h.

◆ GetLoadError()

const AString& cPlugin::GetLoadError ( void  ) const
inline

Returns the error encountered while loading the plugin.

Only valid if m_Status == psError.

Definition at line 131 of file Plugin.h.

◆ GetLocalFolder()

AString cPlugin::GetLocalFolder ( void  ) const

Returns the folder relative to the MCS Executable, from which the plugin is loaded.

Definition at line 46 of file Plugin.cpp.

◆ GetName()

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

Definition at line 118 of file Plugin.h.

◆ GetStatus()

cPluginManager::ePluginStatus cPlugin::GetStatus ( void  ) const
inline

Definition at line 133 of file Plugin.h.

◆ GetVersion()

int cPlugin::GetVersion ( void  ) const
inline

Definition at line 121 of file Plugin.h.

◆ IsLoaded()

bool cPlugin::IsLoaded ( void  ) const
inline

Definition at line 135 of file Plugin.h.

◆ Load()

virtual bool cPlugin::Load ( void  )
pure virtual

Loads and initializes the plugin.

Sets m_Status to psLoaded or psError accordingly. Returns true if the initialization succeeded, false otherwise.

Implemented in cPluginLua.

◆ OnBlockSpread()

virtual bool cPlugin::OnBlockSpread ( cWorld a_World,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eSpreadSource  a_Source 
)
pure virtual

Calls the specified hook with the params given.

Returns the bool that the hook callback returns.

Implemented in cPluginLua.

◆ OnBlockToPickups()

virtual bool cPlugin::OnBlockToPickups ( cWorld a_World,
Vector3i  a_BlockPos,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta,
const cBlockEntity a_BlockEntity,
const cEntity a_Digger,
const cItem a_Tool,
cItems a_Pickups 
)
pure virtual

Implemented in cPluginLua.

◆ OnBrewingCompleted()

virtual bool cPlugin::OnBrewingCompleted ( cWorld a_World,
cBrewingstandEntity a_BrewingstandEntity 
)
pure virtual

Implemented in cPluginLua.

◆ OnBrewingCompleting()

virtual bool cPlugin::OnBrewingCompleting ( cWorld a_World,
cBrewingstandEntity a_BrewingstandEntity 
)
pure virtual

Implemented in cPluginLua.

◆ OnChat()

virtual bool cPlugin::OnChat ( cPlayer a_Player,
AString a_Message 
)
pure virtual

Implemented in cPluginLua.

◆ OnChunkAvailable()

virtual bool cPlugin::OnChunkAvailable ( cWorld a_World,
int  a_ChunkX,
int  a_ChunkZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnChunkGenerated()

virtual bool cPlugin::OnChunkGenerated ( cWorld a_World,
int  a_ChunkX,
int  a_ChunkZ,
cChunkDesc a_ChunkDesc 
)
pure virtual

Implemented in cPluginLua.

◆ OnChunkGenerating()

virtual bool cPlugin::OnChunkGenerating ( cWorld a_World,
int  a_ChunkX,
int  a_ChunkZ,
cChunkDesc a_ChunkDesc 
)
pure virtual

Implemented in cPluginLua.

◆ OnChunkUnloaded()

virtual bool cPlugin::OnChunkUnloaded ( cWorld a_World,
int  a_ChunkX,
int  a_ChunkZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnChunkUnloading()

virtual bool cPlugin::OnChunkUnloading ( cWorld a_World,
int  a_ChunkX,
int  a_ChunkZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnCollectingPickup()

virtual bool cPlugin::OnCollectingPickup ( cPlayer a_Player,
cPickup a_Pickup 
)
pure virtual

Implemented in cPluginLua.

◆ OnCraftingNoRecipe()

virtual bool cPlugin::OnCraftingNoRecipe ( cPlayer a_Player,
cCraftingGrid a_Grid,
cCraftingRecipe a_Recipe 
)
pure virtual

Implemented in cPluginLua.

◆ OnDisable()

virtual void cPlugin::OnDisable ( void  )
inlinevirtual

Called as the last call into the plugin before it is unloaded.

Reimplemented in cPluginLua.

Definition at line 32 of file Plugin.h.

◆ OnDisconnect()

virtual bool cPlugin::OnDisconnect ( cClientHandle a_Client,
const AString a_Reason 
)
pure virtual

Implemented in cPluginLua.

◆ OnDropSpense()

virtual bool cPlugin::OnDropSpense ( cWorld a_World,
cDropSpenserEntity a_DropSpenser,
int  a_SlotNum 
)
pure virtual

Implemented in cPluginLua.

◆ OnEntityAddEffect()

virtual bool cPlugin::OnEntityAddEffect ( cEntity a_Entity,
int  a_EffectType,
int  a_EffectDurationTicks,
int  a_EffectIntensity,
double  a_DistanceModifier 
)
pure virtual

Implemented in cPluginLua.

◆ OnEntityChangedWorld()

virtual bool cPlugin::OnEntityChangedWorld ( cEntity a_Entity,
cWorld a_World 
)
pure virtual

Implemented in cPluginLua.

◆ OnEntityChangingWorld()

virtual bool cPlugin::OnEntityChangingWorld ( cEntity a_Entity,
cWorld a_World 
)
pure virtual

Implemented in cPluginLua.

◆ OnEntityTeleport()

virtual bool cPlugin::OnEntityTeleport ( cEntity a_Entity,
const Vector3d a_OldPosition,
const Vector3d a_NewPosition 
)
pure virtual

Implemented in cPluginLua.

◆ OnExecuteCommand()

virtual bool cPlugin::OnExecuteCommand ( cPlayer a_Player,
const AStringVector a_Split,
const AString a_EntireCommand,
cPluginManager::CommandResult a_Result 
)
pure virtual

Implemented in cPluginLua.

◆ OnExploded()

virtual bool cPlugin::OnExploded ( cWorld a_World,
double  a_ExplosionSize,
bool  a_CanCauseFire,
double  a_X,
double  a_Y,
double  a_Z,
eExplosionSource  a_Source,
void *  a_SourceData 
)
pure virtual

Implemented in cPluginLua.

◆ OnExploding()

virtual bool cPlugin::OnExploding ( cWorld a_World,
double &  a_ExplosionSize,
bool &  a_CanCauseFire,
double  a_X,
double  a_Y,
double  a_Z,
eExplosionSource  a_Source,
void *  a_SourceData 
)
pure virtual

Implemented in cPluginLua.

◆ OnHandshake()

virtual bool cPlugin::OnHandshake ( cClientHandle a_Client,
const AString a_Username 
)
pure virtual

Implemented in cPluginLua.

◆ OnHopperPullingItem()

virtual bool cPlugin::OnHopperPullingItem ( cWorld a_World,
cHopperEntity a_Hopper,
int  a_DstSlotNum,
cBlockEntityWithItems a_SrcEntity,
int  a_SrcSlotNum 
)
pure virtual

Implemented in cPluginLua.

◆ OnHopperPushingItem()

virtual bool cPlugin::OnHopperPushingItem ( cWorld a_World,
cHopperEntity a_Hopper,
int  a_SrcSlotNum,
cBlockEntityWithItems a_DstEntity,
int  a_DstSlotNum 
)
pure virtual

Implemented in cPluginLua.

◆ OnKilled()

virtual bool cPlugin::OnKilled ( cEntity a_Victim,
TakeDamageInfo a_TDI,
AString a_DeathMessage 
)
pure virtual

Implemented in cPluginLua.

◆ OnKilling()

virtual bool cPlugin::OnKilling ( cEntity a_Victim,
cEntity a_Killer,
TakeDamageInfo a_TDI 
)
pure virtual

Implemented in cPluginLua.

◆ OnLogin()

virtual bool cPlugin::OnLogin ( cClientHandle a_Client,
UInt32  a_ProtocolVersion,
const AString a_Username 
)
pure virtual

Implemented in cPluginLua.

◆ OnLoginForge()

virtual bool cPlugin::OnLoginForge ( cClientHandle a_Client,
const AStringMap a_Mods 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerAnimation()

virtual bool cPlugin::OnPlayerAnimation ( cPlayer a_Player,
int  a_Animation 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerBreakingBlock()

virtual bool cPlugin::OnPlayerBreakingBlock ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerBrokenBlock()

virtual bool cPlugin::OnPlayerBrokenBlock ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerCrouched()

virtual bool cPlugin::OnPlayerCrouched ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerDestroyed()

virtual bool cPlugin::OnPlayerDestroyed ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerEating()

virtual bool cPlugin::OnPlayerEating ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerFished()

virtual bool cPlugin::OnPlayerFished ( cPlayer a_Player,
const cItems a_Reward,
const int  ExperienceAmount 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerFishing()

virtual bool cPlugin::OnPlayerFishing ( cPlayer a_Player,
cItems a_Reward,
int &  ExperienceAmount 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerFoodLevelChange()

virtual bool cPlugin::OnPlayerFoodLevelChange ( cPlayer a_Player,
int  a_NewFoodLevel 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerJoined()

virtual bool cPlugin::OnPlayerJoined ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerLeftClick()

virtual bool cPlugin::OnPlayerLeftClick ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
char  a_Status 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerMoving()

virtual bool cPlugin::OnPlayerMoving ( cPlayer a_Player,
const Vector3d a_OldPosition,
const Vector3d a_NewPosition,
bool  a_PreviousIsOnGround 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerOpeningWindow()

virtual bool cPlugin::OnPlayerOpeningWindow ( cPlayer a_Player,
cWindow a_Window 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerPlacedBlock()

virtual bool cPlugin::OnPlayerPlacedBlock ( cPlayer a_Player,
const sSetBlock a_BlockChange 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerPlacingBlock()

virtual bool cPlugin::OnPlayerPlacingBlock ( cPlayer a_Player,
const sSetBlock a_BlockChange 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerRightClick()

virtual bool cPlugin::OnPlayerRightClick ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerRightClickingEntity()

virtual bool cPlugin::OnPlayerRightClickingEntity ( cPlayer a_Player,
cEntity a_Entity 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerShooting()

virtual bool cPlugin::OnPlayerShooting ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerSpawned()

virtual bool cPlugin::OnPlayerSpawned ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerTossingItem()

virtual bool cPlugin::OnPlayerTossingItem ( cPlayer a_Player)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerUsedBlock()

virtual bool cPlugin::OnPlayerUsedBlock ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerUsedItem()

virtual bool cPlugin::OnPlayerUsedItem ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerUsingBlock()

virtual bool cPlugin::OnPlayerUsingBlock ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ,
BLOCKTYPE  a_BlockType,
NIBBLETYPE  a_BlockMeta 
)
pure virtual

Implemented in cPluginLua.

◆ OnPlayerUsingItem()

virtual bool cPlugin::OnPlayerUsingItem ( cPlayer a_Player,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_BlockFace,
int  a_CursorX,
int  a_CursorY,
int  a_CursorZ 
)
pure virtual

Implemented in cPluginLua.

◆ OnPluginMessage()

virtual bool cPlugin::OnPluginMessage ( cClientHandle a_Client,
const AString a_Channel,
ContiguousByteBufferView  a_Message 
)
pure virtual

Implemented in cPluginLua.

◆ OnPluginsLoaded()

virtual bool cPlugin::OnPluginsLoaded ( void  )
pure virtual

Implemented in cPluginLua.

◆ OnPostCrafting()

virtual bool cPlugin::OnPostCrafting ( cPlayer a_Player,
cCraftingGrid a_Grid,
cCraftingRecipe a_Recipe 
)
pure virtual

Implemented in cPluginLua.

◆ OnPreCrafting()

virtual bool cPlugin::OnPreCrafting ( cPlayer a_Player,
cCraftingGrid a_Grid,
cCraftingRecipe a_Recipe 
)
pure virtual

Implemented in cPluginLua.

◆ OnProjectileHitBlock()

virtual bool cPlugin::OnProjectileHitBlock ( cProjectileEntity a_Projectile,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
eBlockFace  a_Face,
const Vector3d a_BlockHitPos 
)
pure virtual

Implemented in cPluginLua.

◆ OnProjectileHitEntity()

virtual bool cPlugin::OnProjectileHitEntity ( cProjectileEntity a_Projectile,
cEntity a_HitEntity 
)
pure virtual

Implemented in cPluginLua.

◆ OnServerPing()

virtual bool cPlugin::OnServerPing ( cClientHandle a_ClientHandle,
AString a_ServerDescription,
int &  a_OnlinePlayersCount,
int &  a_MaxPlayersCount,
AString a_Favicon 
)
pure virtual

Implemented in cPluginLua.

◆ OnSpawnedEntity()

virtual bool cPlugin::OnSpawnedEntity ( cWorld a_World,
cEntity a_Entity 
)
pure virtual

Implemented in cPluginLua.

◆ OnSpawnedMonster()

virtual bool cPlugin::OnSpawnedMonster ( cWorld a_World,
cMonster a_Monster 
)
pure virtual

Implemented in cPluginLua.

◆ OnSpawningEntity()

virtual bool cPlugin::OnSpawningEntity ( cWorld a_World,
cEntity a_Entity 
)
pure virtual

Implemented in cPluginLua.

◆ OnSpawningMonster()

virtual bool cPlugin::OnSpawningMonster ( cWorld a_World,
cMonster a_Monster 
)
pure virtual

Implemented in cPluginLua.

◆ OnTakeDamage()

virtual bool cPlugin::OnTakeDamage ( cEntity a_Receiver,
TakeDamageInfo a_TakeDamageInfo 
)
pure virtual

Implemented in cPluginLua.

◆ OnUpdatedSign()

virtual bool cPlugin::OnUpdatedSign ( cWorld a_World,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
const AString a_Line1,
const AString a_Line2,
const AString a_Line3,
const AString a_Line4,
cPlayer a_Player 
)
pure virtual

Implemented in cPluginLua.

◆ OnUpdatingSign()

virtual bool cPlugin::OnUpdatingSign ( cWorld a_World,
int  a_BlockX,
int  a_BlockY,
int  a_BlockZ,
AString a_Line1,
AString a_Line2,
AString a_Line3,
AString a_Line4,
cPlayer a_Player 
)
pure virtual

Implemented in cPluginLua.

◆ OnWeatherChanged()

virtual bool cPlugin::OnWeatherChanged ( cWorld a_World)
pure virtual

Implemented in cPluginLua.

◆ OnWeatherChanging()

virtual bool cPlugin::OnWeatherChanging ( cWorld a_World,
eWeather a_NewWeather 
)
pure virtual

Implemented in cPluginLua.

◆ OnWorldStarted()

virtual bool cPlugin::OnWorldStarted ( cWorld a_World)
pure virtual

Implemented in cPluginLua.

◆ OnWorldTick()

virtual bool cPlugin::OnWorldTick ( cWorld a_World,
std::chrono::milliseconds  a_Dt,
std::chrono::milliseconds  a_LastTickDurationMSec 
)
pure virtual

Implemented in cPluginLua.

◆ SetLoadError()

void cPlugin::SetLoadError ( const AString a_LoadError)
protected

Sets m_LoadError to the specified string and m_Status to psError.

Definition at line 55 of file Plugin.cpp.

◆ SetName()

void cPlugin::SetName ( const AString a_Name)
inline

Definition at line 119 of file Plugin.h.

◆ SetVersion()

void cPlugin::SetVersion ( int  a_Version)
inline

Definition at line 122 of file Plugin.h.

◆ Tick()

virtual void cPlugin::Tick ( float  a_Dt)
pure virtual

Implemented in cPluginLua.

◆ Unload()

void cPlugin::Unload ( void  )
virtual

Unloads the plugin.

Sets m_Status to psDisabled. The default implementation removes the plugin's associations with cPluginManager, descendants should call it as well.

Reimplemented in cPluginLua.

Definition at line 31 of file Plugin.cpp.

Friends And Related Function Documentation

◆ cPluginManager

friend class cPluginManager
friend

Definition at line 142 of file Plugin.h.

Member Data Documentation

◆ m_FolderName

AString cPlugin::m_FolderName
protected

Name of the folder (in the Plugins folder) from which the plugin is loaded.

Definition at line 152 of file Plugin.h.

◆ m_LoadError

AString cPlugin::m_LoadError
protected

The error encountered while loading the plugin.

Only valid if m_Status == psError.

Definition at line 156 of file Plugin.h.

◆ m_Name

AString cPlugin::m_Name
protected

The name of the plugin, used to identify the plugin in the system and for inter-plugin calls.

Definition at line 147 of file Plugin.h.

◆ m_Status

cPluginManager::ePluginStatus cPlugin::m_Status
protected

Definition at line 144 of file Plugin.h.

◆ m_Version

int cPlugin::m_Version
protected

Definition at line 149 of file Plugin.h.


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