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

Generator nether

Discussion in 'Development' started by MrForter, Sep 11, 2022.

  1. MrForter

    MrForter Creeper

    Messages:
    2
    GitHub:
    Forter6
    how to make in your created world, lighting like in hell?
    PHP:
    <?php

    namespace Forter\oneblock\island\generator;

    use 
    pocketmine\block\Block;
    use 
    pocketmine\level\ChunkManager;
    use 
    pocketmine\level\generator\biome\{ BiomeBiomeSelector };
    use 
    pocketmine\level\generator\Generator;
    use 
    pocketmine\level\generator\object\OreType;
    use 
    pocketmine\level\generator\populator\{ GroundCoverOrePopulator };
    use 
    pocketmine\level\Level;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\utils\Random;

    class 
    NetherGenerator extends Generator{

        protected 
    $level;
        protected 
    $random;


        public function 
    __construct(array $options = []){}

        public function 
    init(ChunkManager $levelRandom $random){
            
    $this->level $level;
            
    $this->random $random;
        }

        public function 
    getSettings(){
            return [];
        }
        
        public function 
    getName(){
            return 
    "ad";
        }

        public function 
    generateChunk($chunkX$chunkZ){
            
    $chunk $this->level->getChunk($chunkX$chunkZ);
            if (
    $chunkX == && $chunkZ == 0$chunk->setBlockId(8127887);
            for(
    $x 0$x 16; ++$x){
                for(
    $z 0$z 16; ++$z){
                    for(
    $y 0$y 128; ++$y){
                        
    $biome Biome::getBiome(Biome::HELL);
                        
    $chunk->setBiomeId($x$z$biome->getId());
                        
    $chunk->setBlockLight($x$y 1$z15);//does not work
                    
    }
                }
            }
            
    $chunk->setGenerated();
        }

        public function 
    populateChunk($chunkX$chunkZ){
            
    $this->random->setSeed(0xdeadbeef ^ ($chunkX << 8) ^ $chunkZ $this->level->getSeed());         
        }
        
        public function 
    getSpawn(): Vector3{
            return new 
    Vector3(264255264);
        }
    }
     
  2. Kostamax-27

    Kostamax-27 Creeper

    Messages:
    2
    GitHub:
    kostamax27
    ChangeDimensionPacket
     
  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.