Merge branch 'master' of ssh://184.154.0.242:7999/min/mineplex
This commit is contained in:
commit
b4349a164b
@ -12,15 +12,10 @@ use mineplex\plugin\gameengine\arenas\Arena;
|
|||||||
use mineplex\plugin\gameengine\game\components\world\event\WorldLoadFailEvent;
|
use mineplex\plugin\gameengine\game\components\world\event\WorldLoadFailEvent;
|
||||||
use mineplex\plugin\gameengine\game\components\world\event\WorldLoadSuccessEvent;
|
use mineplex\plugin\gameengine\game\components\world\event\WorldLoadSuccessEvent;
|
||||||
use mineplex\plugin\util\UtilString;
|
use mineplex\plugin\util\UtilString;
|
||||||
use mineplex\plugin\core\updater\UpdateEvent;
|
|
||||||
use mineplex\plugin\core\updater\UpdateType;
|
|
||||||
use pocketmine\event\level\LevelUnloadEvent;
|
|
||||||
use pocketmine\event\player\PlayerJoinEvent;
|
|
||||||
use pocketmine\event\Listener;
|
use pocketmine\event\Listener;
|
||||||
use pocketmine\level\Position;
|
use pocketmine\level\Position;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\Server;
|
use pocketmine\Server;
|
||||||
use pocketmine\Player;
|
|
||||||
|
|
||||||
use ZipArchive;
|
use ZipArchive;
|
||||||
use Exception;
|
use Exception;
|
||||||
@ -41,6 +36,8 @@ class WorldComponent implements Listener
|
|||||||
private $mapData = array();
|
private $mapData = array();
|
||||||
private $mapSettings = array();
|
private $mapSettings = array();
|
||||||
|
|
||||||
|
private $ready = false;
|
||||||
|
|
||||||
public function __construct(Arena $arena)
|
public function __construct(Arena $arena)
|
||||||
{
|
{
|
||||||
$this->arena = $arena;
|
$this->arena = $arena;
|
||||||
@ -108,6 +105,10 @@ class WorldComponent implements Listener
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print("Error Extracting: " . $this->gameFolder . "\n");
|
print("Error Extracting: " . $this->gameFolder . "\n");
|
||||||
|
|
||||||
|
Server::getInstance()->getPluginManager()->callEvent(new WorldLoadFailEvent($this->arena));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Load World
|
//Load World
|
||||||
@ -119,6 +120,8 @@ class WorldComponent implements Listener
|
|||||||
|
|
||||||
$this->loadWorldData();
|
$this->loadWorldData();
|
||||||
|
|
||||||
|
$this->ready = true;
|
||||||
|
|
||||||
print("Successfully Loaded World: " . $this->gameFolder . "\n");
|
print("Successfully Loaded World: " . $this->gameFolder . "\n");
|
||||||
|
|
||||||
Server::getInstance()->getPluginManager()->callEvent(new WorldLoadSuccessEvent($this->arena));
|
Server::getInstance()->getPluginManager()->callEvent(new WorldLoadSuccessEvent($this->arena));
|
||||||
@ -273,5 +276,10 @@ class WorldComponent implements Listener
|
|||||||
{
|
{
|
||||||
return rand(0, 999999); //Make this acutally unique
|
return rand(0, 999999); //Make this acutally unique
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isWorldReady()
|
||||||
|
{
|
||||||
|
return $this->ready;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user