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

Solved How to unshow loading screen in 1.2?

Discussion in 'Development' started by Kyd, Oct 3, 2017.

  1. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    I'm sending ChangeDimensionPacket to player correctly, but I have not idea how to unshow it.
    I've tried sending PlayStatusPacket , but player can't move and don't have loaded chunks + is in nether dimension after it:/
     
  2. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  3. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
  4. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Then its either one of there two reasons:
    1. You didn't do it right
    2. it genuinely doesn't work.
     
    jasonwynn10 and EdwardHamHam like this.
  5. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    If I got you right, you are sending the player the packet before teleporting the player to another world? Correct me if I'm wrong.
     
  6. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Yes, is it wrong?
     
  7. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Nope. But it depends when are you sending the packet. Plus, sending the packet after the client has already been sent the same packet will set the client in a loop too.

    Sending the packet during PlayerJoinEvent may put the client in a never-ending "Building Terrain" screen, but sending the packet during PlayerLoginEvent works just fine.

    Make sure you aren't sending the packet twice. Maybe a function...
    PHP:
    public function sendDimensionPacket(Player $playerint $dimension){
        if(
            (!isset(
    $player->dimension) && $dimension === DimensionIds::OVERWORLD) ||
            
    $player->dimension === $dimension
        
    ){
            return;
    //throw new \Error("Attempted to send ChangeDimensionPacket with the dimension the client already is in.");
        
    }
        
    $player->dimension $dimension;
        
    $pk = new ChangeDimensionPacket();
        
    $pk->dimension $dimension;
        
    $pk->position $player;//->asVector3()
        
    $player->dataPacket($pk);
    }

    /** @var Player $player */
    $this->sendDimensionPacket($playerDimensionIds::NETHER);
     
    jasonwynn10 and HBIDamian like this.
  8. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    Solved, thanks
     
  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.