Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.