New implementation of sending/setting/getting entity data, added effect saving

This commit is contained in:
Shoghi Cervantes
2015-03-17 00:01:54 +01:00
parent 85c5714cbf
commit 2ae80031f0
12 changed files with 285 additions and 200 deletions

View File

@ -68,21 +68,6 @@ class Villager extends Creature implements NPC, Ageable{
parent::spawnTo($player);
}
public function getData(){ //TODO
$flags = 0;
$flags |= $this->fireTicks > 0 ? 1 : 0;
//$flags |= ($this->crouched === true ? 0b10:0) << 1;
//$flags |= ($this->inAction === true ? 0b10000:0);
$d = [
0 => ["type" => 0, "value" => $flags],
1 => ["type" => 1, "value" => $this->airTicks],
16 => ["type" => 0, "value" => 0],
17 => ["type" => 6, "value" => [0, 0, 0]],
];
return $d;
}
/**
* Sets the villager profession
*