Skip to content

Commit

Permalink
PM5
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackjack200 committed Jun 14, 2023
1 parent 0fa61fa commit 70c04c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: WorldsX
version: 1.1.2
api: 4.0.0
version: 1.2.0
api: 5.0.0
main: blackjack200\worldsx\WorldsX
author: Blackjack200
website: https://github.com/Blackjack200/WorldsX.git
Expand Down
2 changes: 1 addition & 1 deletion src/blackjack200/worldsx/WorldsX.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use pocketmine\Server;
use pocketmine\world\generator\GeneratorManager;
use RuntimeException;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

class WorldsX extends PluginBase {
protected function onLoad() : void {
Expand Down
5 changes: 4 additions & 1 deletion src/blackjack200/worldsx/world/WorldUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use pocketmine\world\format\io\data\BaseNbtWorldData;
use pocketmine\world\World;
use pocketmine\world\WorldCreationOptions;
use Webmozart\PathUtil\Path;
use Symfony\Component\Filesystem\Path;

class WorldUtil {
public static function findWorldByFolderName(string $name) : ?World {
Expand Down Expand Up @@ -107,6 +107,9 @@ public static function contains(string $name) : bool {
public static function getWorlds() : array {
$basePath = Path::join(Server::getInstance()->getDataPath(), 'worlds');
$dirs = scandir($basePath, SCANDIR_SORT_NONE);
if ($dirs === false) {
return [];
}
foreach ($dirs as $i => $dir) {
if ($dir === '.' || $dir === '..') {
unset($dirs[$i]);
Expand Down

0 comments on commit 70c04c2

Please sign in to comment.