Cuberite
A lightweight, fast and extensible game server for Minecraft
MobHeadEntity.h
Go to the documentation of this file.
1 // MobHeadEntity.h
2 
3 // Declares the cMobHeadEntity class representing a single skull / head in the world
4 
5 
6 
7 
8 
9 #pragma once
10 
11 #include "BlockEntity.h"
12 #include "../Defines.h"
13 #include "../UUID.h"
14 
15 
16 
17 
18 
19 // tolua_begin
20 
22  public cBlockEntity
23 {
24  // tolua_end
25 
27 
28 public: // tolua_export
29 
31  cMobHeadEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
32 
33  // tolua_begin
34 
36  void SetType(const eMobHeadType & a_SkullType);
37 
39  void SetRotation(eMobHeadRotation a_Rotation);
40 
42  void SetOwner(const cPlayer & a_Owner);
43 
45  eMobHeadType GetType(void) const { return m_Type; }
46 
48  eMobHeadRotation GetRotation(void) const { return m_Rotation; }
49 
51  AString GetOwnerName(void) const { return m_OwnerName; }
52 
54  AString GetOwnerTexture(void) const { return m_OwnerTexture; }
55 
58 
59  // tolua_end
60 
62  void SetOwner(
63  const cUUID & a_OwnerUUID, const AString & a_OwnerName,
64  const AString & a_OwnerTexture, const AString & a_OwnerTextureSignature
65  ); // Exported in ManualBindings.cpp
66 
68  cUUID GetOwnerUUID(void) const { return m_OwnerUUID; } // Exported in ManualBindings.cpp
69 
70 private:
71 
74 
79 
80  // cBlockEntity overrides:
81  virtual cItems ConvertToPickups() const override;
82  virtual void CopyFrom(const cBlockEntity & a_Src) override;
83  virtual void SendTo(cClientHandle & a_Client) override;
84  virtual bool UsedBy(cPlayer * a_Player) override;
85 } ; // tolua_export
cClientHandle
Definition: ClientHandle.h:49
cUUID
Definition: UUID.h:10
eMobHeadType
eMobHeadType
Definition: Defines.h:176
cMobHeadEntity::CopyFrom
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: MobHeadEntity.cpp:103
cMobHeadEntity::SendTo
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
Definition: MobHeadEntity.cpp:119
cMobHeadEntity::GetOwnerTextureSignature
AString GetOwnerTextureSignature(void) const
Returns the texture signature of the mob head.
Definition: MobHeadEntity.h:57
cBlockEntity::cBlockEntity
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Definition: BlockEntity.cpp:32
cMobHeadEntity::m_Rotation
eMobHeadRotation m_Rotation
Definition: MobHeadEntity.h:73
cMobHeadEntity::GetOwnerName
AString GetOwnerName(void) const
Returns the player name of the mob head.
Definition: MobHeadEntity.h:51
cMobHeadEntity::m_OwnerName
AString m_OwnerName
Definition: MobHeadEntity.h:75
cMobHeadEntity::GetOwnerUUID
cUUID GetOwnerUUID(void) const
Returns the player UUID of the mob head.
Definition: MobHeadEntity.h:68
cMobHeadEntity::m_OwnerTexture
AString m_OwnerTexture
Definition: MobHeadEntity.h:77
cMobHeadEntity::UsedBy
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
Definition: MobHeadEntity.cpp:130
cMobHeadEntity::m_OwnerUUID
cUUID m_OwnerUUID
Definition: MobHeadEntity.h:76
NIBBLETYPE
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
cMobHeadEntity::GetType
eMobHeadType GetType(void) const
Returns the type of the mob head.
Definition: MobHeadEntity.h:45
eMobHeadRotation
eMobHeadRotation
Definition: Defines.h:190
cMobHeadEntity
Definition: MobHeadEntity.h:21
cWorld
Definition: World.h:47
cMobHeadEntity::m_Type
eMobHeadType m_Type
Definition: MobHeadEntity.h:72
cMobHeadEntity::GetOwnerTexture
AString GetOwnerTexture(void) const
Returns the texture of the mob head.
Definition: MobHeadEntity.h:54
cMobHeadEntity::m_OwnerTextureSignature
AString m_OwnerTextureSignature
Definition: MobHeadEntity.h:78
cMobHeadEntity::cMobHeadEntity
cMobHeadEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Creates a new mob head entity at the specified block coords.
Definition: MobHeadEntity.cpp:16
cMobHeadEntity::ConvertToPickups
virtual cItems ConvertToPickups() const override
Returns the contents of this block entity that it would drop if broken.
Definition: MobHeadEntity.cpp:94
cItems
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:213
BlockEntity.h
BLOCKTYPE
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
cMobHeadEntity::SetType
void SetType(const eMobHeadType &a_SkullType)
Set the type of the mob head.
Definition: MobHeadEntity.cpp:28
cPlayer
Definition: Player.h:27
AString
std::string AString
Definition: StringUtils.h:11
Vector3< int >
cMobHeadEntity::SetRotation
void SetRotation(eMobHeadRotation a_Rotation)
Set the rotation of the mob head.
Definition: MobHeadEntity.cpp:42
cMobHeadEntity::SetOwner
void SetOwner(const cPlayer &a_Owner)
Set the player for mob heads with player type.
Definition: MobHeadEntity.cpp:51
cBlockEntity
Definition: BlockEntity.h:24
cMobHeadEntity::GetRotation
eMobHeadRotation GetRotation(void) const
Returns the rotation of the mob head.
Definition: MobHeadEntity.h:48