Living: remove sendPotionEffects() network crap

This commit is contained in:
Dylan K. Taylor 2019-06-26 19:17:38 +01:00
parent 9fe073fa73
commit 61d443bf4e
2 changed files with 3 additions and 12 deletions

View File

@ -346,17 +346,6 @@ abstract class Living extends Entity implements Damageable{
}
}
/**
* Sends the mob's potion effects to the specified player.
*
* @param Player $player
*/
public function sendPotionEffects(Player $player) : void{
foreach($this->effects as $effect){
$player->getNetworkSession()->onEntityEffectAdded($this, $effect, false);
}
}
protected function onEffectAdded(EffectInstance $effect, bool $replacesOldEffect) : void{
}

View File

@ -86,7 +86,9 @@ class PreSpawnPacketHandler extends PacketHandler{
$this->session->syncAttributes($this->player, true);
$this->session->syncAvailableCommands();
$this->session->syncAdventureSettings($this->player);
$this->player->sendPotionEffects($this->player);
foreach($this->player->getEffects() as $effect){
$this->session->onEntityEffectAdded($this->player, $effect, false);
}
$this->player->sendData($this->player);
$this->session->getInvManager()->syncAll();