Cleaned up Entity->spawnTo()

This commit is contained in:
Dylan K. Taylor
2017-10-19 16:13:09 +01:00
parent 2b22d5d8cc
commit 9fb93985d6
11 changed files with 45 additions and 147 deletions

View File

@ -23,21 +23,7 @@ declare(strict_types=1);
namespace pocketmine\entity\projectile;
use pocketmine\network\mcpe\protocol\AddEntityPacket;
use pocketmine\Player;
class Snowball extends Throwable{
const NETWORK_ID = self::SNOWBALL;
public function spawnTo(Player $player){
$pk = new AddEntityPacket();
$pk->type = Snowball::NETWORK_ID;
$pk->entityRuntimeId = $this->getId();
$pk->position = $this->asVector3();
$pk->motion = $this->getMotion();
$pk->metadata = $this->dataProperties;
$player->dataPacket($pk);
parent::spawnTo($player);
}
}