IS THE WORLD READY PLEASE
This commit is contained in:
parent
5339b792ac
commit
b618c7b255
@ -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\WorldLoadSuccessEvent;
|
||||
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\level\Position;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\Player;
|
||||
|
||||
use ZipArchive;
|
||||
use Exception;
|
||||
@ -41,6 +36,8 @@ class WorldComponent implements Listener
|
||||
private $mapData = array();
|
||||
private $mapSettings = array();
|
||||
|
||||
private $ready = false;
|
||||
|
||||
public function __construct(Arena $arena)
|
||||
{
|
||||
$this->arena = $arena;
|
||||
@ -122,6 +119,8 @@ class WorldComponent implements Listener
|
||||
print("Successfully Loaded World: " . $this->gameFolder . "\n");
|
||||
|
||||
Server::getInstance()->getPluginManager()->callEvent(new WorldLoadSuccessEvent($this->arena));
|
||||
|
||||
$this->ready = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -271,5 +270,10 @@ class WorldComponent implements Listener
|
||||
{
|
||||
return rand(0, 999999); //Make this acutally unique
|
||||
}
|
||||
|
||||
public function isWorldReady()
|
||||
{
|
||||
return $this->ready;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user