This repository has been archived by the owner on Jul 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6882f1a
commit 3688bd6
Showing
4 changed files
with
140 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
namespace aliuly\worldprotect; | ||
|
||
use pocketmine\plugin\PluginBase as Plugin; | ||
use pocketmine\event\Listener; | ||
use pocketmine\event\entity\EntityExplodeEvent; | ||
use pocketmine\utils\TextFormat; | ||
|
||
class NoExplodeMgr implements Listener { | ||
public $owner; | ||
public function __construct(Plugin $plugin) { | ||
$this->owner = $plugin; | ||
$this->owner->getServer()->getPluginManager()->registerEvents($this, $this->owner); | ||
} | ||
public function onExplode(EntityExplodeEvent $ev){ | ||
//echo __METHOD__.",".__LINE__."\n"; | ||
$et = $ev->getEntity(); | ||
if ($this->owner->checkNoExplode($et->getX(),$et->getY(),$et->getZ(), | ||
$et->getLevel()->getName())) return; | ||
$ev->setCancelled(); | ||
$this->owner->getLogger()->info(TextFormat::RED. | ||
"Explosion was stopped in ".$et->getLevel()->getName()); | ||
} | ||
} |