Removed entity mask

This commit is contained in:
Shoghi Cervantes 2015-04-09 14:23:37 +02:00
parent 0117e8dfae
commit f2e2cec024
4 changed files with 3 additions and 26 deletions

View File

@ -196,35 +196,12 @@ abstract class Entity extends Location implements Metadatable{
/** @var \pocketmine\event\TimingsHandler */
protected $timings;
protected $MASK = 0;
public function __construct(FullChunk $chunk, Compound $nbt){
if($chunk === null or $chunk->getProvider() === null){
throw new ChunkException("Invalid garbage Chunk given to Entity");
}
$PF = 0x200;
if($this instanceof Living){
$this->MASK |= 0x100 | $PF;
}
if($this instanceof Ageable){
$this->MASK |= 0x400;
}
if($this instanceof Monster){
$this->MASK |= 0x800;
}
if($this instanceof Animal){
$this->MASK |= 0x1000;
}
if($this instanceof WaterAnimal){
$this->MASK |= 0x2000;
}
if($this instanceof Tameable){
$this->MASK |= 0x4000;
}
//AMBIENT = 0x100 | 0x8000;
$this->timings = Timings::getEntityTimings($this);
if($this->eyeHeight === null){

View File

@ -144,7 +144,7 @@ class Squid extends WaterAnimal implements Ageable{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Squid::NETWORK_ID | $this->MASK;
$pk->type = Squid::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -54,7 +54,7 @@ class Villager extends Creature implements NPC, Ageable{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Villager::NETWORK_ID | $this->MASK;
$pk->type = Villager::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;

View File

@ -41,7 +41,7 @@ class Zombie extends Monster{
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->eid = $this->getId();
$pk->type = Zombie::NETWORK_ID | $this->MASK;
$pk->type = Zombie::NETWORK_ID;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;