Last active
September 9, 2017 19:45
-
-
Save TheNewHEROBRINEX/893580c9c6599d97a75d3f7b62b002c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @name WorldNamesFixer | |
* @main TheNewHEROBRINE\WorldNamesFixer\Main | |
* @version 1.0.0 | |
* @api 3.0.0-ALPHA7 | |
* @author TheNewHEROBRINE | |
*/ | |
namespace TheNewHEROBRINE\WorldNamesFixer { | |
class Main extends \pocketmine\plugin\PluginBase implements \pocketmine\event\Listener { | |
public function onEnable() { | |
foreach (glob($this->getServer()->getDataPath(). "worlds/*") as $f) { | |
$world = basename($f); | |
if ($this->getServer()->isLevelLoaded($world)) continue; | |
if (!$this->getServer()->isLevelGenerated($world)) continue; | |
$this->getServer()->loadLevel($world); | |
} | |
foreach ($this->getServer()->getLevels() as $level) { | |
echo PHP_EOL. $level->getName() . "->"; | |
$level->getProvider()->getLevelData()->LevelName = new \pocketmine\nbt\tag\StringTag("LevelName", $level->getFolderName()); | |
echo $level->getName(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment