7 #include "../Entities/Player.h" 8 #include "../UI/EnderChestWindow.h" 9 #include "../ClientHandle.h" 10 #include "../Mobs/Ocelot.h" 17 super(a_BlockType, a_BlockMeta, a_Pos, a_World),
30 if (Window !=
nullptr)
65 if (Window ==
nullptr)
72 if (Window !=
nullptr)
98 for (
auto & Node : a_Value)
117 a_Value.append(Slot);
static void LoadFromJson(const Json::Value &a_Value, cItemGrid &a_Grid)
cWorld * GetWorld() const
unsigned char BLOCKTYPE
The datatype used by blockdata.
cWindow * GetWindow(void)
static bool IsCatSittingOnBlock(cWorld *a_World, Vector3d a_BlockPosition)
Returns true if there's a cat sitting above the given position.
virtual void SendTo(cClientHandle &a_Client) override
Sends the packet defining the block entity to the client specified.
void OpenWindow(cWindow *a_Window)
void OwnerDestroyed(void)
BLOCKTYPE m_BlockType
The blocktype representing this particular instance in the world.
cEnderChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld *a_World)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
static void SaveToJson(Json::Value &a_Value, const cItemGrid &a_Grid)
void SendBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType)
void OpenNewWindow(void)
Opens a new enderchest window for this enderchest.
virtual ~cEnderChestEntity() override
cWindow * GetWindow(void) const
Vector3< double > Vector3d
Vector3i m_Pos
Position in absolute block coordinates.
Window owner that is associated with a block entity (chest, furnace, ...)
static bool IsTransparent(BLOCKTYPE a_Type)
virtual bool UsedBy(cPlayer *a_Player) override
Called when a player uses this entity; should open the UI window.
static int GetBlock(lua_State *a_LuaState)
Templated bindings for the GetBlock___() functions.
void GetJson(Json::Value &a_OutValue) const
Saves the item data into JSON representation.
const cItem & GetSlot(int a_X, int a_Y) const
int GetNumSlots(void) const
void FromJson(const Json::Value &a_Value)
Loads the item data from JSON representation.
void OpenWindow(cWindow &a_Window)
Opens the specified window; closes the current one first using CloseWindow()
void SetSlot(int a_X, int a_Y, const cItem &a_Item)