Jump to content

Spawning Multiple Biomes in Custom Dimension (NullPointer Error)


headchopperz

Recommended Posts

Hi, ive spent the past two days trying to get multiple biomes to work on a custom dimension, and i think im pretty much there but i keep getting these NullPointer Errors when the code runs "this.provider.worldChunkMgr.cleanupCache();", in Wordserver.java.

 

Sorry if its a bit much to read, but i really need help wit this, im stumped.

 

Thanks.

 

INIT Code:

 

public static int DimID = 2;

...

DimensionManager.registerProviderType(DimID, Pokemob_WorldProvider.class, false);

DimensionManager.registerDimension(DimID, DimID);

 

Here are my files:

 

Pokemob_ChunkProvider.java

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import java.util.List;
import java.util.Random;
import mods.pokemob.common.Biomes.Pokemob_BiomeGenBase;
import net.minecraft.block.Block;
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.chunk.Chunk;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.MapGenBase;
import net.minecraft.world.gen.MapGenCaves;
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;

public class Pokemob_ChunkProvider 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 MapGenCaves();
    private MapGenStronghold strongholdGenerator = new MapGenStronghold();
    private MapGenVillage villageGenerator = new MapGenVillage();
    private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft();
    private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature();
    private MapGenBase ravineGenerator = new MapGenRavine();
    private Pokemob_BiomeGenBase[] biomesForGeneration;
    double[] noise3;
    double[] noise1;
    double[] noise2;
    double[] noise5;
    double[] noise6;
    float[] parabolicField;
    int[][] field_73219_j = new int[32][32];

    public Pokemob_ChunkProvider(World par1World, long par2, boolean par4) {
        this.worldObj = par1World;
        this.mapFeaturesEnabled = par4;
        this.rand = new Random(par2);
        this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16);
        this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 6);
        this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, ;
        this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4);
        this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10);
        this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16);
        this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, ;
    }

    /**
     * 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 = 4;
        byte b1 = 16;
        byte b2 = 36; //Deepest point of land, where land becomes caves etc
        int k = b0 + 1;
        byte b3 = 17;
        int l = b0 + 1;
        
        
        
        this.biomesForGeneration = (Pokemob_BiomeGenBase[]) Pokemob_WorldProvider.getProviderForDimension(2).worldChunkMgr.getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, k + 5, l + 5);
        this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * b0, 0, par2 * b0, k, b3, l);
        for (int i1 = 0; i1 < b0; ++i1) {
            for (int j1 = 0; j1 < b0; ++j1) {
                for (int k1 = 0; k1 < b1; ++k1) {
                    double d0 = 0.125D;
                    double d1 = this.noiseArray[((i1 + 0) * l + j1 + 0) * b3 + k1 + 0];
                    double d2 = this.noiseArray[((i1 + 0) * l + j1 + 1) * b3 + k1 + 0];
                    double d3 = this.noiseArray[((i1 + 1) * l + j1 + 0) * b3 + k1 + 0];
                    double d4 = this.noiseArray[((i1 + 1) * l + j1 + 1) * b3 + k1 + 0];
                    double d5 = (this.noiseArray[((i1 + 0) * l + j1 + 0) * b3 + k1 + 1] - d1) * d0;
                    double d6 = (this.noiseArray[((i1 + 0) * l + j1 + 1) * b3 + k1 + 1] - d2) * d0;
                    double d7 = (this.noiseArray[((i1 + 1) * l + j1 + 0) * b3 + k1 + 1] - d3) * d0;
                    double d8 = (this.noiseArray[((i1 + 1) * l + j1 + 1) * b3 + k1 + 1] - d4) * d0;
                    for (int l1 = 0; l1 < 8; ++l1) {
                        double d9 = 0.25D;
                        double d10 = d1;
                        double d11 = d2;
                        double d12 = (d3 - d1) * d9;
                        double d13 = (d4 - d2) * d9;
                        for (int i2 = 0; i2 < 4; ++i2) {
                            int j2 = i2 + i1 * 4 << 11 | 0 + j1 * 4 << 7 | k1 * 8 + l1;
                            short short1 = 128;
                            j2 -= short1;
                            double d14 = 0.25D;
                            double d15 = (d11 - d10) * d14;
                            double d16 = d10 - d15;
                            for (int k2 = 0; k2 < 4; ++k2) {
                                if ((d16 += d15) > 0.0D) {
                                    /**
                                     * Main filler block fill's all the
                                     * underground, replaces block stone *
                                     */
                                    par3ArrayOfByte[j2 += short1] = (byte) Block.stone.blockID;//
                                } else if (k1 * 8 + l1 < b2) {
                                    par3ArrayOfByte[j2 += short1] = (byte) Block.waterStill.blockID;
                                } else {
                                    par3ArrayOfByte[j2 += short1] = 0;
                                }
                            }
                            d10 += d12;
                            d11 += d13;
                        }
                        d1 += d5;
                        d2 += d6;
                        d3 += d7;
                        d4 += d8;
                    }
                }
            }
        }
    }

    public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, Pokemob_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++) {
                Pokemob_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) Block.bedrock.blockID);
                    } else {
                        byte var18 = par3ArrayOfByte[var17];
                        if (var18 == 0) {
                            var13 = -1;
                        } /**
                         * Main filler block fill's all the underground,
                         * replaces block stone *
                         */
                        else if (var18 != Block.cobblestoneMossy.blockID) {
                            if (var13 == -1) {
                                if (var12 == 0) {
                                    var14 = 0;

                                    /**
                                     * change to custom dirt *
                                     */
                                    var15 = (byte) Block.dirt.blockID;//
                                } else if ((var16 >= var5 - 4) && (var16 <= var5 + 1)) {
                                    var14 = var10.topBlock;
                                    var15 = var10.fillerBlock;
                                }
                                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 = (Pokemob_BiomeGenBase[]) Pokemob_WorldProvider.getProviderForDimension(2).worldChunkMgr.getBiomesForGeneration(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;
    }

    private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) {
        if (par1ArrayOfDouble == null) {
            par1ArrayOfDouble = new double[par5 * par6 * par7];
        }
        if (this.parabolicField == null) {
            this.parabolicField = new float[25];
            for (int var8 = -2; var8 <= 2; var8++) {
                for (int var9 = -2; var9 <= 2; var9++) {
                    float var10 = 10.0F / MathHelper.sqrt_float(var8 * var8 + var9 * var9 + 0.2F);
                    this.parabolicField[(var8 + 2 + (var9 + 2) * 5)] = var10;
                }
            }
        }
        double var44 = 684.41200000000003D;
        double var45 = 684.41200000000003D;
        this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D);
        this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D);
        this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D);
        this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44);
        this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44);
        boolean var43 = false;
        boolean var42 = false;
        int var12 = 0;
        int var13 = 0;
        for (int var14 = 0; var14 < par5; var14++) {
            for (int var15 = 0; var15 < par7; var15++) {
                float var16 = 0.0F;
                float var17 = 0.0F;
                float var18 = 0.0F;
                byte var19 = 2;
                Pokemob_BiomeGenBase var20 = this.biomesForGeneration[(var14 + 2 + (var15 + 2) * (par5 + 5))];
                for (int var21 = -var19; var21 <= var19; var21++) {
                    for (int var22 = -var19; var22 <= var19; var22++) {
                        Pokemob_BiomeGenBase var23 = this.biomesForGeneration[(var14 + var21 + 2 + (var15 + var22 + 2) * (par5 + 5))];
                        float var24 = this.parabolicField[(var21 + 2 + (var22 + 2) * 5)] / (var23.minHeight + 2.0F);
                        if (var23.minHeight > var20.minHeight) {
                            var24 /= 2.0F;
                        }
                        var16 += var23.maxHeight * var24;
                        var17 += var23.minHeight * var24;
                        var18 += var24;
                    }
                }
                var16 /= var18;
                var17 /= var18;
                var16 = var16 * 0.9F + 0.1F;
                var17 = (var17 * 4.0F - 1.0F) / 8.0F;
                double var47 = this.noise6[var13] / 8000.0D;
                if (var47 < 0.0D) {
                    var47 = -var47 * 0.3D;
                }
                var47 = var47 * 3.0D - 2.0D;
                if (var47 < 0.0D) {
                    var47 /= 2.0D;
                    if (var47 < -1.0D) {
                        var47 = -1.0D;
                    }
                    var47 /= 1.4D;
                    var47 /= 2.0D;
                } else {
                    if (var47 > 1.0D) {
                        var47 = 1.0D;
                    }
                    var47 /= 8.0D;
                }
                var13++;
                for (int var46 = 0; var46 < par6; var46++) {
                    double var48 = var17;
                    double var26 = var16;
                    var48 += var47 * 0.2D;
                    var48 = var48 * par6 / 16.0D;
                    double var28 = par6 / 2.0D + var48 * 4.0D;
                    double var30 = 0.0D;
                    double var32 = (var46 - var28) * 12.0D * 128.0D / 128.0D / var26;
                    if (var32 < 0.0D) {
                        var32 *= 4.0D;
                    }
                    double var34 = this.noise1[var12] / 512.0D;
                    double var36 = this.noise2[var12] / 512.0D;
                    double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D;
                    if (var38 < 0.0D) {
                        var30 = var34;
                    } else if (var38 > 1.0D) {
                        var30 = var36;
                    } else {
                        var30 = var34 + (var36 - var34) * var38;
                    }
                    var30 -= var32;
                    if (var46 > par6 - 4) {
                        double var40 = (var46 - (par6 - 4)) / 3.0F;
                        var30 = var30 * (1.0D - var40) + -10.0D * var40;
                    }
                    par1ArrayOfDouble[var12] = var30;
                    var12++;
                }
            }
        }
        return par1ArrayOfDouble;
    }

    public boolean chunkExists(int par1, int par2) {
        return true;
    }

    public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {
        net.minecraft.block.BlockSand.fallInstantly = true;
        int var4 = par2 * 16;
        int var5 = par3 * 16;
        Pokemob_BiomeGenBase var6 =(Pokemob_BiomeGenBase) this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16);
        this.rand.setSeed(this.worldObj.getSeed());
        long var7 = this.rand.nextLong() / 2L * 2L + 1L;
        long var9 = this.rand.nextLong() / 2L * 2L + 1L;
        this.rand.setSeed(par2 * var7 + par3 * var9 ^ this.worldObj.getSeed());
        boolean var11 = false;
        if (this.mapFeaturesEnabled) {
            this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
            var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
            this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
            this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3);
        }
        if ((!var11) && (this.rand.nextInt(4) == 0)) {
            int var12 = var4 + this.rand.nextInt(16) + 8;
            int var13 = this.rand.nextInt(128);
            int var14 = var5 + this.rand.nextInt(16) + 8;
            new WorldGenLakes(Block.waterStill.blockID).generate(this.worldObj, this.rand, var12, var13, var14);
        }
        var6.decorate(this.worldObj, this.rand, var4, var5);
        SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand);
        var4 += 8;
        var5 += 8;
        for (int var12 = 0; var12 < 16; var12++) {
            for (int var13 = 0; var13 < 16; var13++) {
                int var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13);
                if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) {
                    this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Block.ice.blockID);
                }
                if (this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) {
                    this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Block.snow.blockID);
                }
            }
        }
        net.minecraft.block.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) {
        Pokemob_BiomeGenBase var5 = (Pokemob_BiomeGenBase) 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;
    }

    public void recreateStructures(int i, int j) {
    }

    @Override
    public void func_104112_b() {
// TODO Auto-generated method stub
    }
}

 

 

 

Pokemob_WorldChunkManager

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import mods.pokemob.common.Biomes.Pokemob_BiomeCache;
import mods.pokemob.common.Biomes.Pokemob_BiomeGenBase;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.IntCache;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.WorldTypeEvent;

import static mods.pokemob.common.Biomes.Pokemob_BiomeGenBase.*;
import net.minecraft.world.biome.BiomeCache;
import net.minecraft.world.biome.WorldChunkManager;

/**
*
* @author dis_c_000
*/
public class Pokemob_WorldChunkManager extends WorldChunkManager
{
    
    public static ArrayList<Pokemob_BiomeGenBase> allowedBiomes = new ArrayList<Pokemob_BiomeGenBase>(Arrays.asList(Pokemob_Hills, Pokemob_ExtremeHills));
    private Pokemob_GenLayer genBiomes;

    /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
    private Pokemob_GenLayer biomeIndexLayer;

    /** The BiomeCache object for this world. */
    private Pokemob_BiomeCache biomeCache;

    /** A list of biomes that the player can spawn in. */
    private List biomesToSpawnIn;

    protected Pokemob_WorldChunkManager()
    {
        this.biomeCache = new Pokemob_BiomeCache(this);
        this.biomesToSpawnIn = new ArrayList();
        this.biomesToSpawnIn.addAll(allowedBiomes);
    }

    public Pokemob_WorldChunkManager(long par1, WorldType par3WorldType)
    {
        this();
        Pokemob_GenLayer[] agenlayer = Pokemob_GenLayer.initializeAllBiomeGenerators(par1, par3WorldType);
        //agenlayer = getModdedBiomeGenerators(par3WorldType, par1, agenlayer);
        this.genBiomes = agenlayer[0];
        this.biomeIndexLayer = agenlayer[1];
    }

    public Pokemob_WorldChunkManager(World par1World)
    {
        this(par1World.getSeed(), par1World.getWorldInfo().getTerrainType());
    }

    /**
     * Gets the list of valid biomes for the player to spawn in.
     */
    public List getBiomesToSpawnIn()
    {
        return this.biomesToSpawnIn;
    }

    /**
     * Returns the BiomeGenBase related to the x, z position on the world.
     */
    public Pokemob_BiomeGenBase getBiomeGenAt(int par1, int par2)
    {
        return this.biomeCache.getBiomeGenAt(par1, par2);
    }

    /**
     * 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)
    {
        IntCache.resetIntCache();

        if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
        {
            par1ArrayOfFloat = new float[par4 * par5];
        }

        int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

        for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            float f = (float)Pokemob_BiomeGenBase.biomeList[aint[i1]].getIntRainfall() / 65536.0F;

            if (f > 1.0F)
            {
                f = 1.0F;
            }

            par1ArrayOfFloat[i1] = f;
        }

        return par1ArrayOfFloat;
    }

    @SideOnly(Side.CLIENT)

    /**
     * Return an adjusted version of a given temperature based on the y height
     */
    public float getTemperatureAtHeight(float par1, int par2)
    {
        return par1;
    }

    /**
     * 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)
    {
        IntCache.resetIntCache();

        if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5)
        {
            par1ArrayOfFloat = new float[par4 * par5];
        }

        int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

        for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            float f = (float)Pokemob_BiomeGenBase.biomeList[aint[i1]].getIntTemperature() / 65536.0F;

            if (f > 1.0F)
            {
                f = 1.0F;
            }

            par1ArrayOfFloat[i1] = f;
        }

        return par1ArrayOfFloat;
    }

    /**
     * Returns an array of biomes for the location input.
     */
    public Pokemob_BiomeGenBase[] getBiomesForGeneration(Pokemob_BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
    {
        IntCache.resetIntCache();

        if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
        {
            par1ArrayOfBiomeGenBase = new Pokemob_BiomeGenBase[par4 * par5];
        }

        int[] aint = this.genBiomes.getInts(par2, par3, par4, par5);

        for (int i1 = 0; i1 < par4 * par5; ++i1)
        {
            par1ArrayOfBiomeGenBase[i1] = Pokemob_BiomeGenBase.biomeList[aint[i1]];
        }

        return par1ArrayOfBiomeGenBase;
    }

    /**
     * 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 Pokemob_BiomeGenBase[] loadBlockGeneratorData(Pokemob_BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5)
    {
        return this.getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true);
    }

    /**
     * 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 Pokemob_BiomeGenBase[] getBiomeGenAt(Pokemob_BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6)
    {
        IntCache.resetIntCache();

        if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
        {
            par1ArrayOfBiomeGenBase = new Pokemob_BiomeGenBase[par4 * par5];
        }

        if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0)
        {
            Pokemob_BiomeGenBase[] abiomegenbase1 = this.biomeCache.getCachedBiomes(par2, par3);
            System.arraycopy(abiomegenbase1, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5);
            return par1ArrayOfBiomeGenBase;
        }
        else
        {
            int[] aint = this.biomeIndexLayer.getInts(par2, par3, par4, par5);

            for (int i1 = 0; i1 < par4 * par5; ++i1)
            {
                par1ArrayOfBiomeGenBase[i1] = Pokemob_BiomeGenBase.biomeList[aint[i1]];
            }

            return par1ArrayOfBiomeGenBase;
        }
    }

    /**
     * checks given Chunk's Biomes against List of allowed ones
     */
    public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
    {
        IntCache.resetIntCache();
        int l = par1 - par3 >> 2;
        int i1 = par2 - par3 >> 2;
        int j1 = par1 + par3 >> 2;
        int k1 = par2 + par3 >> 2;
        int l1 = j1 - l + 1;
        int i2 = k1 - i1 + 1;
        int[] aint = this.genBiomes.getInts(l, i1, l1, i2);

        for (int j2 = 0; j2 < l1 * i2; ++j2)
        {
            Pokemob_BiomeGenBase biomegenbase = Pokemob_BiomeGenBase.biomeList[aint[j2]];

            if (!par4List.contains(biomegenbase))
            {
                return false;
            }
        }

        return true;
    }

    /**
     * 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)
    {
        IntCache.resetIntCache();
        int l = par1 - par3 >> 2;
        int i1 = par2 - par3 >> 2;
        int j1 = par1 + par3 >> 2;
        int k1 = par2 + par3 >> 2;
        int l1 = j1 - l + 1;
        int i2 = k1 - i1 + 1;
        int[] aint = this.genBiomes.getInts(l, i1, l1, i2);
        ChunkPosition chunkposition = null;
        int j2 = 0;

        for (int k2 = 0; k2 < l1 * i2; ++k2)
        {
            int l2 = l + k2 % l1 << 2;
            int i3 = i1 + k2 / l1 << 2;
            Pokemob_BiomeGenBase biomegenbase = Pokemob_BiomeGenBase.biomeList[aint[k2]];

            if (par4List.contains(biomegenbase) && (chunkposition == null || par5Random.nextInt(j2 + 1) == 0))
            {
                chunkposition = new ChunkPosition(l2, 0, i3);
                ++j2;
            }
        }

        return chunkposition;
    }

    /**
     * Calls the WorldChunkManager's biomeCache.cleanupCache()
     */
    public void cleanupCache()
    {
        this.biomeCache.cleanupCache();
    }

    public GenLayer[] getModdedBiomeGenerators(WorldType worldType, long seed, GenLayer[] original)
    {
        WorldTypeEvent.InitBiomeGens event = new WorldTypeEvent.InitBiomeGens(worldType, seed, original);
        MinecraftForge.TERRAIN_GEN_BUS.post(event);
        return event.newBiomeGens;
    }
}

 

 

 

Pokemob_WorldProvider

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.pokemob.common.Pokemob;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.IChunkProvider;

public class Pokemob_WorldProvider extends WorldProvider {

    private Pokemob_WorldChunkManager worldChunkMgr;
    private float[] colorsSunriseSunset = new float[4];

    @Override
    public void registerWorldChunkManager() {
        boolean a = this.canRespawnHere();
        this.worldChunkMgr = new Pokemob_WorldChunkManager(this.worldObj);
        this.dimensionId = Pokemob.DimID;
        this.hasNoSky = false;
    }

    public IChunkProvider createChunkGenerator() {
        return new Pokemob_ChunkProvider(this.worldObj, this.worldObj.getSeed(), false);
    }

    public int getAverageGroundLevel() {
        return 0;
    }

    @SideOnly(Side.CLIENT)
    public boolean doesXZShowFog(int par1, int par2) {
        return false;
    }

    public String getDimensionName() {
        return "Zeconia";
    }

    public boolean renderStars() {
        return true;
    }

    public float getStarBrightness(World world, float f) {
        return 10.0F;
    }

    public boolean renderClouds() {
        return true;
    }

    public boolean renderVoidFog() {
        return false;
    }

    public boolean renderEndSky() {
        return false;
    }

    public float setSunSize() {
        return 10.0F;
    }

    public float setMoonSize() {
        return 8.0F;
    }

    @SideOnly(Side.CLIENT)
    public boolean isSkyColored() {
        return true;
    }

    public boolean canRespawnHere() {
        return false;
    }

    public boolean isSurfaceWorld() {
        return true;
    }

    @SideOnly(Side.CLIENT)
    public float getCloudHeight() {
        return 156.0F;
    }

    @SideOnly(Side.CLIENT)
    public String getSunTexture() {
        return "/Main:TwinSuns.png";
    }

    public boolean canCoordinateBeSpawn(int par1, int par2) {
        return false;
    }

    public ChunkCoordinates getEntrancePortalLocation() {
        return new ChunkCoordinates(50, 5, 0);
    }

    protected void generateLightBrightnessTable() {
        float f = 12.0F;
        for (int i = 0; i <= 15; i++) {
            float f1 = 12.0F - i / 15.0F;
            this.lightBrightnessTable[i] = ((1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f);
        }
    }

    @SideOnly(Side.CLIENT)
    public String getWelcomeMessage() {
        if ((this instanceof Pokemob_WorldProvider)) {
            return "Entering Tut Dimension";
        }
        return null;
    }

    @SideOnly(Side.CLIENT)
    public float[] calcSunriseSunsetColors(float par1, float par2) {
        float f2 = 0.4F;
        float f3 = MathHelper.cos(par1 * 3.141593F * 2.0F) - 0.0F;
        float f4 = -0.0F;
        if ((f3 >= f4 - f2) && (f3 <= f4 + f2)) {
            float f5 = (f3 - f4) / f2 * 0.5F + 0.5F;
            float f6 = 1.0F - (1.0F - MathHelper.sin(f5 * 3.141593F)) * 0.99F;
            f6 *= f6;
            this.colorsSunriseSunset[0] = (f5 * 0.3F + 0.7F);
            this.colorsSunriseSunset[1] = (f5 * f5 * 0.7F + 0.2F);
            this.colorsSunriseSunset[2] = (f5 * f5 * 0.0F + 0.2F);
            this.colorsSunriseSunset[3] = f6;
            return this.colorsSunriseSunset;
        }
        return null;
    }

    public float calculateCelestialAngle(long par1, float par3) {
        int j = (int) (par1 % 24000L);
        float f1 = (j + par3) / 24000.0F - 0.25F;
        if (f1 < 0.0F) {
            f1 += 1.0F;
        }
        if (f1 > 1.0F) {
            f1 -= 1.0F;
        }
        float f2 = f1;
        f1 = 1.0F - (float) ((Math.cos(f1 * 3.141592653589793D) + 1.0D) / 2.0D);
        f1 = f2 + (f1 - f2) / 3.0F;
        return f1;
    }

    @SideOnly(Side.CLIENT)
    public Vec3 getFogColor(float par1, float par2) {
        int i = 10518688;
        float f2 = MathHelper.cos(par1 * 3.141593F * 2.0F) * 2.0F + 0.5F;
        if (f2 < 0.0F) {
            f2 = 0.0F;
        }
        if (f2 > 1.0F) {
            f2 = 1.0F;
        }
        float f3 = (i >> 16 & 0xFF) / 255.0F;
        float f4 = (i >> 8 & 0xFF) / 255.0F;
        float f5 = (i & 0xFF) / 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(f3, f4, f5);
    }
}

 

 

 

Pokemob_GenLayer.java

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import net.minecraft.world.WorldType;
import net.minecraft.world.gen.layer.GenLayer;
import net.minecraft.world.gen.layer.GenLayerVoronoiZoom;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.WorldTypeEvent;

/**
*
* @author dis_c_000
*/
public abstract class Pokemob_GenLayer extends GenLayer {
    /** seed from World#getWorldSeed that is used in the LCG prng */
    private long worldGenSeed;

    /** parent GenLayer that was provided via the constructor */
    protected Pokemob_GenLayer parent;

    /**
     * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate
     * pseudorandom numbers
     */
    private long chunkSeed;

    /** base seed to the LCG prng provided via the constructor */
    private long baseSeed;

    /**
     * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the
     * first.
     */
    public static Pokemob_GenLayer[] initializeAllBiomeGenerators(long par0, WorldType par2WorldType)
    {
        Pokemob_GenLayerIsland genlayerisland = new Pokemob_GenLayerIsland(1L);
        Pokemob_GenLayer genlayer1 = Pokemob_GenLayerZoom.magnify(1000L, genlayerisland, 0);
        Pokemob_GenLayerBiome Biome = new Pokemob_GenLayerBiome(100L,genlayer1,par2WorldType);        
        
        Pokemob_GenLayerVoronoiZoom genlayervoronoizoom = new Pokemob_GenLayerVoronoiZoom(10L, Biome);
        genlayervoronoizoom.initWorldGenSeed(par0);
        Biome.initWorldGenSeed(par0);
        
        return new Pokemob_GenLayer[] {Biome,genlayervoronoizoom,Biome};
    }

    public Pokemob_GenLayer(long par1)
    {
        super(par1);
        this.baseSeed = par1;
        this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
        this.baseSeed += par1;
        this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
        this.baseSeed += par1;
        this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L;
        this.baseSeed += par1;
    }

    /**
     * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an
     * argument).
     */
    public void initWorldGenSeed(long par1)
    {
        this.worldGenSeed = par1;

        if (this.parent != null)
        {
            this.parent.initWorldGenSeed(par1);
        }

        this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
        this.worldGenSeed += this.baseSeed;
        this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
        this.worldGenSeed += this.baseSeed;
        this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L;
        this.worldGenSeed += this.baseSeed;
    }

    /**
     * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates.
     */
    public void initChunkSeed(long par1, long par3)
    {
        this.chunkSeed = this.worldGenSeed;
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += par1;
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += par3;
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += par1;
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += par3;
    }

    /**
     * returns a LCG pseudo random number from [0, x). Args: int x
     */
    protected int nextInt(int par1)
    {
        int j = (int)((this.chunkSeed >> 24) % (long)par1);

        if (j < 0)
        {
            j += par1;
        }

        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += this.worldGenSeed;
        return j;
    }

    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public abstract int[] getInts(int i, int j, int k, int l);

    public static byte getModdedBiomeSize(WorldType worldType, byte original)
    {
        WorldTypeEvent.BiomeSize event = new WorldTypeEvent.BiomeSize(worldType, original);
        MinecraftForge.TERRAIN_GEN_BUS.post(event);
        return event.newSize;
    }
}

 

 

 

Pokemob_GenLayerBiome.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import mods.pokemob.common.Biomes.Pokemob_BiomeGenBase;
import net.minecraft.world.WorldType;
import net.minecraft.world.gen.layer.IntCache;

/**
*
* @author dis_c_000
*/
public class Pokemob_GenLayerBiome extends Pokemob_GenLayer
{

    public Pokemob_GenLayerBiome(long par1, Pokemob_GenLayer par3GenLayer, WorldType par4WorldType)
    {
        super(par1);
        this.parent = par3GenLayer;
    }

    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public int[] getInts(int par1, int par2, int par3, int par4)
    {
        int[] aint = this.parent.getInts(par1, par2, par3, par4);
        int[] aint1 = IntCache.getIntCache(par3 * par4);

        for (int i1 = 0; i1 < par4; ++i1)
        {
            for (int j1 = 0; j1 < par3; ++j1)
            {
                this.initChunkSeed((long)(j1 + par1), (long)(i1 + par2));
                int k1 = aint[j1 + i1 * par3];

                if (k1 == 0)
                {
                    aint1[j1 + i1 * par3] = 0;
                }
                else if (k1 == Pokemob_BiomeGenBase.mushroomIsland.biomeID)
                {
                    aint1[j1 + i1 * par3] = k1;
                }
                else if (k1 == 1)
                {
                    aint1[j1 + i1 * par3] = Pokemob_BiomeGenBase.biomeList[this.nextInt(Pokemob_BiomeGenBase.biomeList.length)].biomeID;
                }
                else
                {
                    int l1 = Pokemob_BiomeGenBase.biomeList[this.nextInt(Pokemob_BiomeGenBase.biomeList.length)].biomeID;

                    if (l1 == Pokemob_BiomeGenBase.taiga.biomeID)
                    {
                        aint1[j1 + i1 * par3] = l1;
                    }
                    else
                    {
                        aint1[j1 + i1 * par3] = Pokemob_BiomeGenBase.icePlains.biomeID;
                    }
                }
            }
        }

        return aint1;
    }
}

 

 

 

Pokemob_GenLayerIsland.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import net.minecraft.world.gen.layer.IntCache;

/**
*
* @author dis_c_000
*/
public class Pokemob_GenLayerIsland extends Pokemob_GenLayer
{
    public Pokemob_GenLayerIsland(long par1)
    {
        super(par1);
    }

    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public int[] getInts(int par1, int par2, int par3, int par4)
    {
        int[] aint = IntCache.getIntCache(par3 * par4);

        for (int i1 = 0; i1 < par4; ++i1)
        {
            for (int j1 = 0; j1 < par3; ++j1)
            {
                this.initChunkSeed((long)(par1 + j1), (long)(par2 + i1));
                aint[j1 + i1 * par3] = this.nextInt(10) == 0 ? 1 : 0;
            }
        }

        if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0)
        {
            aint[-par1 + -par2 * par3] = 1;
        }

        return aint;
    }
}

 

 

 

Pokemob_GenLayerVoronoiZoom.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import net.minecraft.world.gen.layer.IntCache;

/**
*
* @author dis_c_000
*/
public class Pokemob_GenLayerVoronoiZoom extends Pokemob_GenLayer
{
    public Pokemob_GenLayerVoronoiZoom(long par1, Pokemob_GenLayer par3GenLayer)
    {
        super(par1);
        super.parent = par3GenLayer;
    }

    /**
     * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall
     * amounts, or biomeList[] indices based on the particular GenLayer subclass.
     */
    public int[] getInts(int par1, int par2, int par3, int par4)
    {
        par1 -= 2;
        par2 -= 2;
        byte b0 = 2;
        int i1 = 1 << b0;
        int j1 = par1 >> b0;
        int k1 = par2 >> b0;
        int l1 = (par3 >> b0) + 3;
        int i2 = (par4 >> b0) + 3;
        int[] aint = this.parent.getInts(j1, k1, l1, i2);
        int j2 = l1 << b0;
        int k2 = i2 << b0;
        int[] aint1 = IntCache.getIntCache(j2 * k2);
        int l2;

        for (int i3 = 0; i3 < i2 - 1; ++i3)
        {
            l2 = aint[0 + (i3 + 0) * l1];
            int j3 = aint[0 + (i3 + 1) * l1];

            for (int k3 = 0; k3 < l1 - 1; ++k3)
            {
                double d0 = (double)i1 * 0.9D;
                this.initChunkSeed((long)(k3 + j1 << b0), (long)(i3 + k1 << b0));
                double d1 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0;
                double d2 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0;
                this.initChunkSeed((long)(k3 + j1 + 1 << b0), (long)(i3 + k1 << b0));
                double d3 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0 + (double)i1;
                double d4 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0;
                this.initChunkSeed((long)(k3 + j1 << b0), (long)(i3 + k1 + 1 << b0));
                double d5 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0;
                double d6 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0 + (double)i1;
                this.initChunkSeed((long)(k3 + j1 + 1 << b0), (long)(i3 + k1 + 1 << b0));
                double d7 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0 + (double)i1;
                double d8 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * d0 + (double)i1;
                int l3 = aint[k3 + 1 + (i3 + 0) * l1];
                int i4 = aint[k3 + 1 + (i3 + 1) * l1];

                for (int j4 = 0; j4 < i1; ++j4)
                {
                    int k4 = ((i3 << b0) + j4) * j2 + (k3 << b0);

                    for (int l4 = 0; l4 < i1; ++l4)
                    {
                        double d9 = ((double)j4 - d2) * ((double)j4 - d2) + ((double)l4 - d1) * ((double)l4 - d1);
                        double d10 = ((double)j4 - d4) * ((double)j4 - d4) + ((double)l4 - d3) * ((double)l4 - d3);
                        double d11 = ((double)j4 - d6) * ((double)j4 - d6) + ((double)l4 - d5) * ((double)l4 - d5);
                        double d12 = ((double)j4 - d8) * ((double)j4 - d8) + ((double)l4 - d7) * ((double)l4 - d7);

                        if (d9 < d10 && d9 < d11 && d9 < d12)
                        {
                            aint1[k4++] = l2;
                        }
                        else if (d10 < d9 && d10 < d11 && d10 < d12)
                        {
                            aint1[k4++] = l3;
                        }
                        else if (d11 < d9 && d11 < d10 && d11 < d12)
                        {
                            aint1[k4++] = j3;
                        }
                        else
                        {
                            aint1[k4++] = i4;
                        }
                    }
                }

                l2 = l3;
                j3 = i4;
            }
        }

        int[] aint2 = IntCache.getIntCache(par3 * par4);

        for (l2 = 0; l2 < par4; ++l2)
        {
            System.arraycopy(aint1, (l2 + (par2 & i1 - 1)) * (l1 << b0) + (par1 & i1 - 1), aint2, l2 * par3, par3);
        }

        return aint2;
    }
}

 

 

 

Pokemob_GenLayerZoom.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.World;

import net.minecraft.world.gen.layer.IntCache;

/**
*
* @author dis_c_000
*/
public class Pokemob_GenLayerZoom extends Pokemob_GenLayer {

    public Pokemob_GenLayerZoom(long par1, Pokemob_GenLayer par3GenLayer) {
        super(par1);
        super.parent = par3GenLayer;
    }

    /**
     * Returns a list of integer values generated by this layer. These may be
     * interpreted as temperatures, rainfall amounts, or biomeList[] indices
     * based on the particular GenLayer subclass.
     */
    public int[] getInts(int par1, int par2, int par3, int par4) {
        int i1 = par1 >> 1;
        int j1 = par2 >> 1;
        int k1 = (par3 >> 1) + 3;
        int l1 = (par4 >> 1) + 3;
        int[] aint = this.parent.getInts(i1, j1, k1, l1);
        int[] aint1 = IntCache.getIntCache(k1 * 2 * l1 * 2);
        int i2 = k1 << 1;
        int j2;

        for (int k2 = 0; k2 < l1 - 1; ++k2) {
            j2 = k2 << 1;
            int l2 = j2 * i2;
            int i3 = aint[0 + (k2 + 0) * k1];
            int j3 = aint[0 + (k2 + 1) * k1];

            for (int k3 = 0; k3 < k1 - 1; ++k3) {
                this.initChunkSeed((long) (k3 + i1 << 1), (long) (k2 + j1 << 1));
                int l3 = aint[k3 + 1 + (k2 + 0) * k1];
                int i4 = aint[k3 + 1 + (k2 + 1) * k1];
                aint1[l2] = i3;
                aint1[l2++ + i2] = this.choose(i3, j3);
                aint1[l2] = this.choose(i3, l3);
                aint1[l2++ + i2] = this.modeOrRandom(i3, l3, j3, i4);
                i3 = l3;
                j3 = i4;
            }
        }

        int[] aint2 = IntCache.getIntCache(par3 * par4);

        for (j2 = 0; j2 < par4; ++j2) {
            System.arraycopy(aint1, (j2 + (par2 & 1)) * (k1 << 1) + (par1 & 1), aint2, j2 * par3, par3);
        }

        return aint2;
    }

    /**
     * Chooses one of the two inputs randomly.
     */
    protected int choose(int par1, int par2) {
        return this.nextInt(2) == 0 ? par1 : par2;
    }

    /**
     * returns the mode (most frequently occuring number) or a random number
     * from the 4 integers provided
     */
    protected int modeOrRandom(int par1, int par2, int par3, int par4) {
        if (par2 == par3 && par3 == par4) {
            return par2;
        } else if (par1 == par2 && par1 == par3) {
            return par1;
        } else if (par1 == par2 && par1 == par4) {
            return par1;
        } else if (par1 == par3 && par1 == par4) {
            return par1;
        } else if (par1 == par2 && par3 != par4) {
            return par1;
        } else if (par1 == par3 && par2 != par4) {
            return par1;
        } else if (par1 == par4 && par2 != par3) {
            return par1;
        } else if (par2 == par1 && par3 != par4) {
            return par2;
        } else if (par2 == par3 && par1 != par4) {
            return par2;
        } else if (par2 == par4 && par1 != par3) {
            return par2;
        } else if (par3 == par1 && par2 != par4) {
            return par3;
        } else if (par3 == par2 && par1 != par4) {
            return par3;
        } else if (par3 == par4 && par1 != par2) {
            return par3;
        } else if (par4 == par1 && par2 != par3) {
            return par3;
        } else if (par4 == par2 && par1 != par3) {
            return par3;
        } else if (par4 == par3 && par1 != par2) {
            return par3;
        } else {
            int i1 = this.nextInt(4);
            return i1 == 0 ? par1 : (i1 == 1 ? par2 : (i1 == 2 ? par3 : par4));
        }
    }

    /**
     * Magnify a layer. Parms are seed adjustment, layer, number of times to
     * magnify
     */
    public static Pokemob_GenLayer magnify(long par0, Pokemob_GenLayer par2GenLayer, int par3) {
        Object object = par2GenLayer;

        for (int k = 0; k < par3; ++k) {
            object = new Pokemob_GenLayerZoom(par0 + (long) k, (Pokemob_GenLayer) object);
        }

        return (Pokemob_GenLayer) object;
    }
}

 

 

 

Pokemob_BiomeGenBase.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntitySquid;
import net.minecraft.util.MathHelper;
import net.minecraft.world.ColorizerFoliage;
import net.minecraft.world.ColorizerGrass;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
import net.minecraft.world.gen.feature.WorldGenBigTree;
import net.minecraft.world.gen.feature.WorldGenForest;
import net.minecraft.world.gen.feature.WorldGenSwamp;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenTrees;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.terraingen.BiomeEvent;

/**
*
* @author dis_c_000
*/
public abstract class Pokemob_BiomeGenBase extends BiomeGenBase
{
    /** An array of all the biomes, indexed by biome id. */
    public static final Pokemob_BiomeGenBase[] biomeList = new Pokemob_BiomeGenBase[2];
    public static final Pokemob_BiomeGenBase Pokemob_ExtremeHills = (new Pokemob_ExtremeHills(0).setBiomeName("Pokemob - Extreme Hillls"));
    public static final Pokemob_BiomeGenBase Pokemob_Hills = (new Pokemob_Hills(1).setBiomeName("Pokemob - Hills"));
    public String biomeName;
    public int color;

    /** The block expected to be on the top of this biome */
    public byte topBlock;

    /** The block to fill spots in when not on the top */
    public byte fillerBlock;
    public int field_76754_C;

    /** The minimum height of this biome. Default 0.1. */
    public float minHeight;

    /** The maximum height of this biome. Default 0.3. */
    public float maxHeight;

    /** The temperature of this biome. */
    public float temperature;

    /** The rainfall in this biome. */
    public float rainfall;

    /** Color tint applied to water depending on biome */
    public int waterColorMultiplier;

    /** The biome decorator. */
    public Pokemob_BiomeDecorator theBiomeDecorator;

    /**
     * Holds the classes of IMobs (hostile mobs) that can be spawned in the biome.
     */
    protected List spawnableMonsterList;

    /**
     * Holds the classes of any creature that can be spawned in the biome as friendly creature.
     */
    protected List spawnableCreatureList;

    /**
     * Holds the classes of any aquatic creature that can be spawned in the water of the biome.
     */
    protected List spawnableWaterCreatureList;
    protected List spawnableCaveCreatureList;

    /** Set to true if snow is enabled for this biome. */
    private boolean enableSnow;

    /**
     * Is true (default) if the biome support rain (desert and nether can't have rain)
     */
    private boolean enableRain;

    /** The id number to this biome, and its index in the biomeList array. */
    public final int biomeID;

    /** The tree generator. */
    protected WorldGenTrees worldGeneratorTrees;

    /** The big tree generator. */
    protected WorldGenBigTree worldGeneratorBigTree;

    /** The forest generator. */
    protected WorldGenForest worldGeneratorForest;

    /** The swamp tree generator. */
    protected WorldGenSwamp worldGeneratorSwamp;

    public Pokemob_BiomeGenBase(int par1)
    {
        super(par1);
        this.topBlock = (byte)Block.grass.blockID;
        this.fillerBlock = (byte)Block.dirt.blockID;
        this.field_76754_C = 5169201;
        this.minHeight = 0.1F;
        this.maxHeight = 0.3F;
        this.temperature = 0.5F;
        this.rainfall = 0.5F;
        this.waterColorMultiplier = 16777215;
        this.spawnableMonsterList = new ArrayList();
        this.spawnableCreatureList = new ArrayList();
        this.spawnableWaterCreatureList = new ArrayList();
        this.spawnableCaveCreatureList = new ArrayList();
        this.enableRain = true;
        this.worldGeneratorTrees = new WorldGenTrees(false);
        this.worldGeneratorBigTree = new WorldGenBigTree(false);
        this.worldGeneratorForest = new WorldGenForest(false);
        this.worldGeneratorSwamp = new WorldGenSwamp();
        this.biomeID = par1;
        this.biomeList[par1] = this;
        
        int a = 1;
        
        this.theBiomeDecorator = this.createBiomeDecorator();
        this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
        this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4));
        this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4));
        this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4));
        this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, );
    }

    /**
     * Allocate a new BiomeDecorator for this Pokemob_BiomeGenBase
     */
    public Pokemob_BiomeDecorator createBiomeDecorator()
    {   
        return getModdedBiomeDecorator(new Pokemob_BiomeDecorator(this));
    }

    /**
     * Sets the temperature and rainfall of this biome.
     */
    public Pokemob_BiomeGenBase setTemperatureRainfall(float par1, float par2)
    {
        if (par1 > 0.1F && par1 < 0.2F)
        {
            throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
        }
        else
        {
            this.temperature = par1;
            this.rainfall = par2;
            return this;
        }
    }

    /**
     * Sets the minimum and maximum height of this biome. Seems to go from -2.0 to 2.0.
     */
    public Pokemob_BiomeGenBase setMinMaxHeight(float par1, float par2)
    {
        this.minHeight = par1;
        this.maxHeight = par2;
        return this;
    }

    /**
     * Disable the rain for the biome.
     */
    public Pokemob_BiomeGenBase setDisableRain()
    {
        this.enableRain = false;
        return this;
    }

    /**
     * sets enableSnow to true during biome initialization. returns Pokemob_BiomeGenBase.
     */
    public Pokemob_BiomeGenBase setEnableSnow()
    {
        this.enableSnow = true;
        return this;
    }

    public Pokemob_BiomeGenBase setBiomeName(String par1Str)
    {
        this.biomeName = par1Str;
        return this;
    }

    public Pokemob_BiomeGenBase func_76733_a(int par1)
    {
        this.field_76754_C = par1;
        return this;
    }

    public Pokemob_BiomeGenBase setColor(int par1)
    {
        this.color = par1;
        return this;
    }

    @SideOnly(Side.CLIENT)

    /**
     * takes temperature, returns color
     */
    public int getSkyColorByTemp(float par1)
    {
        par1 /= 3.0F;

        if (par1 < -1.0F)
        {
            par1 = -1.0F;
        }

        if (par1 > 1.0F)
        {
            par1 = 1.0F;
        }

        return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
    }

    /**
     * Returns the correspondent list of the EnumCreatureType informed.
     */
    public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
    {
        return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
    }

    public void decorate(World par1World, Random par2Random, int par3, int par4)
    {
        this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4);
    }

    @SideOnly(Side.CLIENT)

    /**
     * Provides the basic grass color based on the biome temperature and rainfall
     */
    public int getBiomeGrassColor()
    {
        double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
        double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
        return getModdedBiomeGrassColor(ColorizerGrass.getGrassColor(d0, d1));
    }

    @SideOnly(Side.CLIENT)

    /**
     * Provides the basic foliage color based on the biome temperature and rainfall
     */
    public int getBiomeFoliageColor()
    {
        double d0 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
        double d1 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
        return getModdedBiomeFoliageColor(ColorizerFoliage.getFoliageColor(d0, d1));
    }

    public Pokemob_BiomeDecorator getModdedBiomeDecorator(Pokemob_BiomeDecorator original)
    {
        BiomeEvent.CreateDecorator event = new BiomeEvent.CreateDecorator(this, original);
        MinecraftForge.TERRAIN_GEN_BUS.post(event);
        return (Pokemob_BiomeDecorator) event.newBiomeDecorator;
    }

    @SideOnly(Side.CLIENT)
    public int getWaterColorMultiplier()
    {
        BiomeEvent.GetWaterColor event = new BiomeEvent.GetWaterColor(this, waterColorMultiplier);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
    
    @SideOnly(Side.CLIENT)
    public int getModdedBiomeGrassColor(int original)
    {
        BiomeEvent.GetGrassColor event = new BiomeEvent.GetGrassColor(this, original);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
    

    @SideOnly(Side.CLIENT)
    public int getModdedBiomeFoliageColor(int original)
    {
        BiomeEvent.GetFoliageColor event = new BiomeEvent.GetFoliageColor(this, original);
        MinecraftForge.EVENT_BUS.post(event);
        return event.newColor;
    }
}

 

 

 

Pokemob_BiomeDecorator.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import net.minecraft.world.biome.BiomeDecorator;

/**
*
* @author dis_c_000
*/
public class Pokemob_BiomeDecorator extends BiomeDecorator{
    
    public Pokemob_BiomeDecorator(Pokemob_BiomeGenBase biomegenbase){
        super (biomegenbase);
    }
    
    @Override
    protected void decorate(){
        super.decorate();
        
    }
    
    
    
}

 

 

 

Pokemob_BiomeCache.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import java.util.ArrayList;
import java.util.List;
import mods.pokemob.common.World.Pokemob_WorldChunkManager;
import net.minecraft.util.LongHashMap;
import net.minecraft.world.biome.BiomeCache;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.WorldChunkManager;

/**
*
* @author dis_c_000
*/
public class Pokemob_BiomeCache extends BiomeCache {
    /**
     * The map of keys to BiomeCacheBlocks. Keys are based on the chunk x, z coordinates as (x | z << 32).
     */
    private LongHashMap cacheMap = new LongHashMap();

    /** The list of cached BiomeCacheBlocks */
    private List cache = new ArrayList();
    
    public Pokemob_BiomeCache(Pokemob_WorldChunkManager par1WorldChunkManager)
    {
        super(par1WorldChunkManager);
    }
    
    /**
     * Returns a biome cache block at location specified.
     */
    public Pokemob_BiomeCacheBlock getBiomeCacheBlock(int par1, int par2)
    {
        par1 >>= 4;
        par2 >>= 4;
        long k = (long)par1 & 4294967295L | ((long)par2 & 4294967295L) << 32;
        Pokemob_BiomeCacheBlock biomecacheblock = (Pokemob_BiomeCacheBlock)this.cacheMap.getValueByKey(k);

        if (biomecacheblock == null)
        {
            biomecacheblock = new Pokemob_BiomeCacheBlock(this, par1, par2);
            this.cacheMap.add(k, biomecacheblock);
            this.cache.add(biomecacheblock);
        }

        biomecacheblock.lastAccessTime = System.currentTimeMillis();
        return biomecacheblock;
    }
    
    public Pokemob_BiomeGenBase getBiomeGenAt(int par1, int par2)
    {
        return this.getBiomeCacheBlock(par1, par2).getBiomeGenAt(par1, par2);
    }
    
    /**
     * Returns the array of cached biome types in the BiomeCacheBlock at the given location.
     */
    public Pokemob_BiomeGenBase[] getCachedBiomes(int par1, int par2)
    {
        return this.getBiomeCacheBlock(par1, par2).biomes;
    }
}

 

 

 

Pokemob_BiomeCacheBlock.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import net.minecraft.world.biome.BiomeCacheBlock;

/**
*
* @author dis_c_000
*/
public class Pokemob_BiomeCacheBlock extends BiomeCacheBlock{
    
    public Pokemob_BiomeGenBase[] biomes;
    
    public Pokemob_BiomeCacheBlock(Pokemob_BiomeCache par1BiomeCache, int par2, int par3)
    {
        super(par1BiomeCache, par2, par3);
        this.biomes = new Pokemob_BiomeGenBase[256];
    }
    
    /**
     * Returns the BiomeGenBase related to the x, z position from the cache block.
     */
    public Pokemob_BiomeGenBase getBiomeGenAt(int par1, int par2)
    {
        return this.biomes[par1 & 15 | (par2 & 15) << 4];
    }
}

 

 

 

Pokemob_ExtremeHills.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.world.World;

/**
*
* @author dis_c_000
*/
public class Pokemob_ExtremeHills extends Pokemob_BiomeGenBase{
    public Pokemob_ExtremeHills(int par1){
        super(par1);
        this.setBiomeName("Pokemob - Extreme Hills");
        this.setEnableSnow();
        this.fillerBlock = (byte)Block.grass.blockID;
        this.topBlock = (byte)Block.grass.blockID;
        this.setMinMaxHeight(-1.1f, 2f);
        
        this.waterColorMultiplier = 0xE42D17;
    }
}

 

 

 

Pokemob_Hills.java

 

 

 

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package mods.pokemob.common.Biomes;

import net.minecraft.block.Block;
import net.minecraft.world.biome.BiomeGenBase;

/**
*
* @author dis_c_000
*/
public class Pokemob_Hills extends Pokemob_BiomeGenBase{
    public Pokemob_Hills(int par1){
        super(par1);
        this.setBiomeName("Pokemob - Hills");
        this.setEnableSnow();
        this.fillerBlock = (byte)Block.grass.blockID;
        this.topBlock = (byte)Block.blockSnow.blockID;
        this.setMinMaxHeight(-1f, 1f);
        
        this.waterColorMultiplier = 0xE42D17;
    }
}

 

 

Link to comment
Share on other sites

Sorry for delay, i had a long sleep ^^.

 

I am on 1.5.2 using version 7.8.0.716 of forge (end of last month i think)

 

The error is when im creating a new world, i get to the main menu fine, the console log looks like this:

 

 

 

2013-06-08 10:37:53 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@2e166e9b)
2013-06-08 10:37:53 [iNFO] [ForgeModLoader] Loading dimension 2 (New World) (net.minecraft.server.integrated.IntegratedServer@2e166e9b)
2013-06-08 10:37:53 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@2e166e9b)
2013-06-08 10:37:53 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@2e166e9b)
2013-06-08 10:37:53 [iNFO] [Minecraft-Server] Preparing start region for level 0
2013-06-08 10:37:54 [iNFO] [Minecraft-Server] Preparing spawn area: 14%
2013-06-08 10:37:55 [iNFO] [Minecraft-Server] Preparing spawn area: 34%
2013-06-08 10:37:56 [iNFO] [Minecraft-Server] Preparing spawn area: 54%
2013-06-08 10:37:57 [iNFO] [Minecraft-Server] Preparing spawn area: 72%
2013-06-08 10:37:58 [iNFO] [Minecraft-Server] Preparing spawn area: 92%
2013-06-08 10:37:59 [iNFO] [sTDERR] net.minecraft.util.ReportedException: Exception ticking world
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:647)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:571)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-08 10:37:59 [iNFO] [sTDERR] Caused by: java.lang.NullPointerException
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.world.WorldServer.tick(WorldServer.java:157)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:641)
2013-06-08 10:37:59 [iNFO] [sTDERR] 	... 4 more
2013-06-08 10:37:59 [sEVERE] [Minecraft-Server] Encountered an unexpected exception ReportedException
net.minecraft.util.ReportedException: Exception ticking world
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:647)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:571)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
Caused by: java.lang.NullPointerException
at net.minecraft.world.WorldServer.tick(WorldServer.java:157)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:641)
... 4 more
2013-06-08 10:37:59 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\dis_c_000\AppData\Roaming\.minecraft\crash-reports\crash-2013-06-08_10.37.59-server.txt
2013-06-08 10:37:59 [iNFO] [Minecraft-Server] Stopping server
2013-06-08 10:37:59 [iNFO] [Minecraft-Server] Saving players
2013-06-08 10:37:59 [iNFO] [Minecraft-Server] Saving worlds
2013-06-08 10:37:59 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-06-08 10:38:04 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-06-08 10:38:04 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-06-08 10:38:04 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Zeconia
2013-06-08 10:38:07 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-06-08 10:38:07 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-06-08 10:38:07 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-06-08 10:38:07 [iNFO] [ForgeModLoader] Unloading dimension 2
2013-06-08 10:38:07 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue
2013-06-08 10:38:07 [sEVERE] [ForgeModLoader] 
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
FML{5.2.17.716} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Forge{7.8.0.716} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Pokemob{0.1} [Pokemob] (minecraft) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
2013-06-08 10:38:07 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-06-08 10:38:07 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-06-08 10:38:07 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-06-08 10:38:07 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:806)
2013-06-08 10:38:07 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
2013-06-08 10:38:07 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:531)
2013-06-08 10:38:07 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-08 10:38:09 [iNFO] [Minecraft-Client] Stopping!
2013-06-08 10:38:09 [iNFO] [sTDOUT] 
2013-06-08 10:38:09 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-06-08 10:38:09 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-06-08 10:38:09 [iNFO] [sTDOUT] 

 

 

 

 

The code its referencing too is:

 

MinecraftServer.java, line 639:

[spoiler]                try
                {
                    worldserver.tick();
                }
                catch (Throwable throwable)
                {
                    crashreport = CrashReport.makeCrashReport(throwable, "Exception ticking world");
                    worldserver.addWorldInfoToCrashReport(crashreport);
                    throw new ReportedException(crashreport);
                }[/spoiler]

 

If i comment out the try - catch to see more information about the error, i get this message instead:

 

 

2013-06-08 10:41:12 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@29f8f02c)
2013-06-08 10:41:12 [iNFO] [ForgeModLoader] Loading dimension 2 (New World) (net.minecraft.server.integrated.IntegratedServer@29f8f02c)
2013-06-08 10:41:12 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@29f8f02c)
2013-06-08 10:41:12 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@29f8f02c)
2013-06-08 10:41:12 [iNFO] [Minecraft-Server] Preparing start region for level 0
2013-06-08 10:41:13 [iNFO] [Minecraft-Server] Preparing spawn area: 18%
2013-06-08 10:41:14 [iNFO] [Minecraft-Server] Preparing spawn area: 42%
2013-06-08 10:41:15 [iNFO] [Minecraft-Server] Preparing spawn area: 67%
2013-06-08 10:41:16 [iNFO] [Minecraft-Server] Preparing spawn area: 96%
2013-06-08 10:41:16 [iNFO] [sTDERR] java.lang.NullPointerException
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.world.WorldServer.tick(WorldServer.java:157)
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:641)
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:571)
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)
2013-06-08 10:41:16 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-08 10:41:16 [sEVERE] [Minecraft-Server] Encountered an unexpected exception NullPointerException
java.lang.NullPointerException
at net.minecraft.world.WorldServer.tick(WorldServer.java:157)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:641)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:571)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:469)
at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-08 10:41:16 [sEVERE] [Minecraft-Server] This crash report has been saved to: C:\Users\dis_c_000\AppData\Roaming\.minecraft\crash-reports\crash-2013-06-08_10.41.16-server.txt
2013-06-08 10:41:16 [iNFO] [Minecraft-Server] Stopping server
2013-06-08 10:41:16 [iNFO] [Minecraft-Server] Saving players
2013-06-08 10:41:16 [iNFO] [Minecraft-Server] Saving worlds
2013-06-08 10:41:16 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Overworld
2013-06-08 10:41:21 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Nether
2013-06-08 10:41:21 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/The End
2013-06-08 10:41:21 [iNFO] [Minecraft-Server] Saving chunks for level 'New World'/Zeconia
2013-06-08 10:41:24 [iNFO] [ForgeModLoader] Unloading dimension 0
2013-06-08 10:41:24 [iNFO] [ForgeModLoader] Unloading dimension -1
2013-06-08 10:41:24 [iNFO] [ForgeModLoader] Unloading dimension 1
2013-06-08 10:41:24 [iNFO] [ForgeModLoader] Unloading dimension 2
2013-06-08 10:41:24 [sEVERE] [ForgeModLoader] Fatal errors were detected during the transition from SERVER_STARTED to SERVER_STOPPED. Loading cannot continue
2013-06-08 10:41:24 [sEVERE] [ForgeModLoader] 
mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
FML{5.2.17.716} [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Forge{7.8.0.716} [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
Pokemob{0.1} [Pokemob] (minecraft) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available
2013-06-08 10:41:24 [sEVERE] [ForgeModLoader] The ForgeModLoader state engine has become corrupted. Probably, a state was missed by and invalid modification to a base classForgeModLoader depends on. This is a critical error and not recoverable. Investigate any modifications to base classes outside ofForgeModLoader, especially Optifine, to see if there are fixes available.
2013-06-08 10:41:24 [iNFO] [sTDERR] Exception in thread "Server thread" java.lang.RuntimeException: The ForgeModLoader state engine is invalid
2013-06-08 10:41:24 [iNFO] [sTDERR] 	at cpw.mods.fml.common.LoadController.transition(LoadController.java:134)
2013-06-08 10:41:24 [iNFO] [sTDERR] 	at cpw.mods.fml.common.Loader.serverStopped(Loader.java:806)
2013-06-08 10:41:24 [iNFO] [sTDERR] 	at cpw.mods.fml.common.FMLCommonHandler.handleServerStopped(FMLCommonHandler.java:468)
2013-06-08 10:41:24 [iNFO] [sTDERR] 	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:531)
2013-06-08 10:41:24 [iNFO] [sTDERR] 	at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)
2013-06-08 10:41:26 [iNFO] [Minecraft-Client] Stopping!
2013-06-08 10:41:26 [iNFO] [sTDOUT] 
2013-06-08 10:41:26 [iNFO] [sTDOUT] SoundSystem shutting down...
2013-06-08 10:41:27 [iNFO] [sTDOUT]     Author: Paul Lamb, www.paulscode.com
2013-06-08 10:41:27 [iNFO] [sTDOUT] 

 

 

 

Which points to this code: this.provider.worldChunkMgr.cleanupCache();

in WorldServer.java

 

Using the debugger i can tell you that.

 

this.provider = (mods.pokemob.common.World.Pokemob_WorldProvider) mods.pokemob.common.World.Pokemob_WorldProvider@ 7f0e8369

 

and this.provider.worldChunkMgr = (mods.pokemob.common.World.Pokemob_WorldChunkManager) mods.pokemob.common.World.Pokemob_WorldChunkManager@7a941409

 

If you want to know more information from the debugger just tell me

 

 

Link to comment
Share on other sites

this.provider.worldChunkMgr.cleanUpCache() calls this.biomeCache.cleanupCache() which is your BiomeCache subclass. Make sure the this.biomeCache is actually being initialized correctly, and then go look at the cleanupCache() method in the BiomeCache base class since I don't see an implementation of it in your file. Assuming the crash is actually being caused in this chain somewhere continue to trace from BiomeCache.cleanupCache().

I accidentally the everything then NullPointerException.

Link to comment
Share on other sites

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Another Minecraft Launcher https://multimc.org/#Download or https://atlauncher.com/downloads
    • Remove these mods and combine OptiFine HD U I6 with Forge 47.2.18 Start with Optifine - without any other mods - if this works, add the mods one by one or in groups until you find the mod, conflicting with Optifine
    • Ok yeah I think this might be where the problem starts. For starters, I think you can get rid of your RecipeType impl and make it a static constant instead. I'm not 100% sure this will fix it but it's posssible. RuneInscribingRecipe public class RuneInscribingRecipe implements Recipe<SimpleContainer> { public static final RecipeType<RuneInscribingRecipe> RECIPE_TYPE = new RecipeType<>(){}; // .... @Override public RecipeType<?> getType() { return RECIPE_TYPE; } // .... } RuneInscriberMenu private Optional<RecipeHolder<RuneInscribingRecipe>> getCurrentRecipe() { SimpleContainer inventory = new SimpleContainer(2); inventory.setItem(BASE_INPUT_SLOT, this.inventory.getStackInSlot(BASE_INPUT_SLOT)); inventory.setItem(TEMPLATE_INPUT_SLOT, this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); List<RecipeHolder<RuneInscribingRecipe>> list = this.blockEntity.getLevel().getRecipeManager().getRecipesFor(RuneInscribingRecipe.RECIPE_TYPE, inventory, this.blockEntity.getLevel()); if (list.isEmpty()) { return Optional.empty(); } return Optional.of(list.get(0)); }   Also, this here is a little suspicious where you're getting the `this.inventory.getStackInSlot` calls. I'd try and make sure those are what you expect they are with either a Debug line in IDE or print statement SimpleContainer inventory = new SimpleContainer(2); inventory.setItem(BASE_INPUT_SLOT, this.inventory.getStackInSlot(BASE_INPUT_SLOT)); System.out.printf("CHECKING BASE INPUT OF RECIPE: %s\n", this.inventory.getStackInSlot(BASE_INPUT_SLOT)); inventory.setItem(TEMPLATE_INPUT_SLOT, this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); System.out.printf("CHECKING TEMPLATE INPUT OF RECIPE: %s\n", this.inventory.getStackInSlot(TEMPLATE_INPUT_SLOT)); ^ See what the result of those print statements are, make sure they're right
    • Upon testing again after adding them, the game still doesn't crash however the resource packs are still unfortunately broken.
    • Hi! Can someone please point me to the correct FAQ or place? I'm not able do DuckDuckGo myself out of this one. As you can hopefully see, chunks are not rendered. I run a forge server, fresh install on a linux VM. Curseforge on the Win11 client with Embeddium, Oculus and Unbound shader. No mods. Forge 47.2.23 on server & client.  No errors, no crashes, no apparent CPU or RAM issues with the VM. This screenshot was captured while creative, but the same happens when flying in survival. Waiting (floating) for a few minutes sooner or (often) later, lets the missing chunks appear. Usually takes 5-10 minutes.  When on a local game, the chunks appear slowly, but they do appear without pause.   This must be something simple, obvious, but I can't find the correct "search words" to find my way out. "Chunks not loading / rendering" didn't help. Browsing several forums neither. 
  • Topics

×
×
  • Create New...

Important Information

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