08-31-2013, 03:50 AM
Code to make enderpearl work:
cThrownEnderPearlEntity::cThrownEnderPearlEntity(cEntity * a_Creator, double a_X, double a_Y, double a_Z, const Vector3d & a_Speed) :
super(pkEnderPearl, a_Creator, a_X, a_Y, a_Z, 0.25, 0.25)
{
m_Creator = a_Creator;
SetSpeed(a_Speed);
}
void cThrownEnderPearlEntity::OnHitSolidBlock(int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace)
{
m_Creator->TeleportToCoords(a_BlockX + 0.5, a_BlockY + 1, a_BlockZ + 0.5);
m_Creator->TakeDamage(dtSuffocating, NULL, 5, 0);
Destroy();
}

