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
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
eMobHeadRotation
Definition: Defines.h:191
eMobHeadType
Definition: Defines.h:177
std::string AString
Definition: StringUtils.h:11
cBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Definition: BlockEntity.cpp:32
AString m_OwnerTextureSignature
Definition: MobHeadEntity.h:78
void SetRotation(eMobHeadRotation a_Rotation)
Set the rotation of the mob head.
eMobHeadRotation m_Rotation
Definition: MobHeadEntity.h:73
cMobHeadEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
Creates a new mob head entity at the specified block coords.
eMobHeadRotation GetRotation(void) const
Returns the rotation of the mob head.
Definition: MobHeadEntity.h:48
virtual cItems ConvertToPickups() const override
Returns the contents of this block entity that it would drop if broken.
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 bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
AString GetOwnerTexture(void) const
Returns the texture of the mob head.
Definition: MobHeadEntity.h:54
void SetOwner(const cPlayer &a_Owner)
Set the player for mob heads with player type.
void SetType(const eMobHeadType &a_SkullType)
Set the type of the mob head.
AString m_OwnerTexture
Definition: MobHeadEntity.h:77
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
eMobHeadType m_Type
Definition: MobHeadEntity.h:72
AString m_OwnerName
Definition: MobHeadEntity.h:75
AString GetOwnerName(void) const
Returns the player name of the mob head.
Definition: MobHeadEntity.h:51
AString GetOwnerTextureSignature(void) const
Returns the texture signature of the mob head.
Definition: MobHeadEntity.h:57
eMobHeadType GetType(void) const
Returns the type of the mob head.
Definition: MobHeadEntity.h:45
cUUID GetOwnerUUID(void) const
Returns the player UUID of the mob head.
Definition: MobHeadEntity.h:68
Definition: Player.h:29
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215
Definition: UUID.h:11
Definition: World.h:53