Added invisibility potion, metadata sending for invisibility/nametags

This commit is contained in:
Shoghi Cervantes
2015-03-16 19:01:25 +01:00
parent 29ca349b3d
commit bc31df37d0
5 changed files with 33 additions and 1 deletions

View File

@ -189,11 +189,13 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
public function getData(){ //TODO
$flags = 0;
$flags |= $this->fireTicks > 0 ? 1 : 0;
$flags |= $this->hasEffect(Effect::INVISIBILITY) ? 1 << 5 : 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],
3 => ["type" => 0, "value" => $this->hasEffect(Effect::INVISIBILITY) ? 0 : 1],
16 => ["type" => 0, "value" => 0],
17 => ["type" => 6, "value" => [0, 0, 0]],
];