Code improvements

master
Howaner 2014-05-28 19:32:20 +02:00
parent 9f645b2c75
commit 142fa83124
3 changed files with 4 additions and 12 deletions

View File

@ -70,11 +70,8 @@ void cMobHeadEntity::SetOwner(const AString & a_Owner)
void cMobHeadEntity::SendTo(cClientHandle & a_Client)
{
BLOCKTYPE Block;
NIBBLETYPE Meta;
a_Client.GetPlayer()->GetWorld()->GetBlockTypeMeta(m_PosX, m_PosY, m_PosZ, Block, Meta);
a_Client.SendBlockChange(m_PosX, m_PosY, m_PosZ, Block, Meta);
cWorld * World = a_Client.GetPlayer()->GetWorld();
a_Client.SendBlockChange(m_PosX, m_PosY, m_PosZ, m_BlockType, World->GetBlockMeta(m_PosX, m_PosY, m_PosZ));
a_Client.SendUpdateBlockEntity(*this);
}

View File

@ -19,7 +19,7 @@ public:
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// The drops spawns in OnDestroyed
// The drop spawn is in OnDestroyed method
}
virtual void OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) override
@ -51,11 +51,7 @@ public:
a_MobHeadEntity->GetWorld()->SpawnItemPickups(Pickups, MicroX, MicroY, MicroZ);
return false;
}
public:
cCallback() {}
};
cCallback Callback;
} Callback;
cWorld * World = (cWorld *) &a_WorldInterface;
World->DoWithMobHeadAt(a_BlockX, a_BlockY, a_BlockZ, Callback);

View File

@ -609,7 +609,6 @@ void cNBTChunkSerializer::AddProjectileEntity(cProjectileEntity * a_Projectile)
{
m_Writer.AddInt("ExplosionPower", 1);
break;
// fall-through:
}
case cProjectileEntity::pkFireCharge:
case cProjectileEntity::pkWitherSkull: