7 #include "json/value.h"
9 #include "../ClientHandle.h"
16 Super(a_BlockType, a_BlockMeta, a_Pos, a_World)
29 auto & src =
static_cast<const cSignEntity &
>(a_Src);
61 if (a_Index >=
m_Line.size())
63 LOGWARNING(
"%s: setting a non-existent line %d (value \"%s\"", __FUNCTION__, a_Index, a_Line.c_str());
76 if (a_Index >=
m_Line.size())
78 LOGWARNING(
"%s: requesting a non-existent line %d", __FUNCTION__, a_Index);
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char BLOCKTYPE
The datatype used by blockdata.
void LOGWARNING(std::string_view a_Format, const Args &... args)
Vector3i m_Pos
Position in absolute block coordinates.
virtual void CopyFrom(const cBlockEntity &a_Src)
Copies all properties of a_Src into this entity, except for its m_World and location.
cSignEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Creates a new empty sign entity at the specified block coords and block type (wall or standing).
std::array< AString, 4 > m_Line
void SetLine(size_t a_Index, const AString &a_Line)
Sets individual line (zero-based index)
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
void SetLines(const AString &a_Line1, const AString &a_Line2, const AString &a_Line3, const AString &a_Line4)
Sets all the sign's lines.
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
AString GetLine(size_t a_Index) const
Retrieves individual line (zero-based index)
static bool IsValidHeight(Vector3i a_BlockPosition)
Validates a height-coordinate.
void SendUpdateSign(Vector3i a_BlockPos, const AString &a_Line1, const AString &a_Line2, const AString &a_Line3, const AString &a_Line4)