summaryrefslogtreecommitdiffstats
path: root/source/cPlugin.h
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-08 02:25:01 +0100
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-11-08 02:25:01 +0100
commit8285a11a26d78784f26b76e6bcdfa479f6c1a345 (patch)
tree6d567d22754b2d65258b1557e18ea8b590c2c709 /source/cPlugin.h
parentFixed bug in cChunk.cpp not calculating RedstoneCircuits at the correct positions. Also, forgot to mention you can now place colored wool. (diff)
downloadcuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar.gz
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar.bz2
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar.lz
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar.xz
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.tar.zst
cuberite-8285a11a26d78784f26b76e6bcdfa479f6c1a345.zip
Diffstat (limited to '')
-rw-r--r--source/cPlugin.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/cPlugin.h b/source/cPlugin.h
index 6c38871f3..a1e2a358f 100644
--- a/source/cPlugin.h
+++ b/source/cPlugin.h
@@ -41,7 +41,7 @@ public:
virtual bool OnDisconnect( std::string a_Reason, cPlayer* a_Player );
virtual bool OnBlockPlace( cPacket_BlockPlace* a_PacketData, cPlayer* a_Player );
virtual bool OnBlockDig( cPacket_BlockDig* a_PacketData, cPlayer* a_Player, cItem* a_PickupItem ) { (void)a_PacketData; (void)a_Player; (void)a_PickupItem; return false; }
- virtual bool OnChat( std::string a_Chat, cPlayer* a_Player );
+ virtual bool OnChat( const char* a_Chat, cPlayer* a_Player );
virtual bool OnLogin( cPacket_Login* a_PacketData );
virtual void OnPlayerSpawn( cPlayer* a_Player );
virtual bool OnPlayerJoin( cPlayer* a_Player );
@@ -50,8 +50,8 @@ public:
virtual bool OnKilled( cPawn* a_Killed, cEntity* a_Killer ) { (void)a_Killed; (void)a_Killer; return false; }
// Accessors
- std::string GetName() const { return m_Name; }
- void SetName( std::string a_Name ) { m_Name = a_Name; }
+ const char* GetName() const { return m_Name.c_str(); }
+ void SetName( const char* a_Name ) { m_Name = a_Name; }
int GetVersion() const { return m_Version; }
void SetVersion( int a_Version ) { m_Version = a_Version; }
@@ -69,7 +69,19 @@ public:
void BindCommand( FuncCommandHandler* a_Function, std::string & a_Command ); // >> EXPORTED IN MANUALBINDINGS <<
const std::vector< CommandStruct > & GetCommands() const { return m_Commands; } // >> EXPORTED IN MANUALBINDINGS <<
+
+ /* This should not be exposed to scripting languages */
+ enum PluginLanguage
+ {
+ E_CPP,
+ E_LUA,
+ E_SQUIRREL,
+ };
+ PluginLanguage GetLanguage() { return m_Language; }
+ void SetLanguage( PluginLanguage a_Language ) { m_Language = a_Language; }
+
private:
+ PluginLanguage m_Language;
std::vector< CommandStruct > m_Commands;
std::string m_Name;
int m_Version;