Cuberite
A lightweight, fast and extensible game server for Minecraft
JukeboxEntity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "BlockEntity.h"
5 
6 
7 
8 
9 
10 // tolua_begin
11 
13  public cBlockEntity
14 {
15  // tolua_end
16 
18 
19 public: // tolua_export
20 
22 
23  cJukeboxEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
24  virtual ~cJukeboxEntity() override;
25 
26  // tolua_begin
27 
28  int GetRecord(void);
29  void SetRecord(int a_Record);
30 
33  bool PlayRecord(int a_Record);
34 
36  bool EjectRecord(void);
37 
39  bool IsPlayingRecord(void);
40 
41  static bool IsRecordItem(int a_Item)
42  {
43  return ((a_Item >= E_ITEM_FIRST_DISC) && (a_Item <= E_ITEM_LAST_DISC));
44  }
45 
46  // tolua_end
47 
48  // cBlockEntity overrides:
49  virtual void CopyFrom(const cBlockEntity & a_Src) override;
50  virtual bool UsedBy(cPlayer * a_Player) override;
51  virtual void SendTo(cClientHandle &) override {}
52 
53 private:
54  int m_Record;
55 } ; // tolua_end
56 
57 
58 
59 
bool IsPlayingRecord(void)
Is in the Jukebox a Record?
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
Definition: Player.h:27
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
bool PlayRecord(int a_Record)
Plays the specified Record.
int GetRecord(void)
Definition: World.h:65
void SetRecord(int a_Record)
virtual void CopyFrom(const cBlockEntity &a_Src) override
Copies all properties of a_Src into this entity, except for its m_World and location.
Maximum disc itemtype number used.
Definition: BlockID.h:521
static bool IsRecordItem(int a_Item)
Definition: JukeboxEntity.h:41
virtual void SendTo(cClientHandle &) override
Sends the packet defining the block entity to the client specified.
Definition: JukeboxEntity.h:51
#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.
bool EjectRecord(void)
Ejects the currently held record as a pickup.