Added Spectate stuff!

Signed-off-by: Aaron Brock <TheMineBench@gmail.com>
This commit is contained in:
Aaron Brock 2015-07-06 02:03:05 -04:00
parent ac20f55391
commit 844aa44dc4
2 changed files with 14 additions and 1 deletions

View File

@ -7,6 +7,7 @@ use mineplex\plugin\gameengine\game\components\world\WorldComponent;
use mineplex\plugin\gameengine\game\factory\TestGameFactory;
use mineplex\plugin\core\updater\Updater;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerDeathEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\player\PlayerLoginEvent;
use pocketmine\level\Position;
@ -40,6 +41,11 @@ class Main extends PluginBase implements Listener
$event->setCancelled();
}
public function onDeath(PlayerDeathEvent $event)
{
$event->getEntity()->setHealth($event->getEntity()->getMaxHealth());
}
public function onJoin(PlayerJoinEvent $event)
{
$this->arena->addPlayer($event->getPlayer());

View File

@ -18,8 +18,13 @@ use mineplex\plugin\gameengine\game\components\world\WorldComponent;
use mineplex\plugin\gameengine\time\BenchSchedule;
use mineplex\plugin\gameengine\time\BenchTask;
use mineplex\plugin\gameengine\time\BenchTaskData;
use pocketmine\entity\Effect;
use pocketmine\event\HandlerList;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerDeathEvent;
use pocketmine\network\protocol\AnimatePacket;
use pocketmine\network\protocol\ContainerSetDataPacket;
use pocketmine\network\protocol\DropItemPacket;
use pocketmine\Player;
use pocketmine\Server;
use mineplex\plugin\gameengine\game\components\gamestate\events\GameStateChangeEvent;
@ -127,7 +132,9 @@ class LobbyCountdown implements Listener, BenchTask {
BenchSchedule::cancelTask($this);
$this->count = $this->startCount;
}
}
@ -185,6 +192,6 @@ class LobbyCountdown implements Listener, BenchTask {
private function popup(Player $player)
{
$player->sendPopup($this->message);
$player->sendTip($this->message);
}
}