Extract mandatory parameters into constructor parameters

the goal is obviously to ditch NBT entirely here, but there's more work to be done before that becomes possible.
This commit is contained in:
Dylan K. Taylor
2020-06-19 02:49:24 +01:00
parent 3f135da704
commit 1205432c34
22 changed files with 192 additions and 180 deletions

View File

@ -23,20 +23,16 @@ declare(strict_types=1);
namespace pocketmine\item;
use pocketmine\entity\EntityFactory;
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->getWorldNonNull(),
EntityFactory::createBaseNBT($location, null, $location->yaw, $location->pitch),
$thrower
);
return new ExperienceBottleEntity($location, $thrower, new CompoundTag());
}
public function getThrowForce() : float{