Added cSignEntity into API, added cChunkDesc:GetBlockEntity().
This fixes both #228 and #347.
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
|
||||
// SignEntity.h
|
||||
|
||||
// Declares the cSignEntity class representing a single sign in the world
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "BlockEntity.h"
|
||||
@@ -13,28 +21,49 @@ namespace Json
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// tolua_begin
|
||||
|
||||
class cSignEntity :
|
||||
public cBlockEntity
|
||||
{
|
||||
typedef cBlockEntity super;
|
||||
|
||||
public:
|
||||
|
||||
/// Creates a new empty sign entity at the specified block coords and block type (wall or standing)
|
||||
/// Used mainly by plugins while generating chunks
|
||||
cSignEntity(BLOCKTYPE a_BlockType, int a_BlockX, int a_BlockY, int a_BlockZ);
|
||||
|
||||
// tolua_end
|
||||
|
||||
cSignEntity(BLOCKTYPE a_BlockType, int a_X, int a_Y, int a_Z, cWorld * a_World);
|
||||
virtual ~cSignEntity();
|
||||
|
||||
bool LoadFromJson( const Json::Value& a_Value );
|
||||
virtual void SaveToJson(Json::Value& a_Value ) override;
|
||||
|
||||
void SetLines( const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4 );
|
||||
void SetLine( int a_Index, const AString & a_Line );
|
||||
// tolua_begin
|
||||
|
||||
/// Sets all the sign's lines
|
||||
void SetLines(const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
|
||||
|
||||
/// Sets individual line (zero-based index)
|
||||
void SetLine(int a_Index, const AString & a_Line);
|
||||
|
||||
AString GetLine( int a_Index ) const;
|
||||
|
||||
virtual void UsedBy( cPlayer * a_Player ) override;
|
||||
/// Retrieves individual line (zero-based index)
|
||||
AString GetLine(int a_Index) const;
|
||||
|
||||
// tolua_end
|
||||
|
||||
virtual void UsedBy(cPlayer * a_Player) override;
|
||||
virtual void SendTo(cClientHandle & a_Client) override;
|
||||
|
||||
private:
|
||||
|
||||
AString m_Line[4];
|
||||
};
|
||||
} ; // tolua_export
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user