Jump to content

Recommended Posts

Posted

So, I created a custom dimension (for like the 5th time now, and unlike all my other ones, this one seems to "glitch out". If I log outwhile in this dimension, and then back in, the sky becomes the "ender sky" and the biome turns into becomes ocean biome (the blocks stay the same, just a different tag on the biome. If I leave the dimension and come back, it is all fixed. I can't seem to figure it out.:

 

World Provider:

 

package net.Cutrone.LegoUniverse.dimension;

 

import net.Cutrone.LegoUniverse.common.LegoUniverse;

import net.minecraft.block.Block;

import net.minecraft.util.ChunkCoordinates;

import net.minecraft.util.MathHelper;

import net.minecraft.util.Vec3;

import net.minecraft.world.WorldProvider;

import net.minecraft.world.biome.BiomeGenBase;

 

import net.minecraft.world.chunk.IChunkProvider;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

public class WorldProviderNimbus extends WorldProvider

{

    /**

    * creates a new world chunk manager for WorldProvider

    */

    public void registerWorldChunkManager()

    {

        this.worldChunkMgr = new WorldChunkManagerNimbus(LegoUniverse.BiomeGenForest, 0.5F, 0.0F);

        this.dimensionId = 1;

        this.hasNoSky = false;

    }

    private long j;

   

    /**

    * Returns a new chunk provider which generates chunks for this world

    */

    public IChunkProvider createChunkGenerator()

    {

    j= 7740631;

        return new ChunkProviderNimbus(this.worldObj, j, false);

    }

 

    /**

    * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)

    */

    public float calculateCelestialAngle(long par1, float par3)

    {

        return 0.0F;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Returns array with sunrise/sunset colors

    */

    public float[] calcSunriseSunsetColors(float par1, float par2)

    {

        return null;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Return Vec3D with biome specific fog color

    */

    public Vec3 getFogColor(float par1, float par2)

    {

        int i = 10518688;

        float f2 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;

 

        if (f2 < 0.0F)

        {

            f2 = 0.0F;

        }

 

        if (f2 > 1.0F)

        {

            f2 = 1.0F;

        }

 

        float f3 = (float)(i >> 16 & 255) / 255.0F;

        float f4 = (float)(i >> 8 & 255) / 255.0F;

        float f5 = (float)(i & 255) / 255.0F;

        f3 *= f2 * 0.0F + 0.15F;

        f4 *= f2 * 0.0F + 0.15F;

        f5 *= f2 * 0.0F + 0.15F;

        return this.worldObj.getWorldVec3Pool().getVecFromPool((double)f3, (double)f4, (double)f5);

    }

 

    @SideOnly(Side.CLIENT)

    public boolean isSkyColored()

    {

        return true;

    }

 

    /**

    * True if the player can respawn in this dimension (true = overworld, false = nether).

    */

    public boolean canRespawnHere()

    {

        return false;

    }

 

    /**

    * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.

    */

    public boolean isSurfaceWorld()

    {

        return true;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * the y level at which clouds are rendered.

    */

    public float getCloudHeight()

    {

        return 8.0F;

    }

 

    /**

    * Will check if the x, z position specified is alright to be set as the map spawn point

    */

    public boolean canCoordinateBeSpawn(int par1, int par2)

    {

        int k = this.worldObj.getFirstUncoveredBlock(par1, par2);

        return k == 0 ? false : Block.blocksList[k].blockMaterial.blocksMovement();

    }

 

    /**

    * Gets the hard-coded portal location to use when entering this dimension.

    */

    public ChunkCoordinates getEntrancePortalLocation()

    {

        return new ChunkCoordinates(100, 50, 0);

    }

 

    public int getAverageGroundLevel()

    {

        return 50;

    }

 

    @SideOnly(Side.CLIENT)

 

    /**

    * Returns true if the given X,Z coordinate should show environmental fog.

    */

    public boolean doesXZShowFog(int par1, int par2)

    {

        return true;

    }

 

    /**

    * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".

    */

    public String getDimensionName()

    {

        return "The Nimbus Station";

    }

}

 

 

Chunk Provider:

 

package net.Cutrone.LegoUniverse.dimension;

 

import java.util.List;

import java.util.Random;

 

import net.Cutrone.LegoUniverse.common.LegoUniverseBlocks;

import net.minecraft.block.Block;

import net.minecraft.block.BlockSand;

import net.minecraft.client.main.Main;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.util.IProgressUpdate;

import net.minecraft.util.MathHelper;

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.MapGenBase;

 

import net.minecraft.world.gen.MapGenRavine;

import net.minecraft.world.gen.NoiseGeneratorOctaves;

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

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

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

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

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

import net.minecraftforge.common.MinecraftForge;

import net.minecraftforge.event.Event.Result;

import net.minecraftforge.event.terraingen.ChunkProviderEvent;

import net.minecraftforge.event.terraingen.PopulateChunkEvent;

import net.minecraftforge.event.terraingen.TerrainGen;

 

public class ChunkProviderNimbus implements IChunkProvider

{

private Random rand;

private NoiseGeneratorOctaves noiseGen1;

private NoiseGeneratorOctaves noiseGen2;

private NoiseGeneratorOctaves noiseGen3;

private NoiseGeneratorOctaves noiseGen4;

public NoiseGeneratorOctaves noiseGen5;

public NoiseGeneratorOctaves noiseGen6;

public NoiseGeneratorOctaves mobSpawnerNoise;

private World worldObj;

private final boolean mapFeaturesEnabled;

private double[] noiseArray;

private double[] stoneNoise = new double[256];

private MapGenBase caveGenerator = new MapGenCavesNimbus();

private MapGenStronghold strongholdGenerator = new MapGenStronghold();

private MapGenVillage villageGenerator = new MapGenVillage();

private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();

private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();

private MapGenBase ravineGenerator = new MapGenRavinesNimbus();

private BiomeGenBase[] biomesForGeneration;

double[] noiseData1;

double[] noiseData2;

double[] noiseData3;

double[] noiseData4;

double[] noiseData5;

float[] parabolicField;

int[][] field_73219_j = new int[32][32];

private double[] densities;

 

public ChunkProviderNimbus(World par1World, long par2, boolean par4) {

    this.worldObj = par1World;

    this.rand = new Random(par2);

    this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);

    this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16);

    this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8);

    this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 10);

    this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 16);

    this.mapFeaturesEnabled = par4;

   

    NoiseGeneratorOctaves[] noiseGens = {noiseGen1, noiseGen2, noiseGen3, noiseGen4, noiseGen5};

    noiseGens = TerrainGen.getModdedNoiseGenerators(par1World, this.rand, noiseGens);

    this.noiseGen1 = noiseGens[0];

    this.noiseGen2 = noiseGens[1];

    this.noiseGen3 = noiseGens[2];

    this.noiseGen4 = noiseGens[3];

    this.noiseGen5 = noiseGens[4];

}

/**

* Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the

* temperature is low enough

*/

public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)

{

  byte b0 = 2;

    int k = b0 + 1;

    byte b1 = 33;

    int l = b0 + 1;

    this.densities = this.initializeNoiseField(this.densities, par1 * b0, 0, par2 * b0, k, b1, l);

 

    for (int i1 = 0; i1 < b0; ++i1)

    {

        for (int j1 = 0; j1 < b0; ++j1)

        {

            for (int k1 = 0; k1 < 32; ++k1)

            {

                double d0 = 0.25D;

                double d1 = this.densities[((i1 + 0) * l + j1 + 0) * b1 + k1 + 0];

                double d2 = this.densities[((i1 + 0) * l + j1 + 1) * b1 + k1 + 0];

                double d3 = this.densities[((i1 + 1) * l + j1 + 0) * b1 + k1 + 0];

                double d4 = this.densities[((i1 + 1) * l + j1 + 1) * b1 + k1 + 0];

                double d5 = (this.densities[((i1 + 0) * l + j1 + 0) * b1 + k1 + 1] - d1) * d0;

                double d6 = (this.densities[((i1 + 0) * l + j1 + 1) * b1 + k1 + 1] - d2) * d0;

                double d7 = (this.densities[((i1 + 1) * l + j1 + 0) * b1 + k1 + 1] - d3) * d0;

                double d8 = (this.densities[((i1 + 1) * l + j1 + 1) * b1 + k1 + 1] - d4) * d0;

 

                for (int l1 = 0; l1 < 4; ++l1)

                {

                    double d9 = 0.125D;

                    double d10 = d1;

                    double d11 = d2;

                    double d12 = (d3 - d1) * d9;

                    double d13 = (d4 - d2) * d9;

 

                    for (int i2 = 0; i2 < 8; ++i2)

                    {

                        int j2 = i2 + i1 * 8 << 11 | 0 + j1 * 8 << 7 | k1 * 4 + l1;

                        short short1 = 128;

                        double d14 = 0.125D;

                        double d15 = d10;

                        double d16 = (d11 - d10) * d14;

 

                        for (int k2 = 0; k2 < 8; ++k2)

                        {

                            int l2 = 0;

 

                            if (d15 > 0.0D)

                            {

                                l2 = LegoUniverseBlocks.Asteroid.blockID;

                            }

 

                            par3ArrayOfByte[j2] = (byte)l2;

                            j2 += short1;

                            d15 += d16;

                        }

 

                        d10 += d12;

                        d11 += d13;

                    }

 

                    d1 += d5;

                    d2 += d6;

                    d3 += d7;

                    d4 += d8;

                }

            }

        }

    }

 

}

 

private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7)

{

    ChunkProviderEvent.InitNoiseField event = new ChunkProviderEvent.InitNoiseField(this, par1ArrayOfDouble, par2, par3, par4, par5, par6, par7);

    MinecraftForge.EVENT_BUS.post(event);

    if (event.getResult() == Result.DENY) return event.noisefield;

 

    if (par1ArrayOfDouble == null)

    {

        par1ArrayOfDouble = new double[par5 * par6 * par7];

    }

 

    double d0 = 684.412D;

    double d1 = 684.412D;

    this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);

    this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);

    d0 *= 2.0D;

    this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, d0 / 80.0D, d1 / 160.0D, d0 / 80.0D);

    this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, d0, d1, d0);

    this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, d0, d1, d0);

    int k1 = 0;

    int l1 = 0;

 

    for (int i2 = 0; i2 < par5; ++i2)

    {

        for (int j2 = 0; j2 < par7; ++j2)

        {

            double d2 = (this.noiseData4[l1] + 256.0D) / 512.0D;

 

            if (d2 > 1.0D)

            {

                d2 = 1.0D;

            }

 

            double d3 = this.noiseData5[l1] / 8000.0D;

 

            if (d3 < 0.0D)

            {

                d3 = -d3 * 0.3D;

            }

 

            d3 = d3 * 3.0D - 2.0D;

            float f = (float)(i2 + par2 - 0) / 1.0F;

            float f1 = (float)(j2 + par4 - 0) / 1.0F;

            float f2 = 100.0F - MathHelper.sqrt_float(f * f + f1 * f1) * 8.0F;

 

            if (f2 > 80.0F)

            {

                f2 = 80.0F;

            }

 

            if (f2 < -100.0F)

            {

                f2 = -100.0F;

            }

 

            if (d3 > 1.0D)

            {

                d3 = 1.0D;

            }

 

            d3 /= 8.0D;

            d3 = 0.0D;

 

            if (d2 < 0.0D)

            {

                d2 = 0.0D;

            }

 

            d2 += 0.5D;

            d3 = d3 * (double)par6 / 16.0D;

            ++l1;

            double d4 = (double)par6 / 2.0D;

 

            for (int k2 = 0; k2 < par6; ++k2)

            {

                double d5 = 0.0D;

                double d6 = ((double)k2 - d4) * 8.0D / d2;

 

                if (d6 < 0.0D)

                {

                    d6 *= -1.0D;

                }

 

                double d7 = this.noiseData2[k1] / 512.0D;

                double d8 = this.noiseData3[k1] / 512.0D;

                double d9 = (this.noiseData1[k1] / 10.0D + 1.0D) / 2.0D;

 

                if (d9 < 0.0D)

                {

                    d5 = d7;

                }

                else if (d9 > 1.0D)

                {

                    d5 = d8;

                }

                else

                {

                    d5 = d7 + (d8 - d7) * d9;

                }

 

                d5 -= 8.0D;

                d5 += (double)f2;

                byte b0 = 2;

                double d10;

 

                if (k2 > par6 / 2 - b0)

                {

                    d10 = (double)((float)(k2 - (par6 / 2 - b0)) / 64.0F);

 

                    if (d10 < 0.0D)

                    {

                        d10 = 0.0D;

                    }

 

                    if (d10 > 1.0D)

                    {

                        d10 = 1.0D;

                    }

 

                    d5 = d5 * (1.0D - d10) + -3000.0D * d10;

                }

 

                b0 = 8;

 

                if (k2 < b0)

                {

                    d10 = (double)((float)(b0 - k2) / ((float)b0 - 1.0F));

                    d5 = d5 * (1.0D - d10) + -30.0D * d10;

                }

 

                par1ArrayOfDouble[k1] = d5;

                ++k1;

            }

        }

    }

 

    return par1ArrayOfDouble;

}

 

public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)

{

byte var5 = 63;

double var6 = 0.03125D;

this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);

for (int var8 = 0; var8 < 16; var8++)

{

for (int var9 = 0; var9 < 16; var9++)

{

BiomeGenBase var10 = par4ArrayOfBiomeGenBase[(var9 + var8 * 16)];

float var11 = var10.getFloatTemperature();

int var12 = (int)(this.stoneNoise[(var8 + var9 * 16)] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);

int var13 = -1;

byte var14 = var10.topBlock;

byte var15 = var10.fillerBlock;

for (int var16 = 127; var16 >= 0; var16--)

{

        int var17 = (var9 * 16 + var8) * 128 + var16;

        if (var16 <= 0 + this.rand.nextInt(5))

        {

        par3ArrayOfByte[var17] = ((byte)0);

        }

        else

        {

        byte var18 = par3ArrayOfByte[var17];

        if (var18 == 0)

        {

        var13 = -1;

        }

        /** Main filler block fill's all the underground, replaces block stone **/

        else if (var18 != 253)

        {

        if (var13 == -1)

        {

        if (var12 == 0)

        {

                var14 = (byte)Block.grass.blockID;

               

                /** change to custom dirt **/

                var15 = (byte)LegoUniverseBlocks.Asteroid.blockID;//

        }

        else if ((var16 >= var5 - 4) && (var16 <= var5 + 1))

        {

                var14 = (byte)Block.grass.blockID;

                var15 = (byte)LegoUniverseBlocks.Asteroid.blockID;

        }

        if ((var16 < var5) && (var14 == 0))

        {

                if (var11 < 0.15F)

                {

                var14 = (byte)Block.ice.blockID;

                }

                else

                {

                var14 = (byte)Block.waterStill.blockID;

                }

        }

        var13 = var12;

        if (var16 >= var5 - 1)

        {

                par3ArrayOfByte[var17] = var14;

        }

        else

        {

                par3ArrayOfByte[var17] = var15;

        }

        }

        else if (var13 > 0)

        {

        var13--;

        par3ArrayOfByte[var17] = var15;

        if ((var13 == 0) && (var15 == Block.sand.blockID))

        {

                var13 = this.rand.nextInt(4);

                var15 = (byte)Block.sandStone.blockID;

        }

        }

        }

        }

}

}

}

}

public Chunk loadChunk(int par1, int par2)

{

return provideChunk(par1, par2);

}

public Chunk provideChunk(int par1, int par2)

{

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

byte[] var3 = new byte[32768];

generateTerrain(par1, par2, var3);

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

replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration);

this.caveGenerator.generate(this, this.worldObj, par1, par2, var3);

this.ravineGenerator.generate(this, this.worldObj, par1, par2, var3);

if (this.mapFeaturesEnabled)

{

this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, var3);

this.villageGenerator.generate(this, this.worldObj, par1, par2, var3);

this.strongholdGenerator.generate(this, this.worldObj, par1, par2, var3);

this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, var3);

}

Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);

byte[] var5 = var4.getBiomeArray();

for (int var6 = 0; var6 < var5.length; var6++)

{

var5[var6] = ((byte)this.biomesForGeneration[var6].biomeID);

}

var4.generateSkylightMap();

return var4;

}

 

public boolean chunkExists(int par1, int par2)

{

return true;

}

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

{

    BlockSand.fallInstantly = true;

 

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

 

    int k = par2 * 16;

    int l = par3 * 16;

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

   

    WorldGeneratorNimbus n = new WorldGeneratorNimbus();

    n.generate(worldObj, rand, par2/16, 6, par3/16);

 

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

 

    BlockSand.fallInstantly = false;

}

public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate)

{

return true;

}

public boolean unload100OldestChunks()

{

return false;

}

public boolean canSave()

{

return true;

}

public String makeString()

{

return "RandomLevelSource";

}

public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)

{

BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4);

return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType);

}

public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5)

{

return ("Stronghold".equals(par2Str)) && (this.strongholdGenerator != null) ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null;

}

public int getLoadedChunkCount() {

return 0;

}

public boolean unloadQueuedChunks()

{

return false;

}

 

@Override

public void saveExtraData(){

 

}

@Override

public void recreateStructures(int i, int j) {

  // TODO Auto-generated method stub

 

}

 

}

 

 

World Chunk Manager:

 

package net.Cutrone.LegoUniverse.dimension;

 

import java.util.Arrays;

import java.util.List;

import java.util.Random;

 

import net.minecraft.world.ChunkPosition;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.biome.WorldChunkManager;

 

public class WorldChunkManagerNimbus extends WorldChunkManager

{

    /** this is the sole biome to utilize for this world */

    private BiomeGenBase biomeToUse;

    private float temp;

 

    /** The rainfall in the world */

    private float rainfall;

 

    public WorldChunkManagerNimbus(BiomeGenBase par1BiomeGenBase, float par2, float par3)

    {

        this.biomeToUse = par1BiomeGenBase;

        this.temp = par2;

        this.rainfall = par3;

    }

 

    /**

    * Returns the BiomeGenBase related to the x, z position on the world.

    */

    public BiomeGenBase getBiomeGenAt(int par1, int par2)

    {

        return this.biomeToUse;

    }

 

    /**

    * Returns an array of biomes for the location input.

    */

    public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)

    {

        if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)

        {

            par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];

        }

 

        Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse);

        return par1ArrayOfBiomeGenBase;

    }

 

    /**

    * Returns a list of temperatures to use for the specified blocks.  Args: listToReuse, x, y, width, length

    */

    public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)

    {

        if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)

        {

            par1ArrayOfFloat = new float[par4 * par5];

        }

 

        Arrays.fill(par1ArrayOfFloat, 0, par4 * par5, this.temp);

        return par1ArrayOfFloat;

    }

 

    /**

    * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length.

    */

    public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)

    {

        if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)

        {

            par1ArrayOfFloat = new float[par4 * par5];

        }

 

        Arrays.fill(par1ArrayOfFloat, 0, par4 * par5, this.rainfall);

        return par1ArrayOfFloat;

    }

 

    /**

    * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the

    * WorldChunkManager Args: oldBiomeList, x, z, width, depth

    */

    public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)

    {

        if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)

        {

            par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];

        }

 

        Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse);

        return par1ArrayOfBiomeGenBase;

    }

 

    /**

    * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,

    * don't check biomeCache to avoid infinite loop in BiomeCacheBlock)

    */

    public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6)

    {

        return this.loadBlockGeneratorData(par1ArrayOfBiomeGenBase, par2, par3, par4, par5);

    }

 

    /**

    * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks.

    * Strongly favors positive y positions.

    */

    public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)

    {

        return par4List.contains(this.biomeToUse) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null;

    }

 

    /**

    * checks given Chunk's Biomes against List of allowed ones

    */

    public boolean areBiomesViable(int par1, int par2, int par3, List par4List)

    {

        return par4List.contains(this.biomeToUse);

    }

}

 

 

 

 

 

Any help would be awesome right now. I just can't figure it out. :(

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.