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

Custom Dimension sand generator. Broken...


CJCutrone9
 Share

Recommended Posts

And again, I am back. (This place has been a huge help to me. :D) So I am having a problem, I can't make my custom sand generator work in my dimension... Here is the Sand generator for my dimension:

 

 

package net.CJCutrone.LegendofZelda.Dimension;

 

import java.util.Random;

 

import net.CJCutrone.LegendofZelda.common.LegendofZelda;

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.world.World;

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

 

public class WorldGenLegendSand extends WorldGenerator

{

    /** Stores ID for WorldGenSand */

    private int sandID;

 

    /** The maximum radius used when generating a patch of blocks. */

    private int radius;

 

    public WorldGenLegendSand(int par1, int par2)

    {

        this.sandID = par2;

        this.radius = par1 + 8;

    }

 

    public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)

    {

        if (par1World.getBlockMaterial(par3, par4, par5) != Material.water)

        {

            return false;

        }

        else

        {

            int l = par2Random.nextInt(this.radius - 2) + 2;

            byte b0 = 2;

 

            for (int i1 = par3 - l; i1 <= par3 + l; ++i1)

            {

                for (int j1 = par5 - l; j1 <= par5 + l; ++j1)

                {

                    int k1 = i1 - par3;

                    int l1 = j1 - par5;

 

                    if (k1 * k1 + l1 * l1 <= l * l)

                    {

                        for (int i2 = par4 - b0; i2 <= par4 + b0; ++i2)

                        {

                            int j2 = par1World.getBlockId(i1, i2, j1);

 

                            if (j2 == LegendofZelda.LoZDirt.blockID || j2 == LegendofZelda.LoZGrass.blockID)

                            {

                                par1World.setBlock(i1, i2, j1, this.sandID, 0, 2);

                            }

                        }

                    }

                }

            }

 

            return true;

        }

    }

}

 

 

 

And here is the biome I am trying to get it to generate in:

 

 

 

package net.CJCutrone.LegendofZelda.Dimension;

 

import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.FLOWERS;

 

import java.util.Random;

 

import net.CJCutrone.LegendofZelda.common.LegendofZelda;

 

import net.minecraft.block.Block;

import net.minecraft.block.material.Material;

import net.minecraft.entity.monster.EntityCreeper;

import net.minecraft.entity.monster.EntityEnderman;

import net.minecraft.entity.monster.EntitySpider;

import net.minecraft.entity.passive.EntityCow;

import net.minecraft.entity.passive.EntitySheep;

import net.minecraft.entity.passive.EntityWolf;

import net.minecraft.world.World;

import net.minecraft.world.biome.BiomeGenBase;

import net.minecraft.world.biome.SpawnListEntry;

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

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

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

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

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

import net.minecraftforge.event.terraingen.TerrainGen;

 

public class LegendofZeldaDimensionBiome extends BiomeGenBase{

 

 

private Object worldGeneratorTutorialBigTree;

 

public final Material blockMaterial;

public LegendofZeldaDimensionBiome(int par1){

super(par1);

this.blockMaterial = Material.water;

this.minHeight = 0.1F;

this.maxHeight = 0.6F;

this.spawnableMonsterList.clear();

this.spawnableCreatureList.clear();

this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 10, 4, 4));

this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 10, 4, 4));

 

this.spawnableCreatureList.add(new SpawnListEntry(EntityEnderman.class, 20, 4, 4));

this.topBlock = ((byte)252);

this.fillerBlock = ((byte)251);

this.setBiomeName("Legend of Zelda");

this.theBiomeDecorator.treesPerChunk = 5;

        this.theBiomeDecorator.grassPerChunk = 15;

        this.theBiomeDecorator.flowersPerChunk = 0;

     

}

 

public void decorate(World w, Random r, int x, int z)

    {

 

super.decorate(w, r, x, z);

WorldGenFlowers ZeldaTGrass = new WorldGenFlowers(LegendofZelda.ZeldaGrass.blockID);

boolean doGen = TerrainGen.decorate(w, r, x, z, FLOWERS);

        for (int j = 0; doGen && j < 2; ++j)

        {

            int k = x + r.nextInt(16) + 8;

            int l = r.nextInt(128);

            int i1 = z + r.nextInt(16) + 8;

            ZeldaTGrass.generate(w, r, k, l, i1);

        }

       

        WorldGenFlowers ZeldaFlower = new WorldGenFlowers(LegendofZelda.ZeldaFlower.blockID);

boolean doGenF = TerrainGen.decorate(w, r, x, z, FLOWERS);

        for (int j = 0; doGen && j < 10; ++j)

        {

            int k = x + r.nextInt(16) + 8;

            int l = r.nextInt(128);

            int i1 = z + r.nextInt(16) + 8;

            ZeldaFlower.generate(w, r, k, l, i1);

        }

       

        WorldGenFlowers ZeldaFlowerP = new WorldGenFlowers(LegendofZelda.ZeldaFlowerP.blockID);

boolean doGenP = TerrainGen.decorate(w, r, x, z, FLOWERS);

        for (int j = 0; doGen && j < 10; ++j)

        {

            int k = x + r.nextInt(16) + 8;

            int l = r.nextInt(128);

            int i1 = z + r.nextInt(16) + 8;

            ZeldaFlowerP.generate(w, r, k, l, i1);

        }

       

        WorldGenFlowers ZeldaShroom = new WorldGenFlowers(LegendofZelda.ZeldaShroom.blockID);

boolean doGenS = TerrainGen.decorate(w, r, x, z, FLOWERS);

        for (int j = 0; doGen && j < 1; ++j)

        {

            int k = x + r.nextInt(16) + 8;

            int l = r.nextInt(128);

            int i1 = z + r.nextInt(16) + 8;

            ZeldaShroom.generate(w, r, k, l, i1);

        }

       

        WorldGenFlowers ZeldaShroomF = new WorldGenFlowers(LegendofZelda.ZeldaShroomFlip.blockID);

boolean doGenSF = TerrainGen.decorate(w, r, x, z, FLOWERS);

        for (int j = 0; doGen && j < 1; ++j)

        {

            int k = x + r.nextInt(16) + 8;

            int l = r.nextInt(128);

            int i1 = z + r.nextInt(16) + 8;

            ZeldaShroomF.generate(w, r, k, l, i1);

        }

        int rand = r.nextInt(50);

if(rand == 1){

WorldGenPots PotGen = new WorldGenPots();

    for (int j = 0;j < 1; ++j)

    {

        int k = x + r.nextInt(16) + 8;

        int l = r.nextInt(128);

        int i1 = z + r.nextInt(16) + 8;

       

        PotGen.generate(w, r, k, l, i1);

    }

   

    WorldGenLegendSand LoZSand = new WorldGenLegendSand(LegendofZelda.LoZSand.blockID, rand);

   

    for (int j = 0; j < 1; ++j)

    {

        int k = x + r.nextInt(16) + 8;

        int l = r.nextInt(128);

        int i1 = z + r.nextInt(16) + 8;

        LoZSand.generate(w, r, k, l, i1);

    }

}

       

    }

public WorldGenerator getRandomWorldGenForTrees(Random par1Random)

    {

        return (WorldGenerator)(par1Random.nextInt(2) == 0 ? new LegendofZeldaTree() : new DarkWoodTreeGen(true));

    }

 

}

 

 

 

Any help would be GREATLY appreciated.

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