mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
more entity metadata
This commit is contained in:
parent
447638816e
commit
93765e8cc7
6 changed files with 67 additions and 7 deletions
|
|
@ -3,6 +3,16 @@
|
|||
class Wolf extends Animal implements Tameable
|
||||
{
|
||||
const TYPE = MOB_WOLF;
|
||||
|
||||
const WOLF_FLAGS = 14;
|
||||
|
||||
const WF_SITTING = 1;
|
||||
const WF_ANGRY = 2;
|
||||
const WF_INTERESTED = 3;
|
||||
|
||||
protected $interested = false;
|
||||
protected $angry = false;
|
||||
protected $sitting = false;
|
||||
public function __construct(Level $level, $eid, $class, $type = 0, $data = []){
|
||||
$this->setSize(0.6, 0.8);
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
|
|
@ -11,6 +21,15 @@ class Wolf extends Animal implements Tameable
|
|||
$this->setHealth(isset($this->data["Health"]) ? $this->data["Health"] : 10, "generic");
|
||||
}
|
||||
|
||||
public function getMetadata(){
|
||||
$ret = parent::getMetadata();
|
||||
$ret[self::WOLF_FLAGS] = ["type" => 0, "value" =>
|
||||
(($this->angry) << self::WF_ANGRY) ^
|
||||
(($this->interested) << self::WF_INTERESTED) ^
|
||||
(($this->sitting) << self::WF_SITTING)
|
||||
];//TODO toggles
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function isTamed()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue