mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 00:39:45 +00:00
item: remove some unnecessary CompoundTag usages
This commit is contained in:
parent
4e8e10ca45
commit
d62d0762ff
@ -26,7 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\Location;
|
use pocketmine\entity\Location;
|
||||||
use pocketmine\entity\projectile\Egg as EggEntity;
|
use pocketmine\entity\projectile\Egg as EggEntity;
|
||||||
use pocketmine\entity\projectile\Throwable;
|
use pocketmine\entity\projectile\Throwable;
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class Egg extends ProjectileItem{
|
class Egg extends ProjectileItem{
|
||||||
@ -36,7 +35,7 @@ class Egg extends ProjectileItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||||
return new EggEntity($location, $thrower, new CompoundTag());
|
return new EggEntity($location, $thrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getThrowForce() : float{
|
public function getThrowForce() : float{
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\Location;
|
use pocketmine\entity\Location;
|
||||||
use pocketmine\entity\projectile\EnderPearl as EnderPearlEntity;
|
use pocketmine\entity\projectile\EnderPearl as EnderPearlEntity;
|
||||||
use pocketmine\entity\projectile\Throwable;
|
use pocketmine\entity\projectile\Throwable;
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class EnderPearl extends ProjectileItem{
|
class EnderPearl extends ProjectileItem{
|
||||||
@ -36,7 +35,7 @@ class EnderPearl extends ProjectileItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||||
return new EnderPearlEntity($location, $thrower, new CompoundTag());
|
return new EnderPearlEntity($location, $thrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getThrowForce() : float{
|
public function getThrowForce() : float{
|
||||||
|
@ -26,13 +26,12 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\Location;
|
use pocketmine\entity\Location;
|
||||||
use pocketmine\entity\projectile\ExperienceBottle as ExperienceBottleEntity;
|
use pocketmine\entity\projectile\ExperienceBottle as ExperienceBottleEntity;
|
||||||
use pocketmine\entity\projectile\Throwable;
|
use pocketmine\entity\projectile\Throwable;
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class ExperienceBottle extends ProjectileItem{
|
class ExperienceBottle extends ProjectileItem{
|
||||||
|
|
||||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||||
return new ExperienceBottleEntity($location, $thrower, new CompoundTag());
|
return new ExperienceBottleEntity($location, $thrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getThrowForce() : float{
|
public function getThrowForce() : float{
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\Location;
|
use pocketmine\entity\Location;
|
||||||
use pocketmine\entity\projectile\Snowball as SnowballEntity;
|
use pocketmine\entity\projectile\Snowball as SnowballEntity;
|
||||||
use pocketmine\entity\projectile\Throwable;
|
use pocketmine\entity\projectile\Throwable;
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class Snowball extends ProjectileItem{
|
class Snowball extends ProjectileItem{
|
||||||
@ -36,7 +35,7 @@ class Snowball extends ProjectileItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||||
return new SnowballEntity($location, $thrower, new CompoundTag());
|
return new SnowballEntity($location, $thrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getThrowForce() : float{
|
public function getThrowForce() : float{
|
||||||
|
@ -26,7 +26,6 @@ namespace pocketmine\item;
|
|||||||
use pocketmine\entity\Location;
|
use pocketmine\entity\Location;
|
||||||
use pocketmine\entity\projectile\SplashPotion as SplashPotionEntity;
|
use pocketmine\entity\projectile\SplashPotion as SplashPotionEntity;
|
||||||
use pocketmine\entity\projectile\Throwable;
|
use pocketmine\entity\projectile\Throwable;
|
||||||
use pocketmine\nbt\tag\CompoundTag;
|
|
||||||
use pocketmine\player\Player;
|
use pocketmine\player\Player;
|
||||||
|
|
||||||
class SplashPotion extends ProjectileItem{
|
class SplashPotion extends ProjectileItem{
|
||||||
@ -36,7 +35,7 @@ class SplashPotion extends ProjectileItem{
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
protected function createEntity(Location $location, Player $thrower) : Throwable{
|
||||||
$projectile = new SplashPotionEntity($location, $thrower, new CompoundTag());
|
$projectile = new SplashPotionEntity($location, $thrower);
|
||||||
$projectile->setPotionId($this->meta);
|
$projectile->setPotionId($this->meta);
|
||||||
return $projectile;
|
return $projectile;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user