/** * @param PlayerMoveEvent $event */ public function onPlayerMove(PlayerMoveEvent $event) { if (!$event->isCancelled()) { if ($this->getPlugin()->isRocketPad($event->getPlayer()->getLevel()->getBlock($event->getPlayer()->subtract(0, 1, 0)))) { $this->getPlugin()->launchPlayer($event->getPlayer()); } } }
public function onMove(PlayerMoveEvent $ev) { if ($ev->isCancelled()) { return; } if ($this->checkMove($ev->getTo())) { $ev->setCancelled(); } return; }
/** * @priority HIGHEST */ public function onMove(PlayerMoveEvent $e) { if ($e->isCancelled()) { return; } $pl = $e->getPlayer(); if (!$this->owner->getState("Torch", $pl, null)) { return; } $this->spawnTorch($pl); }
public function onMove(PlayerMoveEvent $ev) { if ($ev->isCancelled()) { return; } $from = $ev->getFrom(); $to = $ev->getTo(); $dir = ["dx" => $to->getX() - $from->getX(), "dy" => $to->getY() - $from->getY(), "dz" => $to->getZ() - $from->getZ()]; if (!$dir["dy"]) { return; } $id = $to->getLevel()->getBlockIdAt($to->getX(), $to->getY() - 1, $to->getZ()); if (isset($this->blocks[$id])) { $ev->getPlayer()->setMotion(new Vector3($dir["dx"], -$dir["dy"] * 1.1, $dir["dz"])); } }
/** * Handle player move events. * @param PlayerMoveEvent $ev - Move event */ public function onMove(PlayerMoveEvent $ev) { //echo __METHOD__.",".__LINE__."\n";//##DEBUG if ($ev->isCancelled()) { return; } $p = $ev->getPlayer(); if (!$this->getState("fz", $p, false)) { return; } if ($this->hard) { $ev->setCancelled(); } else { // Lock position but still allow to turn around $to = clone $ev->getFrom(); $to->yaw = $ev->getTo()->yaw; $to->pitch = $ev->getTo()->pitch; $ev->setTo($to); } }
public function onPlayerMove(PlayerMoveEvent $ev) { if ($ev->isCancelled()) { return; } $pl = $ev->getPlayer(); $pos = $ev->getTo(); if ($this->checkMove($pl->getLevel()->getName(), $pos->getX(), $pos->getZ())) { return; } $this->owner->msg($pl, mc::_("You have reached the end of the world")); $ev->setCancelled(); }
public function onMove(PlayerMoveEvent $ev) { //echo __METHOD__.",".__LINE__."\n";//##DEBUG if ($ev->isCancelled()) { return; } $p = $ev->getPlayer(); if (isset($this->frosties[strtolower($p->getName())])) { if ($this->hard) { $ev->setCancelled(); if (MPMU::apiVersion("1.12.0")) { $p->sendTip(mc::_("You are frozen")); } } else { // Lock position but still allow to turn around $to = clone $ev->getFrom(); $to->yaw = $ev->getTo()->yaw; $to->pitch = $ev->getTo()->pitch; $ev->setTo($to); if (MPMU::apiVersion("1.12.0")) { $p->sendTip(mc::_("You are frozen in place")); } } } }
public function onMove(PlayerMoveEvent $ev) { if ($ev->isCancelled()) { return; } $pl = $ev->getPlayer(); $l = $pl->getLevel(); $world = $l->getName(); if (!isset($this->portals[$world])) { return; } $x = $ev->getTo()->getX(); $y = $ev->getTo()->getY(); $z = $ev->getTo()->getZ(); foreach ($this->portals[$world] as $p) { list($bb1, $bb2, $target) = $p; if ($bb1[0] <= $x && $bb1[1] <= $y && $bb1[2] <= $z && $x <= $bb1[3] && $y <= $bb1[4] && $z <= $bb1[5]) { $dest = $this->checkTarget($target); if (!$dest) { $pl->sendMessage(mc::_("Nothing happens!")); return; } $n = strtolower($pl->getName()); $now = time(); if (isset($this->tweak[$n])) { // Already in here... if ($this->tweak[$n][0] > $now) { return; } } $this->tweak[$n] = [$now + 3, $dest]; $this->getServer()->getScheduler()->scheduleDelayedTask(new PluginCallbackTask($this, [$this, "portalActiveSg1"], [$n]), 1); return; } } }