Mob heads, banners cannot be used
* Fixed UsedBy returning true, blocking block placement
This commit is contained in:
parent
5ca3a7c2e7
commit
edf9e39ed7
@ -33,6 +33,33 @@ cBannerEntity::cBannerEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vect
|
||||
|
||||
|
||||
|
||||
unsigned char cBannerEntity::GetBaseColor() const
|
||||
{
|
||||
return m_BaseColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cBannerEntity::SetBaseColor(const unsigned char a_Color)
|
||||
{
|
||||
m_BaseColor = a_Color;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
cItems cBannerEntity::ConvertToPickups() const
|
||||
{
|
||||
return cItem(E_ITEM_BANNER, 1, static_cast<NIBBLETYPE>(GetBaseColor()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cBannerEntity::CopyFrom(const cBlockEntity & a_Src)
|
||||
{
|
||||
Super::CopyFrom(a_Src);
|
||||
@ -54,25 +81,8 @@ void cBannerEntity::SendTo(cClientHandle & a_Client)
|
||||
|
||||
|
||||
|
||||
cItems cBannerEntity::ConvertToPickups() const
|
||||
bool cBannerEntity::UsedBy(cPlayer * a_Player)
|
||||
{
|
||||
return cItem(E_ITEM_BANNER, 1, static_cast<NIBBLETYPE>(GetBaseColor()));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
unsigned char cBannerEntity::GetBaseColor() const
|
||||
{
|
||||
return m_BaseColor;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cBannerEntity::SetBaseColor(const unsigned char a_Color)
|
||||
{
|
||||
m_BaseColor = a_Color;
|
||||
UNUSED(a_Player);
|
||||
return false;
|
||||
}
|
||||
|
@ -39,5 +39,5 @@ private:
|
||||
virtual cItems ConvertToPickups() const override;
|
||||
virtual void CopyFrom(const cBlockEntity & a_Src) override;
|
||||
virtual void SendTo(cClientHandle & a_Client) override;
|
||||
virtual bool UsedBy(cPlayer * a_Player) override { return true; }
|
||||
virtual bool UsedBy(cPlayer * a_Player) override;
|
||||
} ; // tolua_export
|
||||
|
@ -25,41 +25,6 @@ cMobHeadEntity::cMobHeadEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Ve
|
||||
|
||||
|
||||
|
||||
cItems cMobHeadEntity::ConvertToPickups() const
|
||||
{
|
||||
return cItem(E_ITEM_HEAD, 1, static_cast<short>(m_Type));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cMobHeadEntity::CopyFrom(const cBlockEntity & a_Src)
|
||||
{
|
||||
Super::CopyFrom(a_Src);
|
||||
auto & src = static_cast<const cMobHeadEntity &>(a_Src);
|
||||
m_OwnerName = src.m_OwnerName;
|
||||
m_OwnerTexture = src.m_OwnerTexture;
|
||||
m_OwnerTextureSignature = src.m_OwnerTextureSignature;
|
||||
m_OwnerUUID = src.m_OwnerUUID;
|
||||
m_Rotation = src.m_Rotation;
|
||||
m_Type = src.m_Type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool cMobHeadEntity::UsedBy(cPlayer * a_Player)
|
||||
{
|
||||
UNUSED(a_Player);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cMobHeadEntity::SetType(const eMobHeadType & a_Type)
|
||||
{
|
||||
if ((!m_OwnerName.empty()) && (a_Type != SKULL_TYPE_PLAYER))
|
||||
@ -131,6 +96,31 @@ void cMobHeadEntity::SetOwner(const cUUID & a_OwnerUUID, const AString & a_Owner
|
||||
|
||||
|
||||
|
||||
cItems cMobHeadEntity::ConvertToPickups() const
|
||||
{
|
||||
return cItem(E_ITEM_HEAD, 1, static_cast<short>(m_Type));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cMobHeadEntity::CopyFrom(const cBlockEntity & a_Src)
|
||||
{
|
||||
Super::CopyFrom(a_Src);
|
||||
auto & src = static_cast<const cMobHeadEntity &>(a_Src);
|
||||
m_OwnerName = src.m_OwnerName;
|
||||
m_OwnerTexture = src.m_OwnerTexture;
|
||||
m_OwnerTextureSignature = src.m_OwnerTextureSignature;
|
||||
m_OwnerUUID = src.m_OwnerUUID;
|
||||
m_Rotation = src.m_Rotation;
|
||||
m_Type = src.m_Type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cMobHeadEntity::SendTo(cClientHandle & a_Client)
|
||||
{
|
||||
cWorld * World = a_Client.GetPlayer()->GetWorld();
|
||||
@ -141,3 +131,9 @@ void cMobHeadEntity::SendTo(cClientHandle & a_Client)
|
||||
|
||||
|
||||
|
||||
|
||||
bool cMobHeadEntity::UsedBy(cPlayer * a_Player)
|
||||
{
|
||||
UNUSED(a_Player);
|
||||
return false;
|
||||
}
|
||||
|
@ -67,12 +67,6 @@ public: // tolua_export
|
||||
/** Returns the player UUID of the mob head */
|
||||
cUUID GetOwnerUUID(void) const { return m_OwnerUUID; } // Exported in ManualBindings.cpp
|
||||
|
||||
// cBlockEntity overrides:
|
||||
virtual cItems ConvertToPickups() const override;
|
||||
virtual void CopyFrom(const cBlockEntity & a_Src) override;
|
||||
virtual bool UsedBy(cPlayer * a_Player) override;
|
||||
virtual void SendTo(cClientHandle & a_Client) override;
|
||||
|
||||
private:
|
||||
|
||||
eMobHeadType m_Type;
|
||||
@ -82,4 +76,10 @@ private:
|
||||
cUUID m_OwnerUUID;
|
||||
AString m_OwnerTexture;
|
||||
AString m_OwnerTextureSignature;
|
||||
|
||||
// cBlockEntity overrides:
|
||||
virtual cItems ConvertToPickups() const override;
|
||||
virtual void CopyFrom(const cBlockEntity & a_Src) override;
|
||||
virtual void SendTo(cClientHandle & a_Client) override;
|
||||
virtual bool UsedBy(cPlayer * a_Player) override;
|
||||
} ; // tolua_export
|
||||
|
Loading…
Reference in New Issue
Block a user