Switched it so it enables my game

Signed-off-by: Aaron Brock <TheMineBench@gmail.com>
This commit is contained in:
Aaron Brock 2015-07-01 02:02:51 -04:00
parent fcedb4d6ba
commit e3b0ee9ae3
1 changed files with 23 additions and 13 deletions

View File

@ -2,28 +2,29 @@
namespace mineplex\plugin;
use mineplex\plugin\core\updater\UpdateType;
use mineplex\plugin\tasks\TickTask;
use mineplex\plugin\events\TickEvent;
use mineplex\plugin\core\updater\Updater;
use mineplex\plugin\core\updater\UpdateEvent;
use mineplex\plugin\core\updater\UpdateType as UpdaterType;
use mineplex\plugin\util\UtilString;
use mineplex\plugin\packets\StrangePacket;
use pocketmine\plugin\PluginBase;
use mineplex\plugin\bench\arenas\SingleGameArena;
use mineplex\plugin\core\updater\UpdateEvent;
use mineplex\plugin\bench\game\games\pvp\Pvp;
use mineplex\plugin\packets\StrangePacket;
use mineplex\plugin\util\UtilString;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\event\player\PlayerCommandPreprocessEvent;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\plugin\PluginBase;
use pocketmine\Server;
class Main extends PluginBase implements Listener
{
public function onEnable()
{
$this->getServer()->getScheduler()->scheduleRepeatingTask(new TickTask($this), 1);
new SingleGameArena($this, new Pvp());
$this->getServer()->getPluginManager()->registerEvents($this, $this);
new Updater($this);
//$this->getServer()->getScheduler()->scheduleRepeatingTask(new TickTask($this), 1);
//$this->getServer()->getPluginManager()->registerEvents($this, $this);
//new Updater($this);
}
public function onDisable()
@ -31,6 +32,15 @@ class Main extends PluginBase implements Listener
}
public function joinMessage(PlayerJoinEvent $event)
{
$name = $event->getPlayer()->getName();
$player = Server::getInstance()->getPlayer($name);
$event->setJoinMessage($player->getName());
}
public function onPlayerJoin(PlayerJoinEvent $event)
{
$event->getPlayer()->sendMessage("Welcome to the server " . $event->getPlayer()->getName() . "!");