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

[Solved] Switch chunk when player teleport

Discussion in 'Development' started by gistrec, Jan 27, 2017.

  1. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    I have 2 level with different chunk
    When I try teleport player between level's, i have this:
    [​IMG]
    Snow block's from other level
    May be I must send empty chunk before teleportation?
     
  2. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
  3. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    Solution: teleport player far away from target, teleport player to target :)
    PHP:
    $player->teleportImmediate(new Vector3(999999999));
    $player->teleport(new Position($x$y$z$level));
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    remember the 999,999,999 may have blocks
     
    gistrec likes this.
  5. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    I have minigame server, and on 600+ x,y I don't have any chunk :c
    And when we teleport immediate and after that teleport, i think server don't sand chunk on 999,y,999 :)
     
  6. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    this issue should've been resolved in latest PM. Also, mcpe 1.1.0 is very likely to get this fixed.
     
    gistrec likes this.
  7. imYannic

    imYannic Baby Zombie

    Messages:
    113
    Maybe this will be a better fix:
    PHP:
    protected function forceSendEmptyChunks(){
            
    $chunkX $pl->getX() >> 4;
            
    $chunkZ $pl->getZ() >> 4;
          
            for (
    $x = -3$x 3; ++$x){
                for (
    $z = -3$z 3; ++$z){
                    
    $pk = new FullChunkDataPacket();
                    
    $pk->chunkX $chunkX $x;
                    
    $pk->chunkZ $chunkZ $z;
                    
    $pk->data '';
                    
    $pl->dataPacket($pk);
                }
            }
        }
    It's from Synapse.
     
    gistrec likes this.
  8. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    No, this is mcpe bug :c
    https://bugs.mojang.com/browse/MCPE-19818
     
  9. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    Does it help to send a changeDimensionPacket?
     
    gistrec likes this.
  10. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    May be, but sky will be red :c
     
  11. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    re change back to overworld?
     
  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.