Exemple #1
0
 public function onMove(PlayerMoveEvent $e)
 {
     $p = $e->getPlayer();
     if ($this->inArena($p) && $this->game === 0 && (floor($e->getFrom()->x) !== floor($e->getTo()->x) || floor($e->getFrom()->z) !== floor($e->getTo()->z))) {
         $e->setCancelled();
         return;
     }
     if ($this->game > 1) {
         $e->getHandlers()->unregister($this);
     }
 }