作者:TuffDe
项目:HungerGame
public function onBlockPlace(BlockPlaceEvent $event)
{
$block = $event->getBlock()->getName();
if ($block == "Chest") {
$this->arenaManager->onChestPlaced($event);
}
}
作者:NameNoOne10
项目:PocketMine-Plugin
/**
* @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"));
}
}
作者:100henrik10
项目:Minecraft-Pocket-Editio
public function onPlayerPlaceBlock(BlockPlaceEvent $event)
{
if (!$event->getPlayer()->isOp()) {
$event->setCancelled(true);
$this->debug->onDebug('BlockPlaceEvent');
}
}
作者:Gumbra
项目:Pocketmine-Plugin
public function onPlace(BlockPlaceEvent $event)
{
$username = $event->getPlayer()->getName();
if (isset($this->PlacePrevent[$username])) {
$event->setCancelled(true);
unset($this->PlacePrevent[$username]);
}
}
作者:Pocket-GA
项目:PocketMine-MP-Plugin
public function onPlace(BlockPlaceEvent $event)
{
if ($event->getPlayer()->hasPermission("worldprotector.block.place")) {
$event->setCancelled(false);
} else {
$event->setCancelled(true);
}
}
作者:HerO-011
项目:Jai
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);
}
}
作者:EmreTr
项目:rt
public function PlaceQueeue(BlockPlaceEvent $event)
{
$block = $event->getBlock();
if ($block->getID() === Item::BED_BLOCK) {
$player = $event->getPlayer();
$this->placeQueeue[$player->getName()] = 1;
}
}
作者:BoysElCrac
项目:xPermission
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
if (!$player->hasPermission("xperms.build")) {
$player->sendMessage(TextFormat::RED . $this->plugin->getConfiguration()->getMSGonIBuildPerm());
$event->setCancelled(true);
}
}
作者:EmreTr
项目:TNTRu
public function onPlace(BlockPlaceEvent $event)
{
foreach ($this->tntRun->arenas as $arena) {
if ($arena->getPlayerManager()->isInArena($event->getPlayer())) {
$event->setCancelled();
return;
}
}
}
作者:Artid
项目:SupremePlugin
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
$block = $event->getBlock();
if ($player->hasPermission('log.placed.block')) {
$this->plugin->addPlacedBlock($block, $player);
// ADD TIME
}
}
作者:PMMP-JP
项目:KillBearBoy
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);
}
}
作者:organizatio
项目:AutoGro
/**
* @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);
}
}
}
}
作者:sJimi
项目:PHPTES
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() . "님이 금지된 아이템을 사용하였습니다");
}
}
}
作者:StarCoder
项目:BI
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}");
}
作者:Skull3
项目:CustomRadiu
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);
}
}
}
作者:NawafCraf
项目:TNT1
public function place(BlockPlaceEvent $place)
{
$block = $place->getBlock();
$player = $place->getPlayer();
if ($block->getId() === 46) {
$place->setCancelled();
$mot = (new Random())->nextSignedFloat() * M_PI * 2;
$tnt = Entity::createEntity("PrimedTNT", $block->getLevel()->getChunk($block->x >> 4, $block->z >> 4), new Compound("", ["Pos" => new EnumTag("Pos", [new DoubleTag("", $block->x + 0.5), new DoubleTag("", $block->y), new DoubleTag("", $block->z + 0.5)]), "Motion" => new EnumTag("Motion", [new DoubleTag("", -sin($mot) * 0.02), new DoubleTag("", 0.2), new DoubleTag("", -cos($mot) * 0.02)]), "Rotation" => new EnumTag("Rotation", [new FloatTag("", 0), new FloatTag("", 0)]), "Fuse" => new ByteTag("Fuse", 100)]));
$tnt->spawnToAll();
$player->getLevel()->addSound(new AnviluseSound($player), array($player));
return true;
}
}
作者:nesgohoo
项目:PMMP-Plugin
public function onPlace(BlockPlaceEvent $event)
{
if ($event->getBlock()->getId() != Block::CHEST) {
return;
}
$block = $event->getBlock();
if ($this->sideCheck($block->x + 1, $block->y, $block->z, $block->getLevel(), $event->getPlayer()->getName()) == Block::CHEST or $this->sideCheck($block->x - 1, $block->y, $block->z, $block->getLevel(), $event->getPlayer()->getName()) == Block::CHEST or $this->sideCheck($block->x, $block->y, $block->z + 1, $block->getLevel(), $event->getPlayer()->getName()) == Block::CHEST or $this->sideCheck($block->x, $block->y, $block->z - 1, $block->getLevel(), $event->getPlayer()->getName()) == Block::CHEST) {
$event->getPlayer()->sendMessage(TextFormat::RED . "바로 옆에 다른사람의 상자가 있습니다, 설치 불가능 !");
return;
}
$this->configData["{$block->x}:{$block->y}:{$block->z}"] = $event->getPlayer()->getName();
}
作者:tnpxxsheepdo
项目:AntiBuil
public function playerBlockPlace(BlockPlaceEvent $event)
{
$id = $event->getBlock()->getID();
$player = $event->getPlayer();
if ($id == in_array($id, $this->config->get("banned-items"))) {
if ($player->isOp()) {
if (!$this->config->get("ops-can-use-items") == true) {
$player->sendMessage($this->config->get("msg-item-use"));
$event->setCancelled();
}
} else {
$player->sendMessage($this->config->get("msg-item-use"));
$event->setCancelled();
}
}
}
作者:Tee7eve
项目:iZon
/**
* @param BlockPlaceEvent $event
*
* @priority HIGH
* @ignoreCancelled true
*/
public function onBlockPlace(BlockPlaceEvent $event)
{
$player = $event->getPlayer();
if ($player->isOp()) {
return;
}
foreach ($this->plugin->getAllZones() as $zone) {
if ($zone->isIn($event->getBlock())) {
if ($player->hasPermission($zone->getName() . MEMBER)) {
break;
}
$event->setCancelled(true);
$player->sendMessage("[iZone] This is a private area.");
break;
}
}
}
作者:nao20010128na
项目:FiredNubesc
public function blockPlace(BlockPlaceEvent $event)
{
//2
$id = $event->getItem()->getId();
if ($id == $this->id) {
$player = $event->getPlayer();
$username = $player->getName();
if (empty($this->data[$user][2])) {
$x = $event->getBlock()->x;
$y = $event->getBlock()->y;
$z = $event->getBlock()->z;
$this->data[$user][2] = array($x, $y, $z);
$ms = "";
if (isset($this->data[$user][2])) {
//片方がセットされていたら
$ms = "[FiredNubesco] Second position has been set to: {$x}, {$y}, {$z}";
$size = $this->countBlocks($player);
if ($num != false) {
$ms .= " (Size: " . $size[0] . "X" . $size[1] . ")";
}
} else {
$ms = "[FiredNubesco] First position has been set to: {$x}, {$y}, {$z}";
}
$player->sendMessage($ms);
$event->setCancelled(true);
}
}
return true;
}