Code: [Server thread/CRITICAL]: Error: "Cannot instantiate abstract class pocketmine\item\Food" (EXCEPTION) in "src/pocketmine/utils/Config" at line 158 Because I tried to save a Food-inheritance to the config, I guessed? Don't know how to fix this. Can you help me? I'm using Config::SERIALIZED
No need code, obviously? Here if you wish. PHP: new Config($this->getDataFolder() . "data.sl", Config::SERIALIZED); https://drive.google.com/open?id=19Ws7xBzIXSMUx0fQdKelfAi-IcaL05-g
PHP: $contents = $inventory->getContents();$data = new Config(self::getInstance()->getDataFolder() . "data.sl", Config::SERIALIZED); $data->set($player->getLowerCaseName(), $contents); $data->save();
Oh, maybe using different phars causes the serialized object to shape. I couldn't recreate this in newest PMMP. Anyway here is the plugin. https://drive.google.com/file/d/16XF_6vo9gHZ16J_yDxa8yg0stk5QEjEX/view?usp=sharing
What I suspect is that you've been using an older version of PMMP, then updated it and this error occured. That's probably because there've been many food changes/refactors in the last couple days.
It seems that you are directly serializing objects in the PocketMine API. This may be unsafe, as it relies on the non-API part of the objects, such as private properties. These are subject to change without notice. Consider using another format rather than serializing everything. In addition, serializing of a class not completely controlled by you may lead to serialization of undesired values, such as references to god objects (e.g. Server). As the PocketMine API does not guarantee the serialization safety, direct serialization should be avoided.
It is basically config.yml with the type of Config::SERIALIZED instead of Config::YAML FIX: Quick fix for this, example included, Windows only. But not preserve the item though. https://drive.google.com/open?id=1jxI0dM2VEZTGS5MW7Z2f4egVqZvIn_0y Place data.sl into the directory, run fixfood.cmd, output the newdata.sl that had been removed all pocketmine\item\Food items