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

Solved World Generator Help

Discussion in 'Development' started by jasonwynn10, Nov 17, 2016.

?

Is it Possible with what is given?

  1. Yes

    50.0%
  2. No

    0 vote(s)
    0.0%
  3. I don't know

    50.0%
  1. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    I have a custom generator that I am planning to use for my Plots server and I have a function that I need to edit to make the generated terrain look like this: http://imgur.com/a/uKiZW
    PHP:
    public function generateChunk($chunkX$chunkZ) {
            
    $shape $this->getShape($chunkX << 4$chunkZ << 4);
            
    $chunk $this->level->getChunk($chunkX$chunkZ);
            
    $chunk->setGenerated();
            
    $c Biome::getBiome(1)->getColor();
            
    $R $c >> 16;
            
    $G = ($c >> 8) & 0xff;
            
    $B $c 0xff;
            
    $bottomBlockId $this->bottomBlock->getId();
            
    $bottomBlockMeta $this->bottomBlock->getDamage();
            
    $plotFillBlockId $this->plotFillBlock->getId();
            
    $plotFillBlockMeta $this->plotFillBlock->getDamage();
            
    $plotFloorBlockId $this->plotFloorBlock->getId();
            
    $plotFloorBlockMeta $this->plotFloorBlock->getDamage();
            
    $roadBlockId $this->roadBlock->getId();
            
    $roadBlockMeta $this->roadBlock->getDamage();
            
    $debugBlockId $this->debugBlock->getId();
            
    $debugBlockMeta $this->debugBlock->getDamage();
            
    $groundHeight $this->groundHeight;
            for (
    $Z 0$Z 16; ++$Z) {
                for (
    $X 0$X 16; ++$X) {
                    
    $chunk->setBiomeId($X$Z1);
                    
    $chunk->setBiomeColor($X$Z$R$G$B);
                    
    $chunk->setBlock($X0$Z$bottomBlockId$bottomBlockMeta);
                    for (
    $Y 1$Y $groundHeight-3; ++$Y) {
                        
    $chunk->setBlock($X$Y$ZBlock::AIR$plotFillBlockMeta);
                    }
                    for (
    $Y $groundHeight-3$Y $groundHeight; ++$Y) {
                        
    $chunk->setBlock($X$Y$Z$plotFillBlockId$plotFillBlockMeta);
                    }
                    
    $type $shape[($Z << 4) | $X];
                    if (
    $type === self::PLOT) {

                        
    $chunk->setBlock($X$groundHeight$Z$plotFloorBlockId$plotFloorBlockMeta);
                    } elseif (
    $type === self::ROAD) {
                        
    $chunk->setBlock($X$groundHeight$Z$roadBlockId$roadBlockMeta);
                    } else {
                        
    //$chunk->setBlock($X, $groundHeight, $Z, $debugBlockId, $debugBlockMeta);
                        
    $chunk->setBlock($X$groundHeight 1$Z$debugBlockId$debugBlockMeta);
                    }
                }
            }
            
    $chunk->setX($chunkX);
            
    $chunk->setZ($chunkZ);
            
    $this->level->setChunk($chunkX$chunkZ$chunk);
        }
    Using the given info in the function, how can I generate the world to look like I want?
     
    SOFe likes this.
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    The image is showing the inside of a chest :p
     
    HimbeersaftLP likes this.
  3. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,402
    GitHub:
    HimbeersaftLP
    It's a gallery, there are more images...
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Ignore my first message :p
     
    HimbeersaftLP likes this.
  5. Magicode

    Magicode Baby Zombie

    Messages:
    183
    GitHub:
    magicode1
    The world generators I have used in Pocketmine are a bit finicky. It may be just me, but I could never get a custom one to work.
     
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    well it works (or used to)
    and aparently resource of custom world generator are quite scares especially well documentation ones so world gen plugin are mostly uncommon
     
    HimbeersaftLP and SOFe like this.
  7. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    This is some code taken from the MyPlot world Generator. If there is anything else that I could be missing to be able to do that I want, please let me know.
     
  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.