Fixed /kick player name

This commit is contained in:
Shoghi Cervantes 2014-07-10 13:05:15 +02:00
parent 8fbc63c14e
commit d3789d4fed

View File

@ -67,8 +67,11 @@ abstract class Living extends Entity implements Damageable{
$motion = new Vector3(0, 0.25, 0);
if($source instanceof EntityDamageByEntityEvent){
$e = $source->getDamager();
$motion->x = -cos(deg2rad($e->pitch)) * sin(deg2rad($e->yaw)) * 0.5;
$motion->z = cos(deg2rad($e->pitch)) * sin(deg2rad($e->yaw)) * 0.5;
$deltaX = $this->x - $e->x;
$deltaZ = $this->z - $e->z;
$yaw = atan2($deltaX, $deltaZ);
$motion->x = sin($yaw) * 0.5;
$motion->z = cos($yaw) * 0.5;
}
$this->setMotion($motion);
$this->setHealth($this->getHealth() - $damage);