本文整理汇总了PHP中pocketmine\event\block\BlockPlaceEvent类的典型用法代码示例。如果您正苦于以下问题:PHP BlockPlaceEvent类的具体用法?PHP BlockPlaceEvent怎么用?PHP BlockPlaceEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BlockPlaceEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
$block = $event->getBlock()->getName();
if ($block == "Chest") {
$this->arenaManager->onChestPlaced($event);
}
}
示例2: onBlockPlace
/**
* @param BlockPlaceEvent $event
* @priority HIGHEST
* @ignoreCancelled true
*/
public function onBlockPlace(BlockPlaceEvent $event)
{
if (!$this->plugin->getStorage()->getShield($event->getPlayer()->getLevel())->isAllowed(Shield::PLACING)) {
$event->setCancelled(true);
$event->getPlayer()->sendTip($this->plugin->getConfig()->get("placeNotAllowed"));
}
}
示例3: onPlayerPlaceBlock
public function onPlayerPlaceBlock(BlockPlaceEvent $event)
{
if (!$event->getPlayer()->isOp()) {
$event->setCancelled(true);
$this->debug->onDebug('BlockPlaceEvent');
}
}
示例4: onPlace
public function onPlace(BlockPlaceEvent $event)
{
$username = $event->getPlayer()->getName();
if (isset($this->PlacePrevent[$username])) {
$event->setCancelled(true);
unset($this->PlacePrevent[$username]);
}
}
示例5: onPlace
public function onPlace(BlockPlaceEvent $event)
{
if ($event->getPlayer()->hasPermission("worldprotector.block.place")) {
$event->setCancelled(false);
} else {
$event->setCancelled(true);
}
}
示例6: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
if ($this->plugin->isJailed($event->getPlayer())) {
$event->getPlayer()->sendMessage("§eYou are not allowed to destroy the jail!\nAdded " . $this->getPlugin()->getConfig()->get("punish-additional-minutes") . " minutes as punishment.");
$this->getPlugin()->punish($event->getPlayer(), $this->getPlugin()->getConfig()->get("punish-additional-minutes"));
$event->setCancelled(true);
}
}
示例7: PlaceQueeue
public function PlaceQueeue(BlockPlaceEvent $event)
{
$block = $event->getBlock();
if ($block->getID() === Item::BED_BLOCK) {
$player = $event->getPlayer();
$this->placeQueeue[$player->getName()] = 1;
}
}
示例8: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
if (!$player->hasPermission("xperms.build")) {
$player->sendMessage(TextFormat::RED . $this->plugin->getConfiguration()->getMSGonIBuildPerm());
$event->setCancelled(true);
}
}
示例9: onPlace
public function onPlace(BlockPlaceEvent $event)
{
foreach ($this->tntRun->arenas as $arena) {
if ($arena->getPlayerManager()->isInArena($event->getPlayer())) {
$event->setCancelled();
return;
}
}
}
示例10: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
$block = $event->getBlock();
if ($player->hasPermission('log.placed.block')) {
$this->plugin->addPlacedBlock($block, $player);
// ADD TIME
}
}
示例11: onPlace
public function onPlace(BlockPlaceEvent $event)
{
if (!isset($this->wands[$event->getPlayer()->getName()])) {
$eventname = "Place";
$this->regi($event, $eventname);
} else {
$this->chk($event);
$event->setCancelled(true);
}
}
示例12: 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);
}
}
}
}
示例13: onBanblock
public function onBanblock(BlockPlaceEvent $event)
{
$blocklist = array("46", "327", "10", "11");
foreach ($blocklist as $Bancode) {
if ($event->getBlock()->getId() == $Bancode) {
$event->setCancelled(true);
$player = $event->getPlayer();
$player->sendMessage(TextFormat::RED . $player->getName() . "님이 금지된 아이템을 사용하였습니다");
}
}
}
示例14: onPlace
public function onPlace(BlockPlaceEvent $bpe)
{
$pl = $bpe->getPlayer();
$name = $pl->getName();
$bl = $bpe->getBlock();
$blname = $bl->getName();
$lvl = $pl->getLevel()->getName();
$x = $pl->getX();
$y = $pl->getY();
$z = $pl->getZ();
$this->getLogger()->info(C::YELLOW . "{$name}" . C::DARK_AQUA . " Placed/tried to Place (a)" . C::YELLOW . " {$blname}" . C::DARK_AQUA . " in World:" . C::YELLOW . " {$lvl}" . C::DARK_AQUA . " at Position:" . C::YELLOW . " {$x}, {$y}, {$z}");
}
示例15: onBlockPlace
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
$level = $player->getLevel();
$spawn = $level->getSpawnLocation();
$distance = $spawn->distance($player);
if ($distance <= $this->cfg->get($level->getName())) {
if (!$player->hasPermission("customradius.edit")) {
$event->setCancelled(true);
}
}
}