Merge branch 'api3/network' into api3/network_mcpe-1.0.5

This commit is contained in:
Dylan K. Taylor
2017-03-18 16:30:06 +00:00
24 changed files with 560 additions and 132 deletions

View File

@ -1648,6 +1648,7 @@ abstract class Entity extends Location implements Metadatable{
}
$this->namedtag = null;
$this->lastDamageCause = null;
}
}

View File

@ -127,13 +127,15 @@ abstract class Living extends Entity implements Damageable{
$e = $source->getChild();
}
if($e->isOnFire() > 0){
$this->setOnFire(2 * $this->server->getDifficulty());
}
if($e !== null){
if($e->isOnFire() > 0){
$this->setOnFire(2 * $this->server->getDifficulty());
}
$deltaX = $this->x - $e->x;
$deltaZ = $this->z - $e->z;
$this->knockBack($e, $damage, $deltaX, $deltaZ, $source->getKnockBack());
$deltaX = $this->x - $e->x;
$deltaZ = $this->z - $e->z;
$this->knockBack($e, $damage, $deltaX, $deltaZ, $source->getKnockBack());
}
}
$pk = new EntityEventPacket();

View File

@ -60,7 +60,9 @@ class Squid extends WaterAnimal implements Ageable{
if($source instanceof EntityDamageByEntityEvent){
$this->swimSpeed = mt_rand(150, 350) / 2000;
$e = $source->getDamager();
$this->swimDirection = (new Vector3($this->x - $e->x, $this->y - $e->y, $this->z - $e->z))->normalize();
if($e !== null){
$this->swimDirection = (new Vector3($this->x - $e->x, $this->y - $e->y, $this->z - $e->z))->normalize();
}
$pk = new EntityEventPacket();
$pk->eid = $this->getId();