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

Create empty chunk problem

Discussion in 'Development' started by gistrec, Aug 8, 2017.

  1. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    Hi all, I would like to create empty chunk (or filled air) but my code create only region without chunk :c

    PHP:
        public function generateIsland($level) {
            
    $startX 100;
            
    $startZ 100;
            
    // I try to create 8x8 empty chunks
            
    $emptySubChunk array_fill(016, new EmptySubChunk());
            
    $biomeIds implode(''array_fill(0256'1'));
            
    $heightMap array_fill(0256256);
            for (
    $x = -4$x 4$x++) {
                for (
    $z = -4$z 4$z++) {
                    
    $chunk = new Chunk($startX $x$startZ $z$emptySubChunk, [], [], $biomeIds$heightMap, []);
                    
    //$level->setChunk($startX + $x, $startZ + $z, $chunk);
                    
    $level->getProvider()->setChunk($startX $x$startZ $z$chunk);
                }
            }
            print 
    'Generation complete' PHP_EOL;
        }
     
  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.