First attempt at a limestone hill / mountain biome
This commit is contained in:
parent
2c40f5d0a2
commit
bfc69183fc
3 changed files with 105 additions and 0 deletions
|
@ -10,6 +10,7 @@ import mmm.utils.UAccessors;
|
|||
import mmm.utils.URegistry;
|
||||
import mmm.utils.USeat;
|
||||
import mmm.world.WOreGenerator;
|
||||
import mmm.world.World;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
|
@ -23,6 +24,7 @@ public abstract class PCommon
|
|||
UAccessors.preInit( );
|
||||
|
||||
Materials.preInit( );
|
||||
World.preInit( );
|
||||
Tech.preInit( );
|
||||
Food.preInit( );
|
||||
DecorativeBlocks.preInit( );
|
||||
|
|
55
src/java/mmm/world/World.java
Normal file
55
src/java/mmm/world/World.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package mmm.world;
|
||||
|
||||
|
||||
import mmm.world.biome.BiomeLimestoneHills;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeHills;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import net.minecraftforge.common.BiomeManager;
|
||||
import net.minecraftforge.common.BiomeManager.BiomeType;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
|
||||
|
||||
public class World
|
||||
{
|
||||
public static final BiomeLimestoneHills BIOME_LIMESTONE_HILLS;
|
||||
public static final BiomeLimestoneHills BIOME_LIMESTONE_HILLS_M;
|
||||
public static final BiomeLimestoneHills BIOME_LIMESTONE_HILLS_EDGE;
|
||||
|
||||
static {
|
||||
BIOME_LIMESTONE_HILLS = new BiomeLimestoneHills( BiomeHills.Type.NORMAL ,
|
||||
new Biome.BiomeProperties( "Limestone Hills" ).setBaseHeight( 1.0F ).setHeightVariation( 0.5F )
|
||||
.setTemperature( 0.2F ).setRainfall( 0.3F ) );
|
||||
World.BIOME_LIMESTONE_HILLS.setRegistryName( "mmm:biome/limestone_hills" );
|
||||
GameRegistry.register( World.BIOME_LIMESTONE_HILLS );
|
||||
BiomeManager.addBiome( BiomeType.COOL , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS , 2 ) );
|
||||
BiomeManager.addBiome( BiomeType.WARM , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS , 2 ) );
|
||||
BiomeDictionary.makeBestGuess( World.BIOME_LIMESTONE_HILLS );
|
||||
|
||||
BIOME_LIMESTONE_HILLS_M = new BiomeLimestoneHills( BiomeHills.Type.MUTATED ,
|
||||
new Biome.BiomeProperties( "Limestone Hills M" ).setBaseBiome( "mmm:biome/limestone_hills" )
|
||||
.setBaseHeight( 1.0F ).setHeightVariation( 0.5F ).setTemperature( 0.2F ).setRainfall( 0.3F ) );
|
||||
World.BIOME_LIMESTONE_HILLS_M.setRegistryName( "mmm:biome/limestone_hills_m" );
|
||||
GameRegistry.register( World.BIOME_LIMESTONE_HILLS_M );
|
||||
BiomeManager.addBiome( BiomeType.COOL , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS_M , 2 ) );
|
||||
BiomeManager.addBiome( BiomeType.WARM , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS_M , 2 ) );
|
||||
BiomeDictionary.makeBestGuess( World.BIOME_LIMESTONE_HILLS_M );
|
||||
|
||||
BIOME_LIMESTONE_HILLS_EDGE = new BiomeLimestoneHills( BiomeHills.Type.EXTRA_TREES ,
|
||||
( new Biome.BiomeProperties( "Limestone Hills Edge" ) ).setBaseHeight( 0.8F ).setHeightVariation( 0.3F )
|
||||
.setTemperature( 0.2F ).setRainfall( 0.3F ) );
|
||||
World.BIOME_LIMESTONE_HILLS_EDGE.setRegistryName( "mmm:biome/limestone_hills_edge" );
|
||||
GameRegistry.register( World.BIOME_LIMESTONE_HILLS_EDGE );
|
||||
BiomeManager.addBiome( BiomeType.COOL , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS_EDGE , 5 ) );
|
||||
BiomeManager.addBiome( BiomeType.WARM , new BiomeManager.BiomeEntry( BIOME_LIMESTONE_HILLS_EDGE , 5 ) );
|
||||
BiomeDictionary.makeBestGuess( World.BIOME_LIMESTONE_HILLS_EDGE );
|
||||
}
|
||||
|
||||
|
||||
public static void preInit( )
|
||||
{
|
||||
// EMPTY
|
||||
}
|
||||
|
||||
}
|
48
src/java/mmm/world/biome/BiomeLimestoneHills.java
Normal file
48
src/java/mmm/world/biome/BiomeLimestoneHills.java
Normal file
|
@ -0,0 +1,48 @@
|
|||
package mmm.world.biome;
|
||||
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import mmm.materials.Materials;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeHills;
|
||||
import net.minecraft.world.chunk.ChunkPrimer;
|
||||
|
||||
|
||||
|
||||
public class BiomeLimestoneHills
|
||||
extends BiomeHills
|
||||
{
|
||||
|
||||
private final Type type;
|
||||
|
||||
|
||||
public BiomeLimestoneHills( final BiomeHills.Type type , final Biome.BiomeProperties properties )
|
||||
{
|
||||
super( type , properties );
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void genTerrainBlocks( final World worldIn , final Random rand , final ChunkPrimer chunkPrimerIn ,
|
||||
final int x , final int z , final double noiseVal )
|
||||
{
|
||||
System.err.println( "gen at " + x + " / " + z );
|
||||
if ( this.type == BiomeHills.Type.EXTRA_TREES ) {
|
||||
this.topBlock = Blocks.GRASS.getDefaultState( );
|
||||
this.fillerBlock = Materials.ROCK_LIMESTONE.getDefaultState( );
|
||||
} else if ( ( noiseVal < -1.0D || noiseVal > 2.0D ) && this.type == BiomeHills.Type.MUTATED ) {
|
||||
this.topBlock = Blocks.GRAVEL.getDefaultState( );
|
||||
this.fillerBlock = Blocks.GRAVEL.getDefaultState( );
|
||||
} else {
|
||||
this.topBlock = Materials.ROCK_LIMESTONE.getDefaultState( );
|
||||
this.fillerBlock = Materials.ROCK_LIMESTONE.getDefaultState( );
|
||||
}
|
||||
|
||||
this.generateBiomeTerrain( worldIn , rand , chunkPrimerIn , x , z , noiseVal );
|
||||
}
|
||||
|
||||
}
|
Reference in a new issue