isBaby changed to IsBaby, methods for animals were added

This commit is contained in:
GameHerobrine 2022-06-07 21:39:23 +03:00
parent 327e74e7aa
commit eb1f1e3d02
9 changed files with 88 additions and 79 deletions

View file

@ -2,11 +2,18 @@
class Pig extends Animal{
const TYPE = MOB_PIG;
function __construct(Level $level, $eid, $class, $type = 0, $data = array()){
console("A constructor which indicates it works! ".":".$eid.":".$class.":".$type);
parent::__construct($level, $eid, $class, $type, $data);
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"]:10, "generic");
$this->update();
//$this->setName('Pig');
$this->size = $this->isBaby() ? 0.60 : 1.1875;
}
public function getDrops(){
return $this->isBaby() ? array() :
array(
array(($this->fire > 0 ? COOKED_PORKCHOP:RAW_PORKCHOP), 0, 1),
);
}
}