2014-02-17 19:16:03 -05:00
|
|
|
|
|
|
|
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
|
|
|
|
|
|
|
|
#include "Painting.h"
|
|
|
|
#include "ClientHandle.h"
|
|
|
|
#include "Player.h"
|
2014-02-28 10:26:23 -05:00
|
|
|
#include "../Chunk.h"
|
2014-02-17 19:16:03 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-13 19:05:06 -04:00
|
|
|
cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, double a_X, double a_Y, double a_Z)
|
|
|
|
: cHangingEntity(etPainting, a_Direction, a_X, a_Y, a_Z),
|
|
|
|
m_Name(a_Name)
|
2014-02-17 19:16:03 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cPainting::SpawnOn(cClientHandle & a_Client)
|
|
|
|
{
|
2015-03-13 19:05:06 -04:00
|
|
|
super::SpawnOn(a_Client);
|
2014-02-17 19:16:03 -05:00
|
|
|
a_Client.SendPaintingSpawn(*this);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cPainting::GetDrops(cItems & a_Items, cEntity * a_Killer)
|
|
|
|
{
|
2015-05-24 07:56:56 -04:00
|
|
|
if ((a_Killer != nullptr) && a_Killer->IsPlayer() && !static_cast<cPlayer *>(a_Killer)->IsGameModeCreative())
|
2014-02-17 19:16:03 -05:00
|
|
|
{
|
|
|
|
a_Items.push_back(cItem(E_ITEM_PAINTING));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|