/** * @priority HIGHEST */ public function onBlockPlace(BlockPlaceEvent $event) { if (!$event->isCancelled()) { $block = $event->getBlock(); if (isset($this->levelTickBlocks[$levelName = $block->getLevel()->getFolderName()]) && isset($this->randomTickBlocks[$levelName])) { if (in_array($block->getID(), $this->randomTickBlocks[$levelName]) && $block->getID() !== Block::GLASS && !isset($this->levelTickBlocks[$levelName][$posKey = $block->x . ":" . $block->y . ":" . $block->z])) { $this->levelTickBlocks[$levelName][$posKey] = new Position($block->x, $block->y, $block->z, $block->level); } } } }
public function onBlockPlace(BlockPlaceEvent $ev) { if ($ev->isCancelled()) { return; } $pl = $ev->getPlayer(); if ($this->checkBlockPlaceBreak($pl)) { return; } $this->owner->msg($pl, mc::_("You are not allowed to do that here")); $ev->setCancelled(); }
/** * @param BlockPlaceEvent $e */ public function BlockPlaceEvent(BlockPlaceEvent $e) { if (!$e->isCancelled()) { if ($this->getPlayer($e->getPlayer()) == null) { $this->AddPlayer($e->getPlayer()); } else { $this->db->query("UPDATE player_stats SET places = places +1 WHERE name = '" . strtolower($this->db->escape_string($e->getPlayer()->getDisplayName())) . "'"); } } }
public function onBlockPlaceEvent(BlockPlaceEvent $ev) { if ($ev->isCancelled()) { return; } $bl = $ev->getBlock(); if ($bl->getId() != Block::CHEST || $bl->getSide(Vector3::SIDE_DOWN)->getId() != $this->base_block) { return; } $ev->getPlayer()->sendMessage(mc::_("Placed a NetherChest")); }
public function onBlockPlace(BlockPlaceEvent $ev) { if ($ev->isCancelled()) { return; } if (isset($this->watchers[strtolower($ev->getPlayer()->getName())])) { $ev->setCancelled(); } }
public function onBlockPlace(BlockPlaceEvent $event) { if (!$event->isCancelled()) { $this->checkArea($event); } }
public function onBlockPlace(BlockPlaceEvent $event) { $player = $event->getPlayer(); $block = $event->getBlock(); if ($event->isCancelled()) { return; } if (isset($this->placeQueue[$player->getName()])) { $event->setCancelled(); unset($this->placeQueue[$player->getName()]); } }
public function onBlockPlace(BlockPlaceEvent $event) { if (!$event->isCancelled()) { $this->protectBlock($event); } }
public function onBlockPlaceEvent(BlockPlaceEvent $ev) { $bl = $ev->getBlock(); if ($bl->getId() == 39) { $event->setCancelled(true); } if ($bl->getId() == 32) { $event->setCancelled(true); } if ($ev->isCancelled()) { return; } if ($bl->getId() != Block::CHEST || $bl->getSide(Vector3::SIDE_DOWN)->getId() != Block::GLASS) { return; } $ev->getPlayer()->sendMessage("Placed Armour Crate..."); }