示例#1
0
 /**
  * @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())) . "'");
         }
     }
 }
示例#4
0
 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"));
 }
示例#5
0
 public function onBlockPlace(BlockPlaceEvent $ev)
 {
     if ($ev->isCancelled()) {
         return;
     }
     if (isset($this->watchers[strtolower($ev->getPlayer()->getName())])) {
         $ev->setCancelled();
     }
 }
示例#6
0
 public function onBlockPlace(BlockPlaceEvent $event)
 {
     if (!$event->isCancelled()) {
         $this->checkArea($event);
     }
 }
示例#7
0
 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()]);
     }
 }
示例#8
0
 public function onBlockPlace(BlockPlaceEvent $event)
 {
     if (!$event->isCancelled()) {
         $this->protectBlock($event);
     }
 }
示例#9
-1
 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...");
 }