Jump to content

Recommended Posts

Posted

I created a custom biome extended from the HIlls Biome. When i register this biome i don't add it to the villages biomes, but for some reason villages still spawns in my biome. How can i avoid this? This is the code for the biome 

 
	package com.mw.world.biome;
	import java.util.Iterator;
import java.util.Random;
	import com.mw.MW;
import com.mw.core.MWBlocks;
import com.mw.world.gen.feature.WorldGenVolcano;
	import net.minecraft.entity.monster.EntityMagmaCube;
import net.minecraft.entity.monster.EntityPolarBear;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.monster.EntityStray;
import net.minecraft.init.Biomes;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeHills;
import net.minecraft.world.chunk.ChunkPrimer;
import net.minecraft.world.gen.feature.WorldGenIceSpike;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraftforge.common.BiomeManager.BiomeType;
	public class BiomeVolcano extends BiomeHills{
    private WorldGenLakes LAKES = new WorldGenLakes(Blocks.LAVA);
    
    public BiomeVolcano() {
        super(BiomeHills.Type.NORMAL, new BiomeProperties("Volcano").setTemperature(10.0F).setBaseHeight(1.0F).setHeightVariation(0.1F));
        this.topBlock = Blocks.COAL_BLOCK.getDefaultState();
        this.fillerBlock = MWBlocks.LAVA_ROCK.getDefaultState();
        this.spawnableCreatureList.clear();
        this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityMagmaCube.class, 10, 1, 4));
    }
    
    @Override
    public int getSkyColorByTemp(float currentTemperature) {
        return 0xFF0000;
    }
    
    @Override
    public void decorate(World worldIn, Random rand, BlockPos pos) {
        super.decorate(worldIn, rand, pos);
        
        if(net.minecraftforge.event.terraingen.TerrainGen.decorate(worldIn, rand, pos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.LAKE_WATER))
        if (rand.nextInt(5) == 0)
        {
            int i = rand.nextInt(16) + 8;
            int j = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(i, 0, j)).up();
            LAKES.generate(worldIn, rand, blockpos);
        }
        if (rand.nextInt(2) == 0)
        {
            int i = rand.nextInt(16) + 8;
            int j = rand.nextInt(16) + 8;
            BlockPos blockpos = worldIn.getHeight(pos.add(i, 0, j)).up();
            new WorldGenVolcano().generate(worldIn, rand, blockpos);
        }
    }
    
    public void genTerrainBlocks(World worldIn, Random rand, ChunkPrimer chunkPrimerIn, int x, int z, double noiseVal)
    {
        this.generateBiomeTerrain(worldIn, rand, chunkPrimerIn, x, z, noiseVal);
    }
}



And this is how i register it

public static Biome VOLCANO;
VOLCANO = new BiomeVolcano();
VOLCANO.setRegistryName("volcano"); //In the registration event
event.getRegistry().register(VOLCANO); //In the registration event
BiomeManager.addBiome(BiomeType.DESERT, new BiomeManager.BiomeEntry(VOLCANO, 5));


            

Don't blame me if i always ask for your help. I just want to learn to be better :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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