作者:nesgohoo
项目:PMMP-Plugin
public function onBreak(BlockBreakEvent $event)
{
if ($event->getBlock()->getId() != Block::CHEST) {
return;
}
$block = $event->getBlock();
if (!isset($this->configData["{$block->x}:{$block->y}:{$block->z}"])) {
return;
}
if ($this->configData["{$block->x}:{$block->y}:{$block->z}"] == $event->getPlayer()->getName()) {
unset($this->configData["{$block->x}:{$block->y}:{$block->z}"]);
$event->getPlayer()->sendMessage(TextFormat::DARK_AQUA . "상자 보호가 해제되었습니다 !");
$event->setCancelled();
} else {
if ($event->getPlayer()->isOp()) {
return;
}
if ($this->simpleArea != null) {
$area = $this->simpleArea->db[$block->getLevel()->getFolderName()]->getArea($block->x, $block->z);
if ($area != null) {
if (isset($area["resident"][0]) and $area["resident"][0] == $event->getPlayer()->getName()) {
return;
}
}
}
$event->getPlayer()->sendMessage(TextFormat::RED . "이 상자는 " . $this->configData["{$block->x}:{$block->y}:{$block->z}"] . " 님의 소유입니다, 파괴 불가 !");
$event->setCancelled();
}
}
作者:DWW
项目:pocketmine-plugin
public function onBlockBreak(BlockBreakEvent $ev)
{
if ($ev->isCancelled()) {
return;
}
$pl = $ev->getPlayer();
if (!$this->getState($pl, false)) {
return;
}
if (!$pl->isCreative() || !$this->creative) {
if ($this->items && !isset($this->items[$ev->getItem()->getId()])) {
echo "Not using an Axe\n";
//##DEBUG
return;
}
}
if ($this->leaves) {
$damage = $this->destroyTree($ev->getBlock());
} else {
$damage = $this->destroyTrunk($ev->getBlock());
}
if ($damage && $this->items && $this->itemwear) {
$hand = $pl->getInventory()->getItemInHand();
$hand->setDamage($hand->getDamage() + $this->itemwear * $damage);
$pl->getInventory()->setItemInHand($hand);
if ($this->broadcast) {
$this->owner->getServer()->broadcastMessage(mc::_("%1% used TreeCapitator", $pl->getName()));
} else {
$pl->sendMessage(mc::_("Used TreeCapitator"));
}
}
}
作者:EmreTr
项目:rt
public function onBreak(BlockBreakEvent $event)
{
$player = $event->getPlayer();
if ($player->isCreative()) {
return;
}
$time = round(microtime(true) * 1000);
if ($event->getBlock()->getBreakTime($event->getItem()) <= 0.2) {
return;
}
if ($time - $this->tictock[$player->getName()] <= 200) {
if (!isset($this->kick[$player->getName()])) {
$this->kick[$player->getName()] = 1;
} else {
$this->kick[$player->getName()]++;
}
if ($this->kick > 2) {
$player->kick("파괴자모드 감지");
if (isset($this->kick[$player->getName()])) {
unset($this->kick[$player->getName()]);
}
}
$event->setCancelled();
} else {
if (isset($this->kick[$player->getName()])) {
unset($this->kick[$player->getName()]);
}
}
$this->tictock[$player->getName()] = $time;
}
作者:NameNoOne10
项目:PocketMine-Plugin
/**
* @param BlockBreakEvent $event
* @priority HIGHEST
* @ignoreCancelled true
*/
public function onBlockBreak(BlockBreakEvent $event)
{
if (!$this->plugin->getStorage()->getShield($event->getPlayer()->getLevel())->isAllowed(Shield::BREAKING)) {
$event->setCancelled(true);
$event->getPlayer()->sendTip($this->plugin->getConfig()->get("breakNotAllowed"));
}
}
作者:AbelGamer
项目:BedWar
public function onBreak(BlockBreakEvent $event)
{
if ($event->getBlock() instanceof Bed) {
foreach ($this->getConfig()->get("Arenas") as $arena => $g) {
$bx = $event->getBlock()->getX();
$by = $event->getBlock()->getY();
$bz = $event->getBlock()->getZ();
$blockpos = new Position($bx, $by, $bz);
$bl = $event->getBlock()->getLevel()->getName();
$bpos = $g["bluebed"];
$rpos = $g["redbed"];
$gpos = $g["greenbed"];
$ypos = $g["yellowbed"];
if ($blockpos === $bpos and $bl === $g["world"]) {
foreach ($this->getServer()->getLevelByName($g["world"])->getPlayers() as $p) {
$p->sendMessage(TextFormat::DARK_GRAY . "E' stato rotto il letto" . TextFormat::BLUE . "Blu" . TextFormat::DARK_GRAY . "! I giocatori blu sono stati eliminati!");
}
} elseif ($blockpos === $rpos and $bl === $g["world"]) {
foreach ($this->getServer()->getLevelByName($g["world"])->getPlayers() as $p) {
$p->sendMessage(TextFormat::DARK_GRAY . "E' stato rotto il letto" . TextFormat::RED . "Rosso" . TextFormat::DARK_GRAY . "! I giocatori rossi sono stati eliminati!");
}
} elseif ($blockpos === $gpos and $bl === $g["world"]) {
foreach ($this->getServer()->getLevelByName($g["world"])->getPlayers() as $p) {
$p->sendMessage(TextFormat::DARK_GRAY . "E' stato rotto il letto" . TextFormat::GREEN . "Verde" . TextFormat::DARK_GRAY . "! I giocatori verdi sono stati eliminati!");
}
} elseif ($blockpos === $ypos and $bl === $g["world"]) {
foreach ($this->getServer()->getLevelByName($g["world"])->getPlayers() as $p) {
$p->sendMessage(TextFormat::DARK_GRAY . "E' stato rotto il letto" . TextFormat::YELLOW . "Giallo" . TextFormat::DARK_GRAY . "! I giocatori gialli sono stati eliminati!");
}
}
}
}
}
作者:100henrik10
项目:Minecraft-Pocket-Editio
public function onBlockBreakEvent(BlockBreakEvent $event)
{
if (!$event->getPlayer()->isOp()) {
$event->setCancelled(true);
$this->debug->onDebug('BlockBreakEvent');
}
}
作者:EmreTr
项目:rt
public function SignBreak(BlockBreakEvent $event)
{
$block = $event->getBlock();
if (isset($this->configData["{$block->x}:{$block->y}:{$block->z}"])) {
unset($this->configData["{$block->x}:{$block->y}:{$block->z}"]);
}
}
作者:robozer
项目:S
/**
*
* @param BlockBreakEvent $event
*/
public function onBlockBreak(BlockBreakEvent $event)
{
if ($event->getPlayer() instanceof Player) {
if ($this->plugin->gameLevelManager->setupModeAction === GameLevelManager::COMMAND_SETUP_WAND_GAME_LEVEL || $this->plugin->gameLevelManager->setupModeAction === GameLevelManager::COMMAND_SETUP_WAND_GAME_LEVEL_GATE) {
$this->plugin->gameLevelManager->handleBlockBreakSelection($event->getPlayer(), $event->getBlock());
}
}
}
作者:beito12
项目:PocketMine-MP-Plugin
public function onBreak(BlockBreakEvent $event)
{
$player = $event->getPlayer();
if ($event->getBlock()->getId() === FlowerPotMain::BLOCK_ITEM_FRAME and !$player->isOp()) {
$player->sendMessage("You do not have permission.");
$event->setCancelled();
}
}
作者:HerO-011
项目:Jai
public function onBlockBreak(BlockBreakEvent $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);
}
}
作者:BoysElCrac
项目:xPermission
public function onBlockBreak(BlockBreakEvent $event)
{
$player = $event->getPlayer();
if (!$player->hasPermission("xperms.build")) {
$player->sendMessage(TextFormat::RED . $this->plugin->getConfiguration()->getMSGonIBuildPerm());
$event->setCancelled(true);
}
}
作者:Pocket-GA
项目:PocketMine-MP-Plugin
public function onBreak(BlockBreakEvent $event)
{
if ($event->getPlayer()->hasPermission("worldprotector.block.break")) {
$event->setCancelled(false);
} else {
$event->setCancelled(true);
}
}
作者:robozer
项目:S
/**
*
* @param BlockBreakEvent $event
*/
public function onBlockBreak(BlockBreakEvent $event)
{
if ($event->getPlayer() instanceof Player) {
if ($this->plugin->arenaManager->setupModeAction === MapArenaManager::COMMAND_SETUP_WAND_ARENA_MAIN || $this->plugin->arenaManager->setupModeAction === MapArenaManager::COMMAND_SETUP_WAND_ARENA_MAIN_PLAYER_SPAWNS || $this->plugin->arenaManager->setupModeAction === MapArenaManager::COMMAND_SETUP_WAND_ARENA_DEATH_MATCH || $this->plugin->arenaManager->setupModeAction === MapArenaManager::COMMAND_SETUP_WAND_ARENA_DEATH_MATCH_SPAWN) {
$this->plugin->arenaManager->handleBlockBreakSelection($event->getPlayer(), $event->getBlock());
}
}
}
作者:Skull3
项目:DamageOnBrea
public function onBreak(BlockBreakEvent $ev)
{
$player = $ev->getPlayer();
$cfg = $this->config->getAll();
if ($ev->isCancelled()) {
$player->setHeatlh($player->getHealth() - $cfg["Damage"]);
return;
}
}
作者:Artid
项目:SupremePlugin
public function onBlockBreak(BlockBreakEvent $event)
{
$player = $event->getPlayer();
$block = $event->getBlock();
if ($player->hasPermission('log.breaked.block')) {
$this->plugin->addBreakedBlock($block, $player);
// ADD TIME
}
}
作者:piloc
项目:Farm
public function onBlockBreak(BlockBreakEvent $event)
{
$key = $event->getBlock()->x . "." . $event->getBlock()->y . "." . $event->getBlock()->z;
foreach ($this->crops as $crop) {
if ($event->getItem()->getId() == $crop["item"] and isset($this->farmData[$key])) {
unset($this->farmData[$key]);
}
}
}
作者:diamond-gol
项目:BlockBreakClimbingFi
/**
* @param BlockBreakEvent $event
*
* @priority HIGHEST
*/
public function onBreak(BlockBreakEvent $event)
{
if ($event->isCancelled()) {
$p = $event->getPlayer();
if (isset($this->positions[$p->getName()])) {
$pos = $this->positions[$p->getName()];
$this->revert($p, $pos, $pos->yaw, $pos->pitch);
}
}
}
作者:PMMP-JP
项目:KillBearBoy
public function onBreak(BlockBreakEvent $event)
{
if (!isset($this->wands[$event->getPlayer()->getName()])) {
$eventname = "Break";
$this->regi($event, $eventname);
} else {
$this->chk($event);
$event->setCancelled(true);
}
}
作者:LilianRis
项目:OreInstantDro
public function onBreak(BlockBreakEvent $event)
{
if ($event->getBlock()->getId() == 15) {
$drops = array(Item::get(265, 0, 1));
$event->setDrops($drops);
}
if ($event->getBlock()->getId() == 14) {
$drops = array(Item::get(266, 0, 1));
$event->setDrops($drops);
}
}
作者:stoastye8
项目:Plugin
public function onBlockBreak(BlockBreakEvent $event)
{
$b = $event->getBlock();
if (isset($this->grow[$this->getPos($b)])) {
$c = false;
if ($event->getPlayer()->isCreative()) {
$c = true;
}
$this->beanBreak($b, $c);
}
}