parent
2359611c57
commit
758622336e
@ -5,6 +5,7 @@
|
||||
#include "../Item.h"
|
||||
#include "../Entities/Player.h"
|
||||
#include "../UI/ChestWindow.h"
|
||||
#include "../ClientHandle.h"
|
||||
|
||||
|
||||
|
||||
@ -35,10 +36,8 @@ cChestEntity::~cChestEntity()
|
||||
|
||||
void cChestEntity::SendTo(cClientHandle & a_Client)
|
||||
{
|
||||
// The chest entity doesn't need anything sent to the client when it's created / gets in the viewdistance
|
||||
// All the actual handling is in the cWindow UI code that gets called when the chest is rclked
|
||||
|
||||
UNUSED(a_Client);
|
||||
// Send a dummy "number of players with chest open" packet to make the chest visible:
|
||||
a_Client.SendBlockAction(m_PosX, m_PosY, m_PosZ, 1, 0, m_BlockType);
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include "../Item.h"
|
||||
#include "../Entities/Player.h"
|
||||
#include "../UI/EnderChestWindow.h"
|
||||
#include "../ClientHandle.h"
|
||||
|
||||
|
||||
|
||||
@ -34,6 +35,16 @@ cEnderChestEntity::~cEnderChestEntity()
|
||||
|
||||
|
||||
|
||||
void cEnderChestEntity::SendTo(cClientHandle & a_Client)
|
||||
{
|
||||
// Send a dummy "number of players with chest open" packet to make the chest visible:
|
||||
a_Client.SendBlockAction(m_PosX, m_PosY, m_PosZ, 1, 0, m_BlockType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cEnderChestEntity::UsedBy(cPlayer * a_Player)
|
||||
{
|
||||
// TODO: cats are an obstruction
|
||||
|
@ -25,7 +25,7 @@ public:
|
||||
|
||||
// cBlockEntity overrides:
|
||||
virtual bool UsedBy(cPlayer * a_Player) override;
|
||||
virtual void SendTo(cClientHandle & a_Client) override { UNUSED(a_Client); }
|
||||
virtual void SendTo(cClientHandle & a_Client) override;
|
||||
|
||||
static void LoadFromJson(const Json::Value & a_Value, cItemGrid & a_Grid);
|
||||
static void SaveToJson(Json::Value & a_Value, const cItemGrid & a_Grid);
|
||||
|
Loading…
Reference in New Issue
Block a user