wipe player data on join

This commit is contained in:
Cheese 2015-07-07 18:11:43 +10:00
parent 8cd5d9f7d0
commit 35ccb04ea0

View File

@ -6,6 +6,7 @@ use mineplex\plugin\gameengine\arenas\MultiGameArena;
use mineplex\plugin\gameengine\game\components\world\WorldComponent;
use mineplex\plugin\gameengine\game\factory\TestGameFactory;
use mineplex\plugin\core\updater\Updater;
use mineplex\plugin\util\UtilFile;
use mineplex\plugin\util\UtilString;
use pocketmine\block\Block;
use pocketmine\event\Listener;
@ -35,10 +36,14 @@ class Main extends PluginBase implements Listener
//$this->test = new WorldComponent($this->arena);
new Updater($this);
$this->arena->getPlugin()->getServer()->getLevelByName("world")->setSpawnLocation(new Vector3(0, 200, 0));
}
public function onLogin(PlayerLoginEvent $event)
{
UtilFile::deleteDir('players/' . $event->getPlayer()->getName() . '.dat');
if ($this->arena->canJoin($event->getPlayer()))
return;