本文整理汇总了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);
}
}
}
}
示例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();
}
示例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())) . "'");
}
}
}
示例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"));
}
示例5: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $ev)
{
if ($ev->isCancelled()) {
return;
}
if (isset($this->watchers[strtolower($ev->getPlayer()->getName())])) {
$ev->setCancelled();
}
}
示例6: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
if (!$event->isCancelled()) {
$this->checkArea($event);
}
}
示例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()]);
}
}
示例8: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
if (!$event->isCancelled()) {
$this->protectBlock($event);
}
}
示例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...");
}