Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[Help!] I get a error when generating new block in my new dimension!


natesiteweb_4
 Share

Recommended Posts

I am making a mod that has the same world generation as the end basically, but I changed it a bit. When I used blocks made in minecraft(Vanilla), it would generate properly. If I use a new block(that I added), it gives me an error  and crashes the game.

 

 

BlockPortalTutorial

package net.minecraft.src;

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockPortal;

import net.minecraft.block.material.Material;

import net.minecraft.creativetab.CreativeTabs;

import net.minecraft.entity.Entity;

import net.minecraft.entity.player.EntityPlayerMP;

import net.minecraft.server.MinecraftServer;

import net.minecraft.world.World;

 

public class BlockPortalTutorial extends BlockPortal{

 

    public BlockPortalTutorial(int id, int texture) {

        super(id);

        setCreativeTab(CreativeTabs.tabBlock);

       

    }

   

    public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)

    {

        super.updateTick(par1World, par2, par3, par4, par5Random);

    }

   

        public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)

        {

            byte b0 = 0;

            byte b1 = 0;

 

            if (par1World.getBlockId(par2 - 1, par3, par4) == Block.sandStone.blockID || par1World.getBlockId(par2 + 1, par3, par4) == Block.sandStone.blockID)

            {

                b0 = 1;

            }

 

            if (par1World.getBlockId(par2, par3, par4 - 1) == Block.sandStone.blockID || par1World.getBlockId(par2, par3, par4 + 1) == Block.sandStone.blockID)

            {

                b1 = 1;

            }

 

            if (b0 == b1)

            {

                return false;

            }

            else

            {

                if (par1World.getBlockId(par2 - b0, par3, par4 - b1) == 0)

                {

                    par2 -= b0;

                    par4 -= b1;

                }

 

                int l;

                int i1;

 

                for (l = -1; l <= 2; ++l)

                {

                    for (i1 = -1; i1 <= 3; ++i1)

                    {

                        boolean flag = l == -1 || l == 2 || i1 == -1 || i1 == 3;

 

                        if (l != -1 && l != 2 || i1 != -1 && i1 != 3)

                        {

                            int j1 = par1World.getBlockId(par2 + b0 * l, par3 + i1, par4 + b1 * l);

 

                            if (flag)

                            {

                                if (j1 != Block.sandStone.blockID)

                                {

                                    return false;

                                }

                            }

                            else if (j1 != 0 && j1 != Block.fire.blockID)

                            {

                                return false;

                            }

                        }

                    }

                }

             

                for (l = 0; l < 2; ++l)

                {

                    for (i1 = 0; i1 < 3; ++i1)

                    {

                        par1World.setBlockAndMetadataWithNotify(par2 + b0 * l, par3 + i1, par4 + b1 * l, mod_Main.portalMod.blockID, 0, 2);

                    }

                }

 

                return true;

            }

        }

       

        public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)

        {

            byte b0 = 0;

            byte b1 = 1;

 

            if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID)

            {

                b0 = 1;

                b1 = 0;

            }

 

            int i1;

 

            for (i1 = par3; par1World.getBlockId(par2, i1 - 1, par4) == this.blockID; --i1)

            {

                ;

            }

 

            if (par1World.getBlockId(par2, i1 - 1, par4) != Block.sandStone.blockID)

            {

                par1World.func_94571_i(par2, par3, par4);

            }

            else

            {

                int j1;

 

                for (j1 = 1; j1 < 4 && par1World.getBlockId(par2, i1 + j1, par4) == this.blockID; ++j1)

                {

                    ;

                }

 

                if (j1 == 3 && par1World.getBlockId(par2, i1 + j1, par4) == Block.sandStone.blockID)

                {

                    boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID;

                    boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID;

 

                    if (flag && flag1)

                    {

                        par1World.func_94571_i(par2, par3, par4);

                    }

                    else

                    {

                        if ((par1World.getBlockId(par2 + b0, par3, par4 + b1) != Block.sandStone.blockID || par1World.getBlockId(par2 - b0, par3, par4 - b1) != this.blockID) && (par1World.getBlockId(par2 - b0, par3, par4 - b1) != Block.sandStone.blockID || par1World.getBlockId(par2 + b0, par3, par4 + b1) != this.blockID))

                        {

                            par1World.func_94571_i(par2, par3, par4);

                        }

                    }

                }

                else

                {

                    par1World.func_94571_i(par2, par3, par4);

                }

            }

        }

       

        public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5)

        {

                if ((var5.ridingEntity == null) && (var5.riddenByEntity == null) && ((var5 instanceof EntityPlayerMP)))

                {

                        EntityPlayerMP var6 = (EntityPlayerMP)var5;

                        ModLoader.getMinecraftServerInstance(); MinecraftServer mServer = MinecraftServer.getServer();

 

                        if (var6.timeUntilPortal > 0)

                        {

                                var6.timeUntilPortal = 10;

                        } else if (var6.dimension != 20)

                        {

                                var6.timeUntilPortal = 10;

 

                                var6.mcServer.getConfigurationManager().transferPlayerToDimension(var6, 20, new TeleporterMod(mServer.worldServerForDimension(mod_Main.dimension)));

                        }

                        else {

                                var6.timeUntilPortal = 10;

                                var6.mcServer.getConfigurationManager().transferPlayerToDimension(var6, 0, new TeleporterMod(mServer.worldServerForDimension(1)));

                        }

                }

        }

 

 

}

 

 

 

 

mod_Main

 

package net.minecraft.src;

 

 

 

 

import java.util.Random;

 

import net.minecraft.block.Block;

import net.minecraft.block.BlockStone;

import net.minecraft.block.material.Material;

import net.minecraft.client.renderer.texture.IconRegister;

import net.minecraft.util.Icon;

import net.minecraft.world.World;

import net.minecraft.world.chunk.IChunkProvider;

import net.minecraftforge.common.DimensionManager;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

import cpw.mods.fml.relauncher.Side;

import cpw.mods.fml.relauncher.SideOnly;

 

@Mod(modid = "Nate_MOD", name = "Mod Name", version = "1.0")

@NetworkMod(clientSideRequired = true, serverSideRequired = false)

 

public class mod_Main

{

    public static int dimension = 20;

   

    public static final Block portalMod = new BlockPortalTutorial(4000, 0).setUnlocalizedName("portal");

    public static final Block skyDirt = new Block(4001, Material.ground).setUnlocalizedName("skyDirt").setHardness(0.5F).setStepSound(Block.soundGravelFootstep);

    public static final Block skyGrass = new BlockGrassMod(4002).setUnlocalizedName("skyGrass").setHardness(0.6F).setStepSound(Block.soundGrassFootstep);

    public static final Block granite = (new BlockGranite(4003)).setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("granite");

    public static final Block graniteCobble = new Block(4004, Material.rock).setUnlocalizedName("graniteCobble").setHardness(2F).setResistance(5F);

    public static final Block invisible = new Block(4005, Material.rock).setUnlocalizedName("invisible").setHardness(2F).setResistance(5F);

 

 

 

 

 

 

   

    @SideOnly(Side.CLIENT)

    private Icon field_94385_a;

    @SideOnly(Side.CLIENT)

    private Icon field_94384_b;

   

@Init

public void load(FMLInitializationEvent event)

{

    GameRegistry.registerBlock(invisible, "invisibleasdf");

    LanguageRegistry.addName(invisible, "asd");

   

    GameRegistry.registerBlock(graniteCobble, "granitesdf");

    LanguageRegistry.addName(graniteCobble, "Granite Cobblestone");

   

    GameRegistry.registerBlock(granite, "granitesasddfee");

    LanguageRegistry.addName(granite, "Granite");

 

    GameRegistry.registerBlock(skyDirt, "sky_dirt");

    LanguageRegistry.addName(skyDirt, "Sky Dirt");

   

    GameRegistry.registerBlock(skyGrass, "sky_grass");

    LanguageRegistry.addName(skyGrass, "Sky Grass");

   

   

   

    GameRegistry.registerBlock(portalMod, "Tutorial_Portal");

    LanguageRegistry.addName(portalMod, "Portal");

   

    DimensionManager.registerProviderType(dimension, WorldProviderMod.class, false);

   

    DimensionManager.registerDimension(dimension, dimension);

 

      int[] blockFireSpreadSpeed = new int[4096];

      int[] blockFlammability = new int[4096];

     

     

 

}

}

 

/*public static void generateSkyWorld(World world, Random random, int i,int j)

{

for(int k = 0; k < 200; k++)

{

int randPosX = i + random.nextInt(20);

int randPosY = random.nextInt(90);

int randPosZ = j + random.nextInt(20);

(new WorldGenMinableDirt(mod_Main.granite.blockID, 10)).generate(world, random, randPosX, randPosY, randPosZ);

}

}

}

*/

 

 

 

 

 

If anyone would like to see any more of my code, please let me know, I could use as much help as possible.

 

 

ERROR CODE

 

Generated 3/23/13 12:16 AM

 

-- Head --

Stacktrace:

    at net.minecraft.world.World.getBlockMaterial(World.java:589)

    at net.minecraft.world.SpawnerAnimals.canCreatureTypeSpawnAtLocation(SpawnerAnimals.java:235)

    at net.minecraft.world.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:142)

    at net.minecraft.world.WorldServer.tick(WorldServer.java:177)

 

-- Affected level --

Details:

    Level name: New World

    All players: 1 total; [EntityPlayerMP['Player842'/558, l='New World', x=160.86, y=49.51, z=270.45]]

    Chunk stats: ServerChunkCache: 441 Drop: 0

    Level seed: -7919778429701401543

    Level generator: ID 00 - default, ver 1. Features enabled: false

    Level generator options:

    Level spawn location: World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

    Level time: 0 game time, 0 day time

    Level dimension: 0

    Level storage version: 0x00000 - Unknown?

    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

    Level game mode: ~~ERROR~~ NullPointerException: null

Stacktrace:

    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:640)

    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)

    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)

    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

 

-- System Details --

Details:

    Minecraft Version: 1.5

    Operating System: Windows 7 (x86) version 6.1

    Java Version: 1.7.0_09, Oracle Corporation

    Java VM Version: Java HotSpot™ Client VM (mixed mode), Oracle Corporation

    Memory: 787840440 bytes (751 MB) / 1046937600 bytes (998 MB) up to 1046937600 bytes (998 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    AABB Pool Size: 19903 (1114568 bytes; 1 MB) allocated, 0 (0 bytes; 0 MB) used

    Suspicious classes: FML and Forge are installed

    IntCache: cache: 0, tcache: 0, allocated: 3, tallocated: 63

    FML: MCP v7.42 FML v5.0.24.582 Minecraft Forge 7.7.0.582 4 mods loaded, 4 mods active

    mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Nate_MOD [Mod Name] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

    Profiler Position: N/A (disabled)

    Vec3 Pool Size: 1246 (69776 bytes; 0 MB) allocated, 998 (55888 bytes; 0 MB) used

    Player Count: 1 / 8; [EntityPlayerMP['Player842'/558, l='New World', x=160.86, y=49.51, z=270.45]]

    Type: Integrated Server (map_client.txt)

    Is Modded: Definitely; Client brand changed to 'forge,fml'

 

java.lang.NullPointerException

    at net.minecraft.world.World.getBlockMaterial(World.java:589)

    at net.minecraft.world.SpawnerAnimals.canCreatureTypeSpawnAtLocation(SpawnerAnimals.java:235)

    at net.minecraft.world.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:142)

    at net.minecraft.world.WorldServer.tick(WorldServer.java:177)

    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:640)

    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:570)

    at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:127)

    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:468)

    at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16)

--- END ERROR REPORT f6aff754 ----------

 

 

 

 

 

And I am using forge for minecraft 1.5

Link to comment
Share on other sites

Oh here, sorry  :-[ lol        WorldProviderMod

package net.minecraft.src;

 

import net.minecraft.world.WorldProvider;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.biome.WorldChunkManagerHell;

import net.minecraft.world.chunk.IChunkProvider;

 

public class WorldProviderMod extends WorldProvider{

 

 

public String getDimensionName() {

return "mod";

}

 

public void registerWorldChunkManager()

{

this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.SkyWorld, 0.8F, 0.1F);

this.dimensionId = mod_Main.dimension;

}

 

public boolean canRespawnHere()

{

return true;

}

 

 

public IChunkProvider createChunkGenerator()

{

return new ChunkProviderMod(worldObj, worldObj.getSeed());

}

 

    public float getCloudHeight()

    {

        return 8.0F;

    }

 

}

 

 

 

 

ChunkProviderMod

package net.minecraft.src;

 

import java.util.List;

import java.util.Random;

import net.minecraft.block.Block;

import net.minecraft.block.BlockSand;

import net.minecraft.entity.EnumCreatureType;

import net.minecraft.util.IProgressUpdate;

import net.minecraft.util.MathHelper;

import net.minecraft.world.ChunkPosition;

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

 

import net.minecraftforge.common.*;

import net.minecraftforge.event.Event.*;

import net.minecraftforge.event.terraingen.*;

 

public class ChunkProviderMod implements IChunkProvider

{

    private Random endRNG;

    private NoiseGeneratorOctaves noiseGen1;

    private NoiseGeneratorOctaves noiseGen2;

    private NoiseGeneratorOctaves noiseGen3;

    public NoiseGeneratorOctaves noiseGen4;

    public NoiseGeneratorOctaves noiseGen5;

    private World endWorld;

    private double[] densities;

 

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

    private BiomeGenBase[] biomesForGeneration;

    double[] noiseData1;

    double[] noiseData2;

    double[] noiseData3;

    double[] noiseData4;

    double[] noiseData5;

    int[][] field_73203_h = new int[32][32];

 

    public ChunkProviderMod(World par1World, long par2)

    {

        this.endWorld = par1World;

        this.endRNG = new Random(par2);

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

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

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

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

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

 

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

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

        this.noiseGen1 = noiseGens[0];

        this.noiseGen2 = noiseGens[1];

        this.noiseGen3 = noiseGens[2];

        this.noiseGen4 = noiseGens[3];

        this.noiseGen5 = noiseGens[4];

  }

 

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

    {

        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 = Block.stone.blockID;

                                }

 

                                par3ArrayOfByte[j2] = (byte)l2;

                                j2 += short1;

                                d15 += d16;

                            }

 

                            d10 += d12;

                            d11 += d13;

                        }

 

                        d1 += d5;

                        d2 += d6;

                        d3 += d7;

                        d4 += d8;

                    }

                }

            }

        }

    }

 

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

    {

        ChunkProviderEvent.ReplaceBiomeBlocks event = new ChunkProviderEvent.ReplaceBiomeBlocks(this, par1, par2, par3ArrayOfByte, par4ArrayOfBiomeGenBase);

        MinecraftForge.EVENT_BUS.post(event);

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

 

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

        {

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

            {

                byte b0 = 1;

                int i1 = -1;

                byte b1 = (byte)Block.grass.blockID;

                byte b2 = (byte)Block.stone.blockID;

 

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

                {

                    int k1 = (l * 16 + k) * 128 + j1;

                    byte b3 = par3ArrayOfByte[k1];

 

                    if (b3 == 0)

                    {

                        i1 = -1;

                    }

                    else if (b3 == Block.stone.blockID)

                    {

                        if (i1 == -1)

                        {

                            if (b0 <= 0)

                            {

                                b1 = 0;

                                b2 = (byte)Block.dirt.blockID;

                            }

 

                            i1 = b0;

 

                            if (j1 >= 0)

                            {

                                par3ArrayOfByte[k1] = b1;

                            }

                            else

                            {

                                par3ArrayOfByte[k1] = b2;

                            }

                        }

                        else if (i1 > 0)

                        {

                            --i1;

                            par3ArrayOfByte[k1] = b2;

                        }

                    }

                }

            }

        }

    }

 

    /**

    * loads or generates the chunk at the chunk location specified

    */

    public Chunk loadChunk(int par1, int par2)

    {

        return this.provideChunk(par1, par2);

    }

 

    /**

    * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the

    * specified chunk from the map seed and chunk seed

    */

    public Chunk provideChunk(int par1, int par2)

    {

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

        byte[] abyte = new byte[32768];

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

        this.generateTerrain(par1, par2, abyte, this.biomesForGeneration);

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

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

        byte[] abyte1 = chunk.getBiomeArray();

 

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

        {

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

        }

 

        chunk.generateSkylightMap();

        return chunk;

    }

 

    /**

    * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the

    * size.

    */

    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 = 1F;

 

                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;

    }

 

    /**

    * Checks to see if a chunk exists at x, y

    */

    public boolean chunkExists(int par1, int par2)

    {

        return true;

    }

 

    /**

    * Populates chunk with ores etc etc

    */

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

    {

        BlockSand.fallInstantly = true;

 

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

 

 

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

 

        BlockSand.fallInstantly = false;

    }

 

    /**

    * Two modes of operation: if passed true, save all Chunks in one go.  If passed false, save up to two chunks.

    * Return true if all chunks have been saved.

    */

    public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate)

    {

        return true;

    }

 

    /**

    * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.

    */

    public boolean unloadQueuedChunks()

    {

        return false;

    }

 

    /**

    * Returns if the IChunkProvider supports saving.

    */

    public boolean canSave()

    {

        return true;

    }

 

    /**

    * Converts the instance data to a readable string.

    */

    public String makeString()

    {

        return "RandomLevelSource";

    }

 

    /**

    * Returns a list of creatures of the specified type that can spawn at the given location.

    */

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

    {

        BiomeGenBase biomegenbase = this.endWorld.getBiomeGenForCoords(par2, par4);

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

    }

 

    /**

    * Returns the location of the closest structure of the specified type. If not found returns null.

    */

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

    {

        return null;

    }

 

    public int getLoadedChunkCount()

    {

        return 0;

    }

 

    public void recreateStructures(int par1, int par2) {}

}

 

 

 

And I don't think I have the chunkmanager and the genlayer.

 

 

And this is what it looks like s far, but I want to replace the grass and dirt and stone with my own version of them.

Link to comment
Share on other sites

When I tried that, this is what it gave me, uHBhSGH.png

 

WorldGenMod

package net.minecraft.world.biome;

 

import net.minecraft.block.Block;

import net.minecraft.entity.monster.EntityEnderman;

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

import net.minecraft.src.BiomeDecoratorMod;

 

public class BiomeGenMod extends BiomeGenBase

{

    protected BiomeGenMod(int par1)

    {

        super(par1);

       

       

        this.spawnableMonsterList.clear();

        this.spawnableCreatureList.clear();

        this.spawnableWaterCreatureList.clear();

        this.spawnableCaveCreatureList.clear();

        this.topBlock = (byte)Block.skyGrass.blockID;

        this.fillerBlock = (byte)Block.skyDirt.blockID;

        this.theBiomeDecorator.treesPerChunk = 1;

        this.theBiomeDecorator.flowersPerChunk = 4;

        this.theBiomeDecorator.grassPerChunk = 4;

        this.theBiomeDecorator = new BiomeDecoratorMod(this);

    }

}

 

 

Link to comment
Share on other sites

It isn't a good idea, to change your ChunkProvider class.

 

One reason is that SpawnerAnimals is being used.

 

I have encountered this error before, so you might not want to remove that specific line of code.

 

I think it is

 

public void decorate()

{

 

}

 

Don't edit ANYTHING in it.

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

 Share



×
×
  • Create New...

Important Information

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