mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 08:56:15 +00:00
migrate to new CompoundTag API (#1515)
This commit is contained in:
@ -34,7 +34,6 @@ use pocketmine\level\Level;
|
||||
use pocketmine\level\MovingObjectPosition;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\ShortTag;
|
||||
|
||||
abstract class Projectile extends Entity{
|
||||
|
||||
@ -62,9 +61,7 @@ abstract class Projectile extends Entity{
|
||||
|
||||
$this->setMaxHealth(1);
|
||||
$this->setHealth(1);
|
||||
if(isset($this->namedtag->Age)){
|
||||
$this->age = $this->namedtag["Age"];
|
||||
}
|
||||
$this->age = $this->namedtag->getShort("Age", $this->age);
|
||||
}
|
||||
|
||||
public function canCollideWith(Entity $entity) : bool{
|
||||
@ -107,7 +104,7 @@ abstract class Projectile extends Entity{
|
||||
|
||||
public function saveNBT(){
|
||||
parent::saveNBT();
|
||||
$this->namedtag->Age = new ShortTag("Age", $this->age);
|
||||
$this->namedtag->setShort("Age", $this->age);
|
||||
}
|
||||
|
||||
protected function applyDragBeforeGravity() : bool{
|
||||
|
Reference in New Issue
Block a user