Hi! I've been trying to update the skywars plugin by svile but ive bumped into two errors that ive no clue with, one regarding when the plugin loads up. PHP: public function onLoad(){if (!is_dir($this->getDataFolder()))@mkdir($this->getDataFolder() . "\x61\x72\x65\x6e\x61\x73", 0755, true);//This changes worlds NBT name with folders ones to avoid problems //world folder name should be used instead of doing thistry {foreach (scandir($this->getServer()->getDataPath() . "\x77\x6f\x72\x6c\x64\x73") as $worldDir) {if (is_dir($this->getServer()->getDataPath() . "\x77\x6f\x72\x6c\x64\x73\x2f" . $worldDir) && is_file($this->getServer()->getDataPath() . "\x77\x6f\x72\x6c\x64\x73\x2f" . $worldDir . "\x2f\x6c\x65\x76\x65\x6c\x2e\x64\x61\x74")) {$nbt = new NBT(NBT::BIG_ENDIAN);$nbt->readCompressed(file_get_contents($this->getServer()->getDataPath() . "\x77\x6f\x72\x6c\x64\x73\x2f" . $worldDir . "\x2f\x6c\x65\x76\x65\x6c\x2e\x64\x61\x74"));$levelData = $nbt->getData();if (array_key_exists("\x44\x61\x74\x61", $levelData) && $levelData["\x44\x61\x74\x61"] instanceof Compound) {$levelData = $levelData["\x44\x61\x74\x61"];if (array_key_exists("\x4c\x65\x76\x65\x6c\x4e\x61\x6d\x65", $levelData) && $levelData["\x4c\x65\x76\x65\x6c\x4e\x61\x6d\x65"] != $worldDir) {$levelData["\x4c\x65\x76\x65\x6c\x4e\x61\x6d\x65"] = new Str("\x4c\x65\x76\x65\x6c\x4e\x61\x6d\x65", $worldDir);$nbt->setData(new Compound('', ["\x44\x61\x74\x61" => $levelData]));file_put_contents($this->getServer()->getDataPath() . "\x77\x6f\x72\x6c\x64\x73\x2f" . $worldDir . "\x2f\x6c\x65\x76\x65\x6c\x2e\x64\x61\x74", $nbt->writeCompressed());}unset($worldDir, $levelData, $nbt);} else {$this->getLogger()->critical('There is a problem with the "level.dat" of the world: §f' . $worldDir);unset($worldDir, $levelData, $nbt);}}}} catch (\Exception $e) {$this->getLogger()->critical($e->getMessage() . ' in §b' . $e->getFile() . '§c on line §b' . $e->getLine());}} Which caused this error PHP: 25.04 22:35:56 [Server] Server thread/CRITICAL Error: "Cannot instantiate abstract class pocketmine\nbt\NBT" (EXCEPTION) in "SkyWars-svile-master/src/svile/sw/SWmain" at line 95 And the second one is when i try make an arena with /sw create PHP: 25.04 23:09:49 [Server] Server thread/DEBUG #1 SkyWars-svile-master/src/svile/sw/SWcommands(267): pocketmine\nbt\tag\CompoundTag->__set(string generatorName, pocketmine\nbt\tag\StringTag object) 25.04 23:09:49 [Server] Server thread/DEBUG #0 vendor/pocketmine/nbt/src/tag/NoDynamicFieldsTrait(37): pocketmine\nbt\tag\CompoundTag->throw() 25.04 23:09:49 [Server] Server thread/CRITICAL RuntimeException: "Dynamic field access on pocketmine\nbt\tag\CompoundTag is no longer supported" (EXCEPTION) in "vendor/pocketmine/nbt/src/tag/NoDynamicFieldsTrait" at line 29 25.04 23:09:49 [Server] Server thread/CRITICAL Unhandled exception executing command 'sw create ryan 2 150 300' in sw: Dynamic field access on pocketmine\nbt\tag\CompoundTag is no longer supported 25.04 23:09:45 Correct me if im wrong but im sure that error refers to this line PHP: $provider->getLevelData()->LevelName = new Str('LevelName', $fworld); If anyone can show me the changes need to be made i'd be very grateful. I've tried to look at other plugins to compare their nbt updates with this one but they're all so different! I think a tutorial in resources is needed for this The plugin is here if you don't know what one i'm referring to
I think it's better you create an issue request for the author to update the plugin if you can't understand their coding style
What we have here is less like "style" and more like code that is intentionally made harder to understand.
You're probably right but i don't think the author has intentions of updating it, plus you're not able to leave issues there sadly I can't say i agree with the bad written part, but is this a fix you have in your possession? Also I don't think its very fair for svile to make a big plugin like this and have someone else make money off it lol
Svile left plugin coding a looong time ago. He is coding MCPE hacks now. I don't think he cares but, read the license.
Maybe poggit orphanage can assist you. https://github.com/poggit-orphanage/office/blob/master/README.md