Skip to content

Commit

Permalink
1.2
Browse files Browse the repository at this point in the history
* Blocked block breaking.
  • Loading branch information
Falkirks committed Aug 16, 2014
1 parent b6e1e25 commit 71492bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: iControlU
main: icontrolu\iControlU
version: 1.1
version: 1.2
author: Falk
api: [1.0.0]
load: POSTWORLD
Expand Down
14 changes: 14 additions & 0 deletions src/icontrolu/iControlU.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
use pocketmine\command\Command;
use pocketmine\command\CommandExecutor;
use pocketmine\command\CommandSender;
use pocketmine\event\block\BlockBreakEvent;
use pocketmine\event\block\BlockPlaceEvent;
use pocketmine\event\entity\EntityMoveEvent;
use pocketmine\event\inventory\InventoryPickupItemEvent;
use pocketmine\event\Listener;
Expand Down Expand Up @@ -115,6 +117,16 @@ public function onItemPickup(InventoryPickupItemEvent $event){
}
}
}
public function onBreak(BlockBreakEvent $event){
if($this->isBarred($event->getPlayer())){
$event->setCancelled();
}
}
public function onPlace(BlockPlaceEvent $event){
if($this->isBarred($event->getPlayer())){
$event->setCancelled();
}
}
public function onQuit(PlayerQuitEvent $event){
if($this->isControl($event->getPlayer())){
unset($this->b[$this->s[$event->getPlayer()->getName()]->getTarget()->getName()]);
Expand All @@ -127,6 +139,8 @@ public function onQuit(PlayerQuitEvent $event){
foreach($this->getServer()->getOnlinePlayers() as $online){
$online->showPlayer($i->getControl());
}
//$i->getControl()->showPlayer($i->getTarget());

unset($this->b[$event->getPlayer()->getName()]);
unset($this->s[$i->getControl()->getName()]);
break;
Expand Down

0 comments on commit 71492bf

Please # to comment.