Describe the bug
If a player tries to teleport to another world and has a pet, the server will internal and restart
To Reproduce
Steps to reproduce the behavior:
- Add a pet to yourself
- Go to another world
- Crash
Expected behavior
That the pets endure the change of world and follow the player
Screenshots
If applicable, add screenshots to help explain your problem.
SimplePets plugin information
- Version: 1.0.1-beta
- Server api: I don't know, it's the latest version of pocketmine and I have php 7.4
Additional context
23:52:03] [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Server::pocketmine\{closure}() must be an instance of pocketmine\Player, instance of brokiem\simplepets\pets\CatPet given" (EXCEPTION) in "pmsrc/src/pocketmine/Server" at line 1723
[23:52:03] [Server thread/CRITICAL]: #0 (): pocketmine\Server->pocketmine\{closure}(object brokiem\simplepets\pets\CatPet)
[23:52:03] [Server thread/CRITICAL]: #1 pmsrc/src/pocketmine/Server(1723): array_filter(array[1], object Closure)
[23:52:03] [Server thread/CRITICAL]: #2 pmsrc/src/pocketmine/level/Level(538): pocketmine\Server->batchPackets(array[1], array[1], boolean )
[23:52:03] [Server thread/CRITICAL]: #3 plugins/MysteryCrate.phar/src/JackMD/MysteryCrate/EventListener(239): pocketmine\level\Level->addParticle(object pocketmine\level\particle\FloatingTextParticle, array[1])
[23:52:03] [Server thread/CRITICAL]: #4 pmsrc/src/pocketmine/plugin/MethodEventExecutor(42): JackMD\MysteryCrate\EventListener->onLevelChange(object pocketmine\event\entity\EntityLevelChangeEvent)
[23:52:03] [Server thread/CRITICAL]: #5 pmsrc/src/pocketmine/plugin/RegisteredListener(80): pocketmine\plugin\MethodEventExecutor->execute(object JackMD\MysteryCrate\EventListener, object pocketmine\event\entity\EntityLevelChangeEvent)
[23:52:03] [Server thread/CRITICAL]: #6 pmsrc/src/pocketmine/event/Event(88): pocketmine\plugin\RegisteredListener->callEvent(object pocketmine\event\entity\EntityLevelChangeEvent)
[23:52:03] [Server thread/CRITICAL]: #7 pmsrc/src/pocketmine/entity/Entity(1904): pocketmine\event\Event->call()
[23:52:03] [Server thread/CRITICAL]: #8 pmsrc/src/pocketmine/entity/Entity(1769): pocketmine\entity\Entity->switchLevel(object pocketmine\level\Level)
[23:52:03] [Server thread/CRITICAL]: #9 pmsrc/src/pocketmine/entity/Entity(1794): pocketmine\entity\Entity->setPosition(object pocketmine\level\Position)
[23:52:03] [Server thread/CRITICAL]: #10 pmsrc/src/pocketmine/entity/Entity(1885): pocketmine\entity\Entity->setPositionAndRotation(object pocketmine\level\Position, double 145.8123900474, double -1.5042436028662)
[23:52:03] [Server thread/CRITICAL]: #11 plugins/SimplePets_dev-79.phar/src/brokiem/simplepets/pets/base/BasePet(335): pocketmine\entity\Entity->teleport(object pocketmine\level\Position)
[23:52:03] [Server thread/CRITICAL]: #12 pmsrc/src/pocketmine/entity/Entity(1393): brokiem\simplepets\pets\base\BasePet->entityBaseTick(integer 1)
[23:52:03] [Server thread/CRITICAL]: #13 pmsrc/src/pocketmine/level/Level(854): pocketmine\entity\Entity->onUpdate(integer 18940)
[23:52:03] [Server thread/CRITICAL]: #14 pmsrc/src/pocketmine/level/Level(787): pocketmine\level\Level->actuallyDoTick(integer 18940)
[23:52:03] [Server thread/CRITICAL]: #15 pmsrc/src/pocketmine/Server(2265): pocketmine\level\Level->doTick(integer 18940)
[23:52:03] [Server thread/CRITICAL]: #16 pmsrc/src/pocketmine/Server(2396): pocketmine\Server->checkTickUpdates(integer 18940, double 1628639523.1728)
[23:52:03] [Server thread/CRITICAL]: #17 pmsrc/src/pocketmine/Server(2152): pocketmine\Server->tick()
[23:52:03] [Server thread/CRITICAL]: #18 pmsrc/src/pocketmine/Server(1992): pocketmine\Server->tickProcessor()
[23:52:03] [Server thread/CRITICAL]: #19 pmsrc/src/pocketmine/Server(1586): pocketmine\Server->start()
[23:52:03] [Server thread/CRITICAL]: #20 pmsrc/src/pocketmine/PocketMine(311): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[16] /home/container/, string[24] /home/container/plugins/)
[23:52:03] [Server thread/CRITICAL]: #21 pmsrc/src/pocketmine/PocketMine(341): pocketmine\server()
[23:52:03] [Server thread/CRITICAL]: #22 pmsrc(11): require(string[71] phar:///home/container/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
bug unconfirmed