From d62d0762ffa268904504b7b9d440e806c23f8230 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 19 Jun 2020 22:59:19 +0100 Subject: [PATCH] item: remove some unnecessary CompoundTag usages --- src/item/Egg.php | 3 +-- src/item/EnderPearl.php | 3 +-- src/item/ExperienceBottle.php | 3 +-- src/item/Snowball.php | 3 +-- src/item/SplashPotion.php | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/item/Egg.php b/src/item/Egg.php index a441f7291..afacbf567 100644 --- a/src/item/Egg.php +++ b/src/item/Egg.php @@ -26,7 +26,6 @@ namespace pocketmine\item; use pocketmine\entity\Location; use pocketmine\entity\projectile\Egg as EggEntity; use pocketmine\entity\projectile\Throwable; -use pocketmine\nbt\tag\CompoundTag; use pocketmine\player\Player; class Egg extends ProjectileItem{ @@ -36,7 +35,7 @@ class Egg extends ProjectileItem{ } protected function createEntity(Location $location, Player $thrower) : Throwable{ - return new EggEntity($location, $thrower, new CompoundTag()); + return new EggEntity($location, $thrower); } public function getThrowForce() : float{ diff --git a/src/item/EnderPearl.php b/src/item/EnderPearl.php index 502e52f35..1cd9d9d0f 100644 --- a/src/item/EnderPearl.php +++ b/src/item/EnderPearl.php @@ -26,7 +26,6 @@ namespace pocketmine\item; use pocketmine\entity\Location; use pocketmine\entity\projectile\EnderPearl as EnderPearlEntity; use pocketmine\entity\projectile\Throwable; -use pocketmine\nbt\tag\CompoundTag; use pocketmine\player\Player; class EnderPearl extends ProjectileItem{ @@ -36,7 +35,7 @@ class EnderPearl extends ProjectileItem{ } protected function createEntity(Location $location, Player $thrower) : Throwable{ - return new EnderPearlEntity($location, $thrower, new CompoundTag()); + return new EnderPearlEntity($location, $thrower); } public function getThrowForce() : float{ diff --git a/src/item/ExperienceBottle.php b/src/item/ExperienceBottle.php index d9de8628f..f76497151 100644 --- a/src/item/ExperienceBottle.php +++ b/src/item/ExperienceBottle.php @@ -26,13 +26,12 @@ namespace pocketmine\item; use pocketmine\entity\Location; use pocketmine\entity\projectile\ExperienceBottle as ExperienceBottleEntity; use pocketmine\entity\projectile\Throwable; -use pocketmine\nbt\tag\CompoundTag; use pocketmine\player\Player; class ExperienceBottle extends ProjectileItem{ protected function createEntity(Location $location, Player $thrower) : Throwable{ - return new ExperienceBottleEntity($location, $thrower, new CompoundTag()); + return new ExperienceBottleEntity($location, $thrower); } public function getThrowForce() : float{ diff --git a/src/item/Snowball.php b/src/item/Snowball.php index 36ab53984..a1cb0ced6 100644 --- a/src/item/Snowball.php +++ b/src/item/Snowball.php @@ -26,7 +26,6 @@ namespace pocketmine\item; use pocketmine\entity\Location; use pocketmine\entity\projectile\Snowball as SnowballEntity; use pocketmine\entity\projectile\Throwable; -use pocketmine\nbt\tag\CompoundTag; use pocketmine\player\Player; class Snowball extends ProjectileItem{ @@ -36,7 +35,7 @@ class Snowball extends ProjectileItem{ } protected function createEntity(Location $location, Player $thrower) : Throwable{ - return new SnowballEntity($location, $thrower, new CompoundTag()); + return new SnowballEntity($location, $thrower); } public function getThrowForce() : float{ diff --git a/src/item/SplashPotion.php b/src/item/SplashPotion.php index f9662755a..445590e28 100644 --- a/src/item/SplashPotion.php +++ b/src/item/SplashPotion.php @@ -26,7 +26,6 @@ namespace pocketmine\item; use pocketmine\entity\Location; use pocketmine\entity\projectile\SplashPotion as SplashPotionEntity; use pocketmine\entity\projectile\Throwable; -use pocketmine\nbt\tag\CompoundTag; use pocketmine\player\Player; class SplashPotion extends ProjectileItem{ @@ -36,7 +35,7 @@ class SplashPotion extends ProjectileItem{ } protected function createEntity(Location $location, Player $thrower) : Throwable{ - $projectile = new SplashPotionEntity($location, $thrower, new CompoundTag()); + $projectile = new SplashPotionEntity($location, $thrower); $projectile->setPotionId($this->meta); return $projectile; }