Ввод в кастомных формах

ну да опять тупой вопрос потому что опять во всем я виноват

Почему пишет игрок никогда не был на сервере если я на нем?

 if ($data[0] !== $p->getName() && !$p->hasPermission('skyblockspm.deleteothers'))
                    {
                        $p->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('no-perms-delete'));
                        return;
                    }
                    $skyblockPlayer = SkyBlocksPM::getInstance()->getPlayerManager()->getPlayerByPrefix($data[0]);
                    if (!$skyblockPlayer instanceof Player)
                    {
                        $p->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('not-registered')); // вот ано
                        return;
                    }

и да я уже заебал со своими вопросами но просто я рил хз

Что здесь

<?php

declare(strict_types=1);

namespace olimpik\SB\player;

use olimpik\SB\SkyBlocksPM;
use pocketmine\player\Player as P;

class PlayerManager
{

    /**@var Player[]*/
    private array $players = [];

    public function loadPlayer(P $player)
    {
        SkyBlocksPM::getInstance()->getDataBase()->executeSelect(
            'skyblockspm.player.load',
            [
                'uuid' => $player->getUniqueId()->toString()
            ],
            function (array $rows) use ($player): void
            {
                if (count($rows) == 0) {
                    $this->createPlayer($player);
                    return;
                }
                $this->players[$rows[0]['name']] = new Player($rows[0]['uuid'], $rows[0]['name'], $rows[0]['skyblock']);
                SkyBlocksPM::getInstance()->getSkyBlockManager()->loadSkyblock($rows[0]['skyblock']);
            }
        );
    }

    public function unloadPlayer(P $player)
    {
        SkyBlocksPM::getInstance()->getSkyBlockManager()->unloadSkyBlock($this->getPlayer($player)->getSkyBlock());
        unset($this->players[$player->getName()]);
    }

    public function createPlayer(P $player): void
    {
        SkyBlocksPM::getInstance()->getDataBase()->executeInsert('skyblockspm.player.create',
        [
            'uuid' => $player->getUniqueId()->toString(),
            'name' => $player->getName(),
            'skyblock' => ''
        ]);
        $this->players[$player->getName()] = new Player($player->getUniqueId()->toString(), $player->getName(), '');
    }

    public function getPlayer(P $player): Player
    {
        return $this->players[$player->getName()];
    }

    public function getPlayerByPrefix(string $name): ?Player
    {
        return $this->players[$name]?? null;
    }

}

хотя при выполнении команды все норм

public function onRun(CommandSender $sender, string $aliasUsed, array $args): void
    {
        $name = $args['name'];
        if ($name !== $sender->getName() && !$sender->hasPermission('skyblockspm.deleteothers'))
        {
            $sender->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('no-perms-delete'));
            return;
        }
        $skyblockPlayer = SkyBlocksPM::getInstance()->getPlayerManager()->getPlayerByPrefix($name);
        if (!$skyblockPlayer instanceof Player)
        {
            $sender->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('not-registered'));
            return;
        }
        if ($skyblockPlayer->getSkyBlock() == '')
        {
            $sender->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('no-island'));
            return;
        }
        $skyblock = SkyBlocksPM::getInstance()->getSkyBlockManager()->getSkyBlockByUuid($skyblockPlayer->getSkyBlock());
        foreach ($skyblock->getMembers() as $member)
        {
            $player = SkyBlocksPM::getInstance()->getServer()->getPlayerByPrefix($member);
            if ($player instanceof P)
                $player->teleport(SkyBlocksPM::getInstance()->getServer()->getWorldManager()->getDefaultWorld()->getSpawnLocation());
            SkyBlocksPM::getInstance()->getPlayerManager()->getPlayerByPrefix($member)->setSkyBlock('');
        }
        SkyBlocksPM::getInstance()->getSkyBlockManager()->deleteSkyBlock($skyblock->getName());
        $world = SkyBlocksPM::getInstance()->getServer()->getWorldManager()->getWorldByName($skyblock->getWorld());
        foreach ($world->getPlayers() as $p)
            $p->teleport(SkyBlocksPM::getInstance()->getServer()->getWorldManager()->getDefaultWorld()->getSpawnLocation());
        if ($world->isLoaded())
        {
            $folderName = $world->getFolderName();
            SkyBlocksPM::getInstance()->getServer()->getWorldManager()->unloadWorld($world);
            $this->deleteWorld(SkyBlocksPM::getInstance()->getServer()->getDataPath() . 'worlds' . DIRECTORY_SEPARATOR . $folderName);
        }
        $sender->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('deleted-sb', [
            "{NAME}" => $skyblockPlayer->getName()
        ]));
    }

Игрока нет в массиве

.__. как если я на сервере

ну тут все норм

Ну ты же получаешь не онлайн сервера, а список игроков из массива который содержит какие-то записи из бд

хм получается так?

$name = $data[0] = $data[name];

или нет высер какойто

Мама…

ммм

Ну а как :confused:

if ($data[0] !== $p->getName() && !$p->hasPermission('skyblockspm.deleteothers'))
                    {
                        $p->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('no-perms-delete'));
                        return;
                    }
                    $skyblockPlayer = SkyBlocksPM::getInstance()->getPlayerManager()->loadPlayer(Server::getInstance()->getPlayerByPrefix($data[0]));
                    if (!$skyblockPlayer instanceof Player)
                    {
                        $p->sendMessage(SkyBlocksPM::getInstance()->getMessages()->getMessage('not-registered')); // вот ано
                        return;
                    }
 TypeError: "olimpik\SB\player\PlayerManager::loadPlayer(): Argument #1 ($player) must be of type pocketmine\player\Player, olimpik\SB\player\Player given, called in C:\Users\Acer\Desktop\pmmp4\PocketMine-MP-4.7.0\plugins\[MW]\src\olimpik\SB\commands\SkyBlockCommand.php on line 112" (EXCEPTION) in "plugins/[MW]/src/olimpik/SB/player/PlayerManager" at line 16

Зачем тебе свой класс Player

ааааа

жалуется такого в Server.php Нема

метода