mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
New implementation of sending/setting/getting entity data, added effect saving
This commit is contained in:
@ -40,6 +40,8 @@ abstract class Projectile extends Entity{
|
||||
private $hadCollision = false;
|
||||
|
||||
protected function initEntity(){
|
||||
parent::initEntity();
|
||||
|
||||
$this->setMaxHealth(1);
|
||||
$this->setHealth(1);
|
||||
if(isset($this->namedtag->Age)){
|
||||
@ -52,17 +54,6 @@ abstract class Projectile extends Entity{
|
||||
return $entity instanceof Living and !$this->onGround;
|
||||
}
|
||||
|
||||
public function getData(){
|
||||
$flags = 0;
|
||||
$flags |= $this->fireTicks > 0 ? 1 : 0;
|
||||
|
||||
return [
|
||||
0 => ["type" => 0, "value" => $flags],
|
||||
1 => ["type" => 1, "value" => $this->airTicks],
|
||||
16 => ["type" => 0, "value" => 0] //Is critical
|
||||
];
|
||||
}
|
||||
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
$this->namedtag->Age = new Short("Age", $this->age);
|
||||
|
Reference in New Issue
Block a user