public function onDespawn(EntityDespawnEvent $event) { //退出時などにChairをcloseするように $entity = $event->getEntity(); if ($entity instanceof Player) { $this->closeOldChair($entity); } }
public function onEntityDespawn(EntityDespawnEvent $event) { $Entity = $event->getEntity(); $Level = $Entity->getLevel(); if (!$this->plugin->game || $this->plugin->game->level_name != $Level->getFolderName()) { return; } if ($event->getType() === 81) { $ballid = $Entity->getId(); $shooter = $Entity->shootingEntity; $posTo = $Entity->getPosition(); if ($posTo->getY() < 10) { return; } if ($posTo instanceof Position) { if ($shooter instanceof Player) { $posFrom = $shooter->getPosition(); $this->plugin->setState("teleport", $shooter, false); $shooter->teleport($posTo); } } } }
public function onClose(EntityDespawnEvent $event) { if (isset($this->object_hash[spl_object_hash($event->getEntity())])) { unset($this->object_hash[spl_object_hash($event->getEntity())]); } }
public function SnowballExplode(EntityDespawnEvent $event) { if ($event->getType() == 81 and $this->checkEnableExplode()) { $this->SoldierGame($event->getEntity()); } }
public function EntityDespawnEvent(EntityDespawnEvent $ev) { $entity = $ev->getEntity(); if ($entity instanceof BaseEntity) { unset(self::$entities[$entity->getId()]); } }