Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12] Villages in custom biomes
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 0
JimiIT92

[1.12] Villages in custom biomes

By JimiIT92, July 9, 2017 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

JimiIT92    19

JimiIT92

JimiIT92    19

  • Dragon Slayer
  • JimiIT92
  • Members
  • 19
  • 723 posts
Posted July 9, 2017

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));


            

  • Quote

Share this post


Link to post
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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Itz_Yuseix
      [1.12.2]Problem with armor animation

      By Itz_Yuseix · Posted 11 minutes ago

      Why my armor dont move?
    • Draco18s
      [1.12.2]Double-part block breaking problem

      By Draco18s · Posted 15 minutes ago

      Whassit called... give me a bit to find it.   Oh yeah, they spite it up. getXOffset(), getYOffset(), getZOffset()   You can also use blockpos.offset(facing).
    • diesieben07
      [1-14-newer] how to make a button with a specified texture ?

      By diesieben07 · Posted 29 minutes ago

      I'm sorry, but WHAT?
    • DaemonUmbra
      Forge or mods not working

      By DaemonUmbra · Posted 33 minutes ago

      The filenames of one or more of your mods suggests you got them from a repost site. Please read up on the StopModReposts project (link in my signature) for info on why this is a bad thing.
    • DaemonUmbra
      Forge mod loader detected missing/unknown registry

      By DaemonUmbra · Posted 40 minutes ago

      Please read the Logs section of my signature below and provide the appropriate log in the appropriate manner.
  • Topics

    • Itz_Yuseix
      0
      [1.12.2]Problem with armor animation

      By Itz_Yuseix
      Started 11 minutes ago

    • LorenzoPapi
      10
      [1.12.2]Double-part block breaking problem

      By LorenzoPapi
      Started Friday at 02:51 PM

    • matt1999rd
      12
      [1-14-newer] how to make a button with a specified texture ?

      By matt1999rd
      Started Yesterday at 04:04 PM

    • Aeriona
      1
      Forge or mods not working

      By Aeriona
      Started 43 minutes ago

    • Autoplexa
      1
      Forge mod loader detected missing/unknown registry

      By Autoplexa
      Started 3 hours ago

  • Who's Online (See full list)

    • runescaper
    • TehStoneMan
    • Choonster
    • Aeriona
    • Itz_Yuseix
    • salvestrom
    • diesieben07
    • Lea9ue
    • MisteryMan
    • maxssho13
    • Draco18s
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.12] Villages in custom biomes
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community