Cuberite
A lightweight, fast and extensible game server for Minecraft
BannerEntity.h
Go to the documentation of this file.
1 
2 // BannerEntity.h
3 
4 // Declares the cBannerEntity class representing a single banner in the world
5 
6 
7 
8 
9 
10 #pragma once
11 
12 #include "BlockEntity.h"
13 
14 
15 
16 
17 
18 // tolua_begin
20  public cBlockEntity
21 {
22  // tolua_end
23 
25 
26 public:
27 
28  cBannerEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World, unsigned char a_BaseColor = 1, AString a_CustomName = "");
29 
30  unsigned char GetBaseColor() const { return m_BaseColor; }
31  void SetBaseColor(unsigned char a_Color) { m_BaseColor = a_Color; }
32 
33  const AString & GetCustomName() const { return m_CustomName; }
34  void SetCustomName(const AString & a_CustomName) { m_CustomName = a_CustomName; }
35 
36 private:
37 
38  unsigned char m_BaseColor;
39 
41 
42  // cBlockEntity overrides:
43  virtual cItems ConvertToPickups() const override;
44  virtual void CopyFrom(const cBlockEntity & a_Src) override;
45  virtual void SendTo(cClientHandle & a_Client) override;
46  virtual bool UsedBy(cPlayer * a_Player) override;
47 } ; // tolua_export
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
std::string AString
Definition: StringUtils.h:11
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
void SetBaseColor(unsigned char a_Color)
Definition: BannerEntity.h:31
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
AString m_CustomName
Definition: BannerEntity.h:40
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
unsigned char GetBaseColor() const
Definition: BannerEntity.h:30
cBannerEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World, unsigned char a_BaseColor=1, AString a_CustomName="")
virtual cItems ConvertToPickups() const override
Returns the contents of this block entity that it would drop if broken.
const AString & GetCustomName() const
Definition: BannerEntity.h:33
void SetCustomName(const AString &a_CustomName)
Definition: BannerEntity.h:34
unsigned char m_BaseColor
Definition: BannerEntity.h:38
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Definition: BlockEntity.cpp:32
Definition: Player.h:29
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215
Definition: World.h:53