Cuberite
A lightweight, fast and extensible game server for Minecraft
EnderChestEntity.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "BlockEntity.h"
5 #include "../UI/WindowOwner.h"
6 
7 
8 
9 
10 
11 // tolua_begin
13  public cBlockEntity,
15 {
16  // tolua_end
17 
19 
20 public: // tolua_export
21 
23 
24  cEnderChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World);
25  virtual ~cEnderChestEntity() override;
26 
27  // cBlockEntity overrides:
28  virtual bool UsedBy(cPlayer * a_Player) override;
29  virtual void SendTo(cClientHandle & a_Client) override;
30 
31  static void LoadFromJson(const Json::Value & a_Value, cItemGrid & a_Grid);
32  static void SaveToJson(Json::Value & a_Value, const cItemGrid & a_Grid);
33 
35  void OpenNewWindow(void);
36 } ; // tolua_export
37 
38 
39 
40 
static void LoadFromJson(const Json::Value &a_Value, cItemGrid &a_Grid)
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:42
Definition: Player.h:27
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:45
static void SaveToJson(Json::Value &a_Value, const cItemGrid &a_Grid)
Definition: Inventory.h:10
void OpenNewWindow(void)
Opens a new enderchest window for this enderchest.
Definition: World.h:65
Window owner that is associated with a block entity (chest, furnace, ...)
Definition: WindowOwner.h:57
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
#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