mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 04:29:43 +00:00
chicken should look on player correctly now
This commit is contained in:
parent
8c12e0de26
commit
a37ea6af3f
3 changed files with 3 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ class MobController
|
||||||
if($pitch){
|
if($pitch){
|
||||||
$diff = sqrt($x * $x + $z * $z);
|
$diff = sqrt($x * $x + $z * $z);
|
||||||
$calcPitch = rad2deg(atan($y / $diff));
|
$calcPitch = rad2deg(atan($y / $diff));
|
||||||
$this->entity->pitch = $calcPitch;
|
$this->entity->pitch = $this->entity->type === MOB_CHICKEN ? -$calcPitch : $calcPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->entity->server->query("UPDATE entities SET pitch = ".$this->entity->pitch.", yaw = ".$this->entity->yaw." WHERE EID = ".$this->entity->eid.";");
|
$this->entity->server->query("UPDATE entities SET pitch = ".$this->entity->pitch.", yaw = ".$this->entity->yaw." WHERE EID = ".$this->entity->eid.";");
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class TaskTempt extends TaskBase
|
||||||
|
|
||||||
public function onUpdate(EntityAI $ai)
|
public function onUpdate(EntityAI $ai)
|
||||||
{
|
{
|
||||||
if($this->target instanceof Entity && $this->target->distanceSquared($ai->entity) > 100 || !$ai->entity->isFood($this->target->player->getHeldItem()->getID())){
|
if($this->target instanceof Entity && $this->target->isPlayer() && $this->target->distanceSquared($ai->entity) > 100 || !$ai->entity->isFood($this->target->player->getHeldItem()->getID())){
|
||||||
$this->reset();
|
$this->reset();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ class Chicken extends Animal{
|
||||||
parent::__construct($level, $eid, $class, $type, $data);
|
parent::__construct($level, $eid, $class, $type, $data);
|
||||||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 4, "generic");
|
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 4, "generic");
|
||||||
$this->setName('Chicken');
|
$this->setName('Chicken');
|
||||||
$this->setSize($this->isBaby() ? 0.2 : 0.4, $this->isBaby() ? 0.35 : 0.7);
|
$this->setSize($this->isBaby() ? 0.2 : 0.3, $this->isBaby() ? 0.35 : 0.4);
|
||||||
$this->setSpeed(0.25);
|
$this->setSpeed(0.25);
|
||||||
$this->update();
|
$this->update();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue