Remove useless EntityEventPacket

vanilla doesn't send this, and it doesn't do anything if we _do_ send it.
This commit is contained in:
Dylan K. Taylor 2017-09-26 12:50:36 +01:00
parent 13d50aff62
commit 18777a9041

View File

@ -26,8 +26,6 @@ namespace pocketmine\item;
use pocketmine\entity\Entity;
use pocketmine\entity\Human;
use pocketmine\event\entity\EntityEatItemEvent;
use pocketmine\network\mcpe\protocol\EntityEventPacket;
use pocketmine\Player;
abstract class Food extends Item implements FoodSource{
public function canBeConsumed() : bool{
@ -53,14 +51,6 @@ abstract class Food extends Item implements FoodSource{
}
public function onConsume(Entity $human){
$pk = new EntityEventPacket();
$pk->entityRuntimeId = $human->getId();
$pk->event = EntityEventPacket::USE_ITEM;
if($human instanceof Player){
$human->dataPacket($pk);
}
$human->getLevel()->getServer()->broadcastPacket($human->getViewers(), $pk);
$ev = new EntityEatItemEvent($human, $this);
$human->addSaturation($ev->getSaturationRestore());