本文整理匯總了PHP中pocketmine\event\block\BlockUpdateEvent::setCancelled方法的典型用法代碼示例。如果您正苦於以下問題:PHP BlockUpdateEvent::setCancelled方法的具體用法?PHP BlockUpdateEvent::setCancelled怎麽用?PHP BlockUpdateEvent::setCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pocketmine\event\block\BlockUpdateEvent
的用法示例。
在下文中一共展示了BlockUpdateEvent::setCancelled方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: onBlockUpdate
public function onBlockUpdate(BlockUpdateEvent $event)
{
/*
* Disables water and lava flow as a temporary solution.
*/
$levelName = $event->getBlock()->getLevel()->getName();
if ($this->plugin->isLevelLoaded($levelName)) {
$event->setCancelled(true);
}
if ($event->getBlock() instanceof Water or $event->getBlock() instanceof Lava) {
$event->setCancelled(true);
}
}
示例2: onWaterFlow
public function onWaterFlow(BlockUpdateEvent $event)
{
if ($event->getBlock() instanceof Water) {
$event->setCancelled();
$this->dryArea();
}
}
示例3: onBlockUpdate
/**
* @param BlockUpdateEvent $event
*/
public function onBlockUpdate(BlockUpdateEvent $event)
{
if ($this->getPlugin()->isBlockSpecified($event->getBlock())) {
$event->setCancelled(true);
}
}
示例4: onBlockUpdate
public function onBlockUpdate(BlockUpdateEvent $event)
{
if ($this->isBlockLiquid($event->getBlock())) {
$event->setCancelled(true);
}
}
示例5: onBlockUpdate
/**
* @param BlockUpdateEvent $event
* @priority HIGHEST
* @ignoreCancelled true
*/
public function onBlockUpdate(BlockUpdateEvent $event)
{
if ($this->plugin->isFreezable($event->getBlock())) {
$event->setCancelled(true);
}
}
示例6: onBlockUpdate
public function onBlockUpdate(BlockUpdateEvent $event)
{
$b = $event->getBlock();
if (in_array($b->getID(), [8, 9, 10, 11])) {
$event->setCancelled();
}
}