My error is the following, when I create a mine, I leave it set, ready to use, it catches well, but when I reboot my server, it gives this error: Code: [Server thread/CRITICAL]: TypeError: "Argument 4 passed to minereset\Mine::__construct() must be an instance of pocketmine\level\Level, null given, called in phar://C:/Users/DanielYTK/Documents/PocketMine-MP/plugins/MineReset.phar/src/minereset/MineReset.php on line 198" (EXCEPTION) in "/MineReset.phar/src/minereset/Mine" at line 13 Can anyone help me solve it?
I tried this on onEnable (): but it did not work PHP: $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "mw load --all") Does not work because it will execute the command, after reading all the files; How can I do anything to solve this?
Do you know how to extract the plugin from phar? Edit MineReset.php PHP: public function parseMines(){ foreach($this->mineData->getAll() as $n => $m){ if(!$this->getServer()->loadLevel($m[7])){ $this->getLogger()->error("Failed to load level $m[7] for mine $n"); continue; } if($m[6] !== false){ $this->mines[$n] = new Mine($this, new Vector3(min($m[0], $m[1]), min($m[2], $m[3]), min($m[4], $m[5])), new Vector3(max($m[0], $m[1]), max($m[2], $m[3]), max($m[4], $m[5])), $this->getServer()->getLevelByName($m[7]), $m[6]); } else{ $this->mines[$n] = new Mine($this, new Vector3(min($m[0], $m[1]), min($m[2], $m[3]), min($m[4], $m[5])), new Vector3(max($m[0], $m[1]), max($m[2], $m[3]), max($m[4], $m[5])), $this->getServer()->getLevelByName($m[7])); } } }
error to reset a mine: Code: Unhandled exception executing command 'mine reset s1' in mine: Call to undefined method pocketmine\level\format\mcregion\Chunk::fastSerialize() [18:56:31] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\level\format\mcregion\Chunk::fastSerialize()" (EXCEPTION) in "/MineReset-master/src/minereset/Mine" at line 45
function resetMine(): PHP: public function resetMine(){ $chunks = []; for ($x = $this->getA()->getX(); $x-16 <= $this->getB()->getX(); $x += 16){ for ($z = $this->getA()->getZ(); $z-16 <= $this->getB()->getZ(); $z += 16) { //$this->getLevel()->getServer()->getLogger()->info(Level::chunkHash($x >> 4, $z >> 4)); $chunk = $this->level->getChunk($x >> 4, $z >> 4, true); $chunkClass = get_class($chunk); $chunks[Level::chunkHash($x >> 4, $z >> 4)] = $chunk->fastSerialize($chunk); } } //var_dump($chunks); $resetTask = new MineResetTask($chunks, $this->a, $this->b, $this->data, $this->getLevel()->getId(), $this->base->getRegionBlocker()->blockZone($this->a, $this->b, $this->level), $chunkClass); $this->base->scheduleReset($resetTask); }
I think that plugin may have broken in one of the "game breaking" changes that @dktapps made to pocketmine in one of the API changes
Either your version is outdated or you're using a spoon. `pocketmine\level\format\mcregion` namespace does not exist anymore.