1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

[SOLVED] How to unshow ChangeDimensionPacket?

Discussion in 'Development' started by Muqsit, Mar 8, 2017.

  1. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    It's easy to send a client the ChangeDimensionPacket, but how do you unsend it? I mean, how do you remove the loading screen shown during ChangeDimensionPacket after sending the packet? The client is basically stuck on the loading screen once you've sent the packet to them.
     
    jasonwynn10 and kaliiks like this.
  2. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    It's waiting for chunks. It should disappear
     
    jasonwynn10 likes this.
  3. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    But it never does, for some reason. I've tried to teleport the player:
    • 100 blocks away from the initial position.
    • Same position.
    None of them worked. I thought it might be a network problem, but I have no problem in loading chunks. I've restarted by system, yet the issue still exists.
     
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Patience is a virtue, and teleporting the player further away only makes it take longer to load.
     
    Muqsit likes this.
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Oh my god :D
     
  6. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    You need to send a PlayStatusPacket to spawn the player, the same as how the initial spawn sequence is completed.
     
  7. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Thank you <3
     
  8. #A6543

    #A6543 Zombie

    Messages:
    267
    If I use the ChangeDimensionPacket the player sometimes cant move
     
  9. dktapps

    dktapps Administrator Staff Member PMMP Team

    Messages:
    774
    GitHub:
    dktapps
    You cannot change a player's dimension to a dimension they are already in. The game isn't designed for this, it will cause bugs. You need to send them to a different dimension, then back to the target.
     
  10. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    You can use TransferPacket if you want to move the player to the same dimension. Kinda hacky.
     
  11. kaliiks

    kaliiks Zombie

    Messages:
    250
    Look it i changed player dimension to nether then back to overworld and look what is it doing
    upload_2017-3-10_13-6-12.png
    Here is code
    PHP:
    $pk2 = new ChangeDimensionPacket();
    $pk2->dimension 1;
    $pk2->$p->getX();
    $pk2->$p->getY();
    $pk2->$p->getZ();
    $p->dataPacket($pk2);
    $pk2 = new ChangeDimensionPacket();
    $pk2->dimension 0;
    $pk2->$p->getX();
    $pk2->$p->getY() ;
    $pk2->$p->getZ();
    $p->dataPacket($pk2);
    $pk = new PlayStatusPacket();
    $pk->status 3;
    $p->dataPacket($pk);
     
    Last edited: Mar 9, 2017
  12. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    change
    PHP:
    $pk2->$p->getX();
    $pk2->$p->getY();
    $pk2->$p->getZ();
    to
    PHP:
    $pk2->$p->getX();
    $pk2->$p->getY();
    $pk2->$p->getZ();
    And i think you need to delay between packets
     
    AkmalFairuz likes this.
  13. #A6543

    #A6543 Zombie

    Messages:
    267
    How?
     
  14. kaliiks

    kaliiks Zombie

    Messages:
    250
    Task?
     
  15. #A6543

    #A6543 Zombie

    Messages:
    267
    Isn't there a better way? I only want the loading screen
     
  16. kaliiks

    kaliiks Zombie

    Messages:
    250
    while function
     
  17. #A6543

    #A6543 Zombie

    Messages:
    267
    What do u mean?
     
  18. kaliiks

    kaliiks Zombie

    Messages:
    250
  19. #A6543

    #A6543 Zombie

    Messages:
    267
  20. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    jasonwynn10 likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.