net.minecraft.world.gen.NoiseGeneratorOctaves Java Examples

The following examples show how to use net.minecraft.world.gen.NoiseGeneratorOctaves. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MoCChunkProviderWyvernLair.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public MoCChunkProviderWyvernLair(World par1World, long par2)
 {
     this.worldObj = par1World;
     this.RNGa = new Random(par2);
     this.noiseGen1 = new NoiseGeneratorOctaves(this.RNGa, 16);
     this.noiseGen2 = new NoiseGeneratorOctaves(this.RNGa, 16);
     this.noiseGen3 = new NoiseGeneratorOctaves(this.RNGa, 8);
     this.noiseGen4 = new NoiseGeneratorOctaves(this.RNGa, 10);
     this.noiseGen5 = new NoiseGeneratorOctaves(this.RNGa, 16);

     NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5};
     noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.RNGa, noiseGens);
     this.noiseGen1 = noiseGens[0];
     this.noiseGen2 = noiseGens[1];
     this.noiseGen3 = noiseGens[2];
     this.noiseGen4 = noiseGens[3];
     this.noiseGen5 = noiseGens[4];
}
 
Example #2
Source File: ChunkProviderTofu.java    From TofuCraftReload with MIT License 5 votes vote down vote up
public ChunkProviderTofu(World worldIn, long seed) {
    {
    	if(net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(villageGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE) instanceof MapGenTofuVillage)
        villageGenerator = (MapGenTofuVillage) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(villageGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.VILLAGE);
    	if(net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(mineshaft, InitMapGenEvent.EventType.CUSTOM) instanceof MapGenTofuMineshaft)
    	mineshaft = (MapGenTofuMineshaft) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(mineshaft, InitMapGenEvent.EventType.CUSTOM);
        if (net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(tofuCastle, InitMapGenEvent.EventType.CUSTOM) instanceof MapGenTofuCastle)
            tofuCastle = (MapGenTofuCastle) net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(tofuCastle, InitMapGenEvent.EventType.CUSTOM);
        caveGenerator = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(caveGenerator, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.CAVE);
        this.mapFeaturesEnabled = worldIn.getWorldInfo().isMapFeaturesEnabled();
    }
    this.world = worldIn;
    this.rand = new Random(seed);
    this.minLimitPerlinNoise = new NoiseGeneratorOctaves(this.rand, 16);
    this.maxLimitPerlinNoise = new NoiseGeneratorOctaves(this.rand, 16);
    this.mainPerlinNoise = new NoiseGeneratorOctaves(this.rand, 8);
    this.noiseGen4 = new NoiseGeneratorOctaves(rand, 4);
    this.depthNoise = new NoiseGeneratorOctaves(rand, 16);
    this.heightMap = new double[825];
    this.biomeWeights = new float[25];
    this.surfaceNoise = new NoiseGeneratorPerlin(this.rand, 4);

    for (int j = -2; j <= 2; ++j) {
        for (int k = -2; k <= 2; ++k) {
            float f = 10.0F / MathHelper.sqrt((float) (j * j + k * k) + 0.2F);

            this.biomeWeights[j + 2 + (k + 2) * 5] = f;
        }
    }
}
 
Example #3
Source File: ChunkGeneratorTorikki.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ChunkGeneratorTorikki(World worldIn) {

		this.world = worldIn;
		this.rand= new Random(world.getSeed());
		this.noise = new NoiseGeneratorPerlin(RandUtil.random,4);
		this.lperlinNoise1 = new NoiseGeneratorOctaves(this.rand, 16);
		this.lperlinNoise2 = new NoiseGeneratorOctaves(this.rand, 16);

	}
 
Example #4
Source File: ChunkProviderCavePlanet.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
public ChunkProviderCavePlanet(World worldIn, boolean p_i45637_2_, long seed, String p_i46668_5_)
{
	super(worldIn, seed, p_i45637_2_, p_i46668_5_);
	this.world = worldIn;
	this.generateStructures = p_i45637_2_;
	this.rand = new Random(seed);
	this.lperlinNoise1 = new NoiseGeneratorOctaves(this.rand, 16);
	this.lperlinNoise2 = new NoiseGeneratorOctaves(this.rand, 16);
	this.perlinNoise1 = new NoiseGeneratorOctaves(this.rand, 8);
	this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.rand, 4);
	this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.rand, 4);
	this.scaleNoise = new NoiseGeneratorOctaves(this.rand, 10);
	this.depthNoise = new NoiseGeneratorOctaves(this.rand, 16);

	DimensionProperties dimProps = DimensionManager.getInstance().getDimensionProperties(worldIn.provider.getDimension());

	worldIn.setSeaLevel(dimProps.getSeaLevel());

	IBlockState oceanBlock = dimProps.getOceanBlock();
	if(oceanBlock != null)
	{
		this.oceanBlock = oceanBlock;
	}
	else
	{
		this.oceanBlock = Blocks.WATER.getDefaultState();
	}

	IBlockState fillBlock = dimProps.getStoneBlock();
	if(fillBlock != null)
	{
		this.fillblock = fillBlock;
	}
	else 
	{
		this.fillblock = Blocks.STONE.getDefaultState();
	}

	net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell ctx =
			new net.minecraftforge.event.terraingen.InitNoiseGensEvent.ContextHell(lperlinNoise1, lperlinNoise2, perlinNoise1, slowsandGravelNoiseGen, netherrackExculsivityNoiseGen, scaleNoise, depthNoise);
	ctx = net.minecraftforge.event.terraingen.TerrainGen.getModdedNoiseGenerators(worldIn, this.rand, ctx);
	this.lperlinNoise1 = ctx.getLPerlin1();
	this.lperlinNoise2 = ctx.getLPerlin2();
	this.perlinNoise1 = ctx.getPerlin();
	this.slowsandGravelNoiseGen = ctx.getPerlin2();
	this.netherrackExculsivityNoiseGen = ctx.getPerlin3();
	this.scaleNoise = ctx.getScale();
	this.depthNoise = ctx.getDepth();
	this.genNetherCaves = net.minecraftforge.event.terraingen.TerrainGen.getModdedMapGen(genNetherCaves, net.minecraftforge.event.terraingen.InitMapGenEvent.EventType.NETHER_CAVE);
	super.heightmapOffset = 0;
	super.heightmapMult *= 1D;
}