mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
isBaby changed to IsBaby, methods for animals were added
This commit is contained in:
parent
327e74e7aa
commit
eb1f1e3d02
9 changed files with 88 additions and 79 deletions
|
|
@ -3,11 +3,20 @@
|
|||
class Cow extends Animal{
|
||||
const TYPE = MOB_COW;
|
||||
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('Cow');
|
||||
$this->size = $this->isBaby() ? 0.65 : 1.4;
|
||||
}
|
||||
|
||||
|
||||
public function getDrops(){
|
||||
return $this->isBaby() ? array() :
|
||||
array(
|
||||
array(LEATHER, 0, mt_rand(0,2)),
|
||||
array(($this->fire > 0 ? STEAK:BEEF), 0, 1),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue