Ad5001 / BetterGen

PocketMine's Tomorrow's World Generator. Mirror of
https://git.ad5001.eu/Ad5001/BetterGen
Other
58 stars 27 forks source link

Plugin crash when delBio option is specified #46

Closed fyvekatz closed 6 years ago

fyvekatz commented 6 years ago

createworld survival3 betternormal 0 {"delBio":"BetterDesert"} [16:49:59] [Server thread/INFO]: [BetterGen] Generating level survival3 with generator betternormal and seed 7261.. [16:49:59] [Server thread/INFO]: Preparing level "survival3" [16:49:59] [Server thread/ERROR]: Could not generate level "survival3": Undefined index: de [16:49:59] [Server thread/CRITICAL]: ErrorException: "Undefined index: de" (EXCEPTION) in "BetterGen/src/Ad5001/BetterGen/generator/BetterNormal" at line 417 [16:49:59] [Server thread/DEBUG]: #0 BetterGen/src/Ad5001/BetterGen/generator/BetterNormal(417): pocketmine\error_handler(integer 8, string Undefined index: de, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/BetterGen/src/Ad5001/BetterGen/generator/BetterNormal.php, integer 417, array Array()) [16:49:59] [Server thread/DEBUG]: #1 src/pocketmine/level/Level(391): Ad5001\BetterGen\generator\BetterNormal->construct(array Array()) [16:49:59] [Server thread/DEBUG]: #2 src/pocketmine/Server(1068): pocketmine\level\Level->initLevel() [16:49:59] [Server thread/DEBUG]: #3 BetterGen/src/Ad5001/BetterGen/Main(169): pocketmine\Server->generateLevel(string survival3, integer 7261, string Ad5001\BetterGen\generator\BetterNormal, array Array()) [16:49:59] [Server thread/DEBUG]: #4 src/pocketmine/command/PluginCommand(58): Ad5001\BetterGen\Main->onCommand(pocketmine\command\ConsoleCommandSender object, pocketmine\command\PluginCommand object, string createworld, array Array()) [16:49:59] [Server thread/DEBUG]: #5 src/pocketmine/command/SimpleCommandMap(258): pocketmine\command\PluginCommand->execute(pocketmine\command\ConsoleCommandSender object, string createworld, array Array()) [16:49:59] [Server thread/DEBUG]: #6 src/pocketmine/Server(1946): pocketmine\command\SimpleCommandMap->dispatch(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"}) [16:49:59] [Server thread/DEBUG]: #7 src/pocketmine/Server(1931): pocketmine\Server->dispatchCommand(pocketmine\command\ConsoleCommandSender object, string createworld survival3 betternormal 0 {"delBio":"BetterDesert"}) [16:49:59] [Server thread/DEBUG]: #8 src/pocketmine/Server(2492): pocketmine\Server->checkConsole() [16:49:59] [Server thread/DEBUG]: #9 src/pocketmine/Server(2243): pocketmine\Server->tick() [16:49:59] [Server thread/DEBUG]: #10 src/pocketmine/Server(2119): pocketmine\Server->tickProcessor() [16:49:59] [Server thread/DEBUG]: #11 src/pocketmine/Server(1701): pocketmine\Server->start() [16:49:59] [Server thread/DEBUG]: #12 src/pocketmine/PocketMine(305): pocketmine\Server->construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /share/MD0_DATA/.qpkg/Pocketmine/, string /share/MD0_DATA/.qpkg/Pocketmine/plugins/) [16:49:59] [Server thread/DEBUG]: #13 /share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar(1): require(string phar:///share/MD0_DATA/.qpkg/Pocketmine/PocketMine-MP-3.0.0-ALPHA12.phar/src/pocketmine/PocketMine.php)

Code from file:

    /**
     * Constructs the class
     *
     * @param array $options
     */
    public function __construct(array $options = []) {
            self::$options["preset"] = $options["preset"];
            $options = (array) json_decode($options["preset"]);
            if(isset($options["delBio"])) {
                    if(is_string($options["de"])) $options["delBio"] = explode(",", $options["delBio"]);
                    if(count($options["delBio"]) !== 0) {
                            self::$options["delBio"] = $options["delBio"];
                    }
            }

If I'm reading this correctly, just some missing characters. I changed that "de" to "delBio" and the level generated correctly.

jasonw4331 commented 6 years ago

could you put the stack trace in code brackets so it doesn't ping a bunch of other issues?