Jump to content

Recommended Posts

Posted

Well, i still have some problems with the world generation.

Nearly everywhere i find these huge chunk cliffs:

ueQW8ae.jpg

(Overworld and custom dimension.)

 

Here is my new Chunk Provider:

 

 

 

package net.dimensionshift.mod.world.dimensions;

 

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.DUNGEON;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.ICE;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAKE;

import static net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType.LAVA;

 

import java.util.List;

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockFalling;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.init.Blocks;

import net.minecraft.util.IProgressUpdate;

import net.minecraft.world.ChunkPosition;

import net.minecraft.world.SpawnerAnimals;

import net.minecraft.world.World;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.chunk.Chunk;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraft.world.gen.ChunkProviderGenerate;

import net.minecraft.world.gen.MapGenBase;

import net.minecraft.world.gen.MapGenCaves;

import net.minecraft.world.gen.NoiseGeneratorOctaves;

import net.minecraft.world.gen.feature.WorldGenDungeons;

import net.minecraft.world.gen.feature.WorldGenLakes;

import net.minecraft.world.gen.structure.MapGenMineshaft;

import net.minecraft.world.gen.structure.MapGenScatteredFeature;

import net.minecraft.world.gen.structure.MapGenStronghold;

import net.minecraft.world.gen.structure.MapGenVillage;

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.event.terraingen.PopulateChunkEvent;

import net.minecraftforge.event.terraingen.TerrainGen;

 

public class ChunkProviderDimenisonShift extends ChunkProviderGenerate{

 

public World worldObj;

private Random rand=new Random();

private NoiseGeneratorOctaves noiseGen1;

private NoiseGeneratorOctaves noiseGen2;

private NoiseGeneratorOctaves noiseGen3;

private NoiseGeneratorOctaves noiseGen4;

public NoiseGeneratorOctaves noiseGen5;

public NoiseGeneratorOctaves noiseGen6;

public NoiseGeneratorOctaves mobSpawnerNoise;

private final boolean mapFeaturesEnabled;

 

/** Holds Cave Generator */

private MapGenBase caveGenerator = new MapGenCaves();

 

 

 

 

/** The biomes that are used to generate the chunk */

private BiomeGenBase[] biomesForGeneration;

 

 

 

public ChunkProviderDimenisonShift(World worldObj, long seed, boolean mapFeatures) {

super(worldObj, seed, mapFeatures);

this.worldObj = worldObj;

this.mapFeaturesEnabled = mapFeatures;

 

 

}

 

@Override

    public Chunk provideChunk(int par1, int par2)

    {

        this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);

        Block[] ablock = new Block[65536];

        byte[] abyte = new byte[65536];

        this.func_147424_a(par1, par2, ablock);

        this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);

        this.replaceBlocksForBiome(par1, par2, ablock, abyte, this.biomesForGeneration);

        this.caveGenerator.func_151539_a(this, this.worldObj, par1, par2, ablock);

 

 

        Chunk chunk = new Chunk(this.worldObj, ablock, abyte, par1, par2);

        byte[] abyte1 = chunk.getBiomeArray();

 

        for (int k = 0; k < abyte1.length; ++k)

        {

            abyte1[k] = (byte)this.biomesForGeneration[k].biomeID;

        }

 

        chunk.generateSkylightMap();

        return chunk;

    } 

   

   

   

    @Override

    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3){

        BlockFalling.fallInstantly = true;

        int k = par2 * 16;

        int l = par3 * 16;

        BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16);

        this.rand.setSeed(this.worldObj.getSeed());

        long i1 = this.rand.nextLong() / 2L * 2L + 1L;

        long j1 = this.rand.nextLong() / 2L * 2L + 1L;

        this.rand.setSeed((long)par2 * i1 + (long)par3 * j1 ^ this.worldObj.getSeed());

        boolean flag = false;

 

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre(par1IChunkProvider, worldObj, rand, par2, par3, flag));

 

 

        int k1;

        int l1;

        int i2;

       

       

        /*water in oasen/maybe used in later versions

        *

        if (biomegenbase != BiomeGenBase.desert =BIOMEDSWOODS && !flag && this.rand.nextInt(4) == 0

            && TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, LAKE))

        {

            k1 = k + this.rand.nextInt(16) + 8;

            l1 = this.rand.nextInt(256);

            i2 = l + this.rand.nextInt(16) + 8;

            (new WorldGenLakes(Blocks.water)).generate(this.worldObj, this.rand, k1, l1, i2);

        }

        */

 

 

        boolean doGen = TerrainGen.populate(par1IChunkProvider, worldObj, rand, par2, par3, flag, DUNGEON);

        for (k1 = 0; doGen && k1 < 8; ++k1)

        {

            l1 = k + this.rand.nextInt(16) + 8;

            i2 = this.rand.nextInt(256);

            int j2 = l + this.rand.nextInt(16) + 8;

            (new WorldGenDungeons()).generate(this.worldObj, this.rand, l1, i2, j2);

        }

 

        //biomegenbase.decorate(this.worldObj, this.rand, k, l);

 

        k += 8;

        l += 8;

 

       

        MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post(par1IChunkProvider, worldObj, rand, par2, par3, flag));

 

        BlockFalling.fallInstantly = false;

    }

   

    @Override

    public void recreateStructures(int par1, int par2){

 

    }

}

 

 

 

 

May I ask you to send me whole code for your dimension. Could you upload it to the mediafire or github? If you did so, I would be really grateful since you will really help me. Things have changed from 1.6.4 to the 1.7.2 in a great deal.

 

Thank you!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.