That's what I suppose when i run my plugin : This code takes place somewhere in the onEnable() function : PHP: $world = $this->getServer()->getLevel($w); if ($world == null) { Main::log("WARNING","World ".$w." not loaded. Config is load with the worldname"); } i got this on the logfile : 09:34:42 [WARNING] [bag_zone] World world not loaded. Config is load with the worldname Anybody can confirm ?
I have the same issue on another plugin, the getLevel() is called after the onEnable() PHP: $level = $this->getServer()->getLevel($levelname); if ($level == null) { $sender->sendMessage("Warp level is not loaded"); return true; } Is there a bug in the getLevel() method on the last build ? I change the thread title...
=== is to add the type in the test, but without the type my comparaison is already true. however is tried with === and that don't fix my issue. I cannot get the level from his name with this command $level = $this->getServer()->getLevel($levelname);
That function gets the level based on the ID, just write a function that loops through $this->getServer()->getLevels() and checks if $level->getName() === $name.
OOOOOkkk thx ! its a recent change no ? I found that in the source code : PHP: public function getLevelByName($name) ===> I fixed and that works. Thx again.
What about this? Code: Fatal error: Uncaught exception 'Exception' with message 'Tried to modify an empty Chunk' in phar://C:/coding/_New-API/PocketMine-MP.phar/src/pocketmine/level/format/generic/EmptyChunkSection.php:67 Stack trace: #0 phar://C:/coding/_New-API/PocketMine-MP.phar/src/pocketmine/level/format/generic/BaseChunk.php(160): pocketmine\level\format\generic\EmptyChunkSection->setBlock(8, 7, 0, 35, 1) #1 phar://C:/coding/_New-API/PocketMine-MP.phar/src/pocketmine/level/Level.php(556): pocketmine\level\format\generic\BaseChunk->setBlock(8, 55, 0, 35, 1) #2 C:\coding\LegionPE-Delta\LegionPE-Delta\src\pemapmodder\utils\spaces\CuboidSpace.php(64): pocketmine\level\Level->setBlock(Object(pocketmine\math\Vector3), Object(pocketmine\block\Wool), false, false, true) #3 C:\coding\LegionPE-Delta\LegionPE-Delta\src\pemapmodder\legionpe\hub\Team.php(81): pemapmodder\utils\spaces\CuboidSpace->setBlocks(Object(pocketmine\block\Wool)) Is this a PocketMine issue or my issue?
Don't you tried to set a block at a location wich is inside a not already generated chunk ? In your plugin (Team.php(81))