Closed xSuperr closed 2 years ago
Yeah a code snippet and a video would be nice.
Command:
SkyblockPlayer::get($sender->getUniqueId(), function (?array $data) use ($sender, $args): void {
if ($data === null) return;
if ($data['island'] !== null) {
$sender->sendMessage('§r§cYou are already in an island!');
return;
}
$name = $args['name'] ?? null;
(new IslandCreateMenu($sender, $this->plugin, $name))->display();
});
Menu:
public function display(): void
{
$manager = InvMenuHandler::getPlayerManager();
if ($manager->get($this->player) === null) return;
$oldMenu = $manager->get($this->player)->getCurrent();
if ($oldMenu !== null) {
$this->onClose($this->player);
self::$awaitingClose[$this->player->getName()] = $this;
} else {
$this->send($this->player);
}
}
There's a lot happening in that display() method, I'm not sure if I can directly attribute this to InvMenu without understanding what all of that's for. I'd suggest further debugging the issue on your end.
I have two potential causes: A. Light blocks, I replaced all air blocks in my spawn with light blocks, a block similar to barriers but that wouldn't make any sense because it was the same issue while in an area without light blocks. B. WaterdogPE, I will test the InvMenu without waterdog in a minute
Edit: can confirm it is not waterdog
A minimal reproduction test case would be better for both of us. From what I understood, sending a menu doesn't work until the player opens their inventory, correct? Does the following code work?
InvMenu::create(InvMenu::TYPE_CHEST)->send($player);
Yeah that works without issue, it is most likely a problem on my part. Sorry about the trouble.
When I send a player an InvMenu they do not receive it, but upon opening their inventory and closing it the menu appears. I have also consoled other developers and they have had this same issue. I can provide code snippets if required.