4 bugs were fixed

This commit is contained in:
GameHerobrine 2022-11-13 18:52:48 +03:00
parent 107afb434b
commit 828599184c
5 changed files with 9 additions and 5 deletions

View file

@ -10,7 +10,6 @@ abstract class Animal extends Creature implements Ageable, Breedable{
public $age;
public function __construct(Level $level, $eid, $class, $type = 0, $data = []){
parent::__construct($level, $eid, $class, $type, $data);
$this->setAge(isset($data["Age"]) ? $data["Age"] : 0);
if(isset($this->data["IsBaby"]) && $this->data["IsBaby"] && $this->getAge() >= 0){
$this->setAge(-24000);

View file

@ -170,7 +170,6 @@ class Entity extends Position
break;
}
$this->boundingBox = new AxisAlignedBB($this->x - $this->radius, $this->y, $this->z - $this->radius, $this->x + $this->radius, $this->y + $this->height, $this->z + $this->radius);
$this->update();
$this->updateLast();
$this->updatePosition();
if($this->isInVoid()){

View file

@ -18,7 +18,7 @@ class Chicken extends Animal{
public function update(){
parent::update();
if($this->timeUntilEgg-- <= 0){
if($this->timeUntilEgg-- <= 0 && !$this->isBaby()){
$this->dropAnEgg();
$this->timeUntilEgg = mt_rand(0,6000) + 6000;
}

View file

@ -53,7 +53,7 @@ class Sheep extends Animal{
}
public function getDrops(){
return $this->isBaby() ? parent::getDrops() : [
return ($this->isBaby() || $this->isSheared()) ? parent::getDrops() : [
[WOOL, $this->getColor() & 0x0F, 1]
];
}