Cuberite
A lightweight, fast and extensible game server for Minecraft
ItemFrame.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "HangingEntity.h"
5 
6 
7 
8 
9 
10 // tolua_begin
11 class cItemFrame :
12  public cHangingEntity
13 {
14  // tolua_end
15 
17 
18 public: // tolua_export
19 
21 
22  cItemFrame(eBlockFace a_BlockFace, Vector3d a_Pos);
23 
24  // tolua_begin
25 
27  const cItem & GetItem(void) const { return m_Item; }
28 
30  void SetItem(cItem & a_Item) { m_Item = a_Item; }
31 
33  Byte GetItemRotation(void) const { return m_ItemRotation; }
34 
36  void SetItemRotation(Byte a_ItemRotation) { m_ItemRotation = a_ItemRotation; }
37 
38  // tolua_end
39 
40 private:
41 
42  virtual bool DoTakeDamage(TakeDamageInfo & a_TDI) override;
43  virtual void GetDrops(cItems & a_Items, cEntity * a_Killer) override;
44  virtual void OnRightClicked(cPlayer & a_Player) override;
45  virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
46 
49 
50 }; // tolua_export
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
Definition: Defines.h:38
#define CLASS_PROTODEF(classname)
Definition: Entity.h:13
unsigned char Byte
Definition: Globals.h:161
Definition: Entity.h:76
cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace, Vector3d a_Pos)
cItemFrame(eBlockFace a_BlockFace, Vector3d a_Pos)
Definition: ItemFrame.cpp:13
virtual void SpawnOn(cClientHandle &a_ClientHandle) override
Descendants override this function to send a command to the specified client to spawn the entity on t...
Definition: ItemFrame.cpp:105
void SetItem(cItem &a_Item)
Set the item in the frame.
Definition: ItemFrame.h:30
virtual void GetDrops(cItems &a_Items, cEntity *a_Killer) override
Returns the list of drops for this pawn when it is killed.
Definition: ItemFrame.cpp:58
Byte GetItemRotation(void) const
Returns the rotation from the item in the frame.
Definition: ItemFrame.h:33
virtual bool DoTakeDamage(TakeDamageInfo &a_TDI) override
Makes this entity take damage specified in the a_TDI.
Definition: ItemFrame.cpp:24
virtual void OnRightClicked(cPlayer &a_Player) override
Called when the specified player right-clicks this entity.
Definition: ItemFrame.cpp:72
void SetItemRotation(Byte a_ItemRotation)
Set the rotation from the item in the frame.
Definition: ItemFrame.h:36
Byte m_ItemRotation
Definition: ItemFrame.h:48
const cItem & GetItem(void) const
Returns the item in the frame.
Definition: ItemFrame.h:27
cItem m_Item
Definition: ItemFrame.h:47
Definition: Player.h:29
Definition: Item.h:37
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:215