Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Teleporting to another world is slow.

Comments in 'Plugin Development' started by WillotheBlessed, Aug 11, 2015.

  1. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Here is my code for warping to another level:

    $targetLevel = $this->plugin->getServer()->getLevelByName("lobby");
    $targetLevel->setSpawnLocation(new \pocketmine\math\Vector3(-192,65,-1557));
    $p->teleport($targetLevel->getSpawnLocation());

    My issue is that once I arrived... I was in the correct place but it took a long time to load. I was literally standing on air for 30 seconds until I broke a block. At this point, a single chunk loaded. After another minute, all my chunks loaded. All told, this was about 2 minutes!

    How can I speed this process up?
  2. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Wait for PHP 7
  3. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Ok, I'm kind of confused. Does this mean you are also experiencing lag times between worlds? If so, are you experiencing it on the order of 1-2 minutes as I am?

    This does not seem like an issue with PHP, because the game loads fine when I first connect. It's only teleporting between worlds that seem to lag the client considerably.
  4. Gamecrafter
    Offline

    Gamecrafter Notable Member Plugin Developer

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Depends on the server itself. What are you running it on?
  5. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Why would the server matter? I have an I7 here, but it loads fine for an initial loading. It's only when I teleport to another world that the game completely hangs.
  6. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Ok, update on this... I have a hunch the problem is I am teleporting them to a location that is far from 0,0,0 (roughtly -2500, 60, 0)
  7. aliuly
    Offline

    aliuly Notable Member Plugin Developer

    Joined:
    Feb 8, 2014
    Posts:
    1,086
    Plugins:
    17
    Do you always teleport to different far away locations?
  8. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Ok, I have some more info on what is happening... When I teleport to my first world, it is fine. But when I teleport to the second world (a lobby i built from scratch) i flicker between worlds for 2 whole minutes. To make matters worse, this only showed up after I moved my lobbby to 0,0,0. Before it was just blue sky for 2 minutes, but now... it's a flickering of the forest I was previously in and the new lobby, which is just blue sky for a long time... then finally it loads.

    The funny part is... that the game runs on a 5 minute loop and this happens over and over... every time I go to the lobby... it hangs and acts funny. But the first world always loads fine.
  9. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Another update on this issue! I tried downloading EssentialsPE and using the /world command. It does the same thing... gitters from world to world when going from "world to lobby" but not when going from "lobby to world" One teleport takes literally half a second, the other teleport takes 2 minutes!
  10. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    Why set spawn like that? Just teleport and set the spawn in game. Use ManyWorlds to do that.
  11. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Ok, I'll try this tomorrow. Hitting the wall today... this has been a frustrating issue. But other than that, a lot of improvements in Pocketmine since I last used it! Good work, guys!
    Legoboy0215 likes this.
  12. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Another update on this issue, if I switch the Lobby to the first world... it loads after like 2 minutes. So it's obviously something to do with this map conversion process. I built the map in 1.7.10 using world edit. Is there anything I should know about this conversion process?

    Thanks!
  13. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Last edited: Aug 12, 2015

Share This Page

Advertisement