Expected result: A player's inventory slots would be updated.
Actual result: It does get updated... just about 60 times a second.
Steps to reproduce the issue
Have at least one item in your invewntory
Manually call Player->getNetworkSession()->getInvManager()->requestSyncAll() when a player joins
See your item flicker in your inventory
OS and versions
PocketMine-MP: 5.10.0
PHP: 8.1.24
Using JIT: no
Server OS: Linux
Game version: Win10
Plugins
If you remove all plugins, does the issue still occur?: No
If the issue is not reproducible without plugins: Yes
Have you asked for help on our forums before creating an issue?: No
***- Can you provide sample, minimal* reproducing code for the issue? If so, paste it in the bottom section
Crashdump, backtrace or other files
<?php
declare(strict_types=1);
namespace issue;
use pocketmine\event\Listener;
use pocketmine\event\player\PlayerJoinEvent;
use pocketmine\plugin\PluginBase;
class Issue extends PluginBase implements Listener {
protected function onEnable(): void {
$this->getServer()->getPluginManager()->registerEvents($this, $this);
}
public function onPlayerJoin(PlayerJoinEvent $event) {
$player = $event->getPlayer();
$player->getNetworkSession()->getInvManager()->requestSyncAll();
}
}
Issue description
Steps to reproduce the issue
Player->getNetworkSession()->getInvManager()->requestSyncAll()
when a player joinsOS and versions
Plugins
Crashdump, backtrace or other files