当前位置: 首页>>代码示例>>PHP>>正文


PHP BlockPlaceEvent::isCancelled方法代码示例

本文整理汇总了PHP中pocketmine\event\block\BlockPlaceEvent::isCancelled方法的典型用法代码示例。如果您正苦于以下问题:PHP BlockPlaceEvent::isCancelled方法的具体用法?PHP BlockPlaceEvent::isCancelled怎么用?PHP BlockPlaceEvent::isCancelled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pocketmine\event\block\BlockPlaceEvent的用法示例。


在下文中一共展示了BlockPlaceEvent::isCancelled方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onBlockPlace

 /**
  * @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);
             }
         }
     }
 }
开发者ID:organization,项目名称:AutoGrow,代码行数:14,代码来源:AutoGrow.php

示例2: onBlockPlace

 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();
 }
开发者ID:Gabriel865,项目名称:pocketmine-plugins,代码行数:12,代码来源:WpProtectMgr.php

示例3: BlockPlaceEvent

 /**
  * @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())) . "'");
         }
     }
 }
开发者ID:AndreyNazarchuk,项目名称:PlayerStats,代码行数:13,代码来源:PlayerStats.php

示例4: onBlockPlaceEvent

 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"));
 }
开发者ID:Gabriel865,项目名称:pocketmine-plugins,代码行数:11,代码来源:Main.php

示例5: onBlockPlace

 public function onBlockPlace(BlockPlaceEvent $ev)
 {
     if ($ev->isCancelled()) {
         return;
     }
     if (isset($this->watchers[strtolower($ev->getPlayer()->getName())])) {
         $ev->setCancelled();
     }
 }
开发者ID:DWWf,项目名称:pocketmine-plugins,代码行数:9,代码来源:CmdSpectator.php

示例6: onBlockPlace

 public function onBlockPlace(BlockPlaceEvent $event)
 {
     if (!$event->isCancelled()) {
         $this->checkArea($event);
     }
 }
开发者ID:Skull3x,项目名称:MineBlock,代码行数:6,代码来源:ProtectArea.php

示例7: onBlockPlace

 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()]);
     }
 }
开发者ID:nesgohood,项目名称:PMMP-Plugins,代码行数:12,代码来源:PSYCHOPASS_API.php

示例8: onBlockPlace

 public function onBlockPlace(BlockPlaceEvent $event)
 {
     if (!$event->isCancelled()) {
         $this->protectBlock($event);
     }
 }
开发者ID:Skull3x,项目名称:MineBlock,代码行数:6,代码来源:ProtectBlock.php

示例9: onBlockPlaceEvent

 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...");
 }
开发者ID:Blaneplooster2,项目名称:ArmorLootCrate,代码行数:17,代码来源:Main.php


注:本文中的pocketmine\event\block\BlockPlaceEvent::isCancelled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。