Cuberite
A lightweight, fast and extensible game server for Minecraft
BedEntity.h
Go to the documentation of this file.
1 
2 // BedEntity.h
3 
4 #pragma once
5 
6 #include "BlockEntity.h"
7 
8 
9 
10 
11 
12 // tolua_begin
13 
14 class cBedEntity :
15  public cBlockEntity
16 {
17  // tolua_end
19 
20 public: // tolua_export
21 
23 
24  cBedEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World, short a_Color = E_META_WOOL_RED);
25 
26  // tolua_begin
27 
29  short GetColor(void) const { return m_Color; }
30 
32  void SetColor(short a_Color);
33 
35  bool IsPillowBlock(void) { return ((m_BlockMeta & 0x08) == 0x08); }
36 
37  // tolua_end
38 
39  // cBlockEntity overrides:
40  virtual void CopyFrom(const cBlockEntity & a_Src) override;
41  virtual bool UsedBy(cPlayer * a_Player) override { return false; }
42  virtual void SendTo(cClientHandle & a_Client) override;
43 
44 private:
45  short m_Color;
46 }; // tolua_export
short GetColor(void) const
Returns the color of the bed.
Definition: BedEntity.h:29
NIBBLETYPE m_BlockMeta
The block meta representing this particular instance in the world Mainly used for directional entitie...
Definition: BlockEntity.h:153
void SetColor(short a_Color)
Set the color of the bed.
Definition: BedEntity.cpp:47
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
Definition: BedEntity.cpp:38
Definition: Player.h:27
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
Definition: BedEntity.cpp:27
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
bool IsPillowBlock(void)
Returns true if this is the pillow block, it has then the meta 8.
Definition: BedEntity.h:35
Definition: World.h:65
#define BLOCKENTITY_PROTODEF(classname)
Place this macro in the declaration of each cBlockEntity descendant.
Definition: BlockEntity.h:9
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Definition: BlockEntity.h:43
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
Definition: BedEntity.h:41
short m_Color
Definition: BedEntity.h:45