Readded the Prairie

This commit is contained in:
Adubbz 2014-01-10 18:50:38 +11:00
parent 46a550e576
commit 45271b33f8
3 changed files with 102 additions and 75 deletions

View File

@ -1,91 +1,111 @@
package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
public class BiomeGenPrairie extends BOPBiome
{
public BiomeGenPrairie(int par1)
private static final Height biomeHeight = new Height(0.3F, 0.4F);
public BiomeGenPrairie(int id)
{
super(par1);
/*
customBiomeDecorator.treesPerChunk = 1;
customBiomeDecorator.grassPerChunk = 999;
customBiomeDecorator.whiteFlowersPerChunk = 20;
customBiomeDecorator.goldenrodsPerChunk = 40;
customBiomeDecorator.portobellosPerChunk = 2;
customBiomeDecorator.berryBushesPerChunk = 2;
customBiomeDecorator.wheatGrassPerChunk = 25;
customBiomeDecorator.shrubsPerChunk = 3;
customBiomeDecorator.waterReedsPerChunk = 4;
spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));
*/
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(13165952);
this.setTemperatureRainfall(0.9F, 0.6F);
this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));
this.theBiomeDecorator.treesPerChunk = 1;
this.theBiomeDecorator.grassPerChunk = 999;
this.bopWorldFeatures.bopFlowersPerChunk = 30;
this.bopWorldFeatures.portobellosPerChunk = 2;
this.bopWorldFeatures.berryBushesPerChunk = 2;
this.bopWorldFeatures.shrubsPerChunk = 3;
this.bopWorldFeatures.waterReedsPerChunk = 4;
}
/*
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 12 + par2Random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6)
{
int var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 4, 2);
}
}
}
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return new WorldGenPrairie(false);
}
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return (par1Random.nextInt(5) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 1) : (par1Random.nextInt(3) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1)));
}
*/
@Override
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 0, 0, false, 6, 1, 7);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 4), 1D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 0.5D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
return grassMap;
}
@Override
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6)
{
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 4, 2);
}
}
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeGrassColor()
{
//TODO: getBiomeGrassColor()
public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
{
return 13165952;
}
*/
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeFoliageColor()
{
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 11395195;
}
*/
}

View File

@ -42,6 +42,7 @@ import biomesoplenty.common.biomes.BiomeGenOminousWoods;
import biomesoplenty.common.biomes.BiomeGenOriginValley;
import biomesoplenty.common.biomes.BiomeGenOutback;
import biomesoplenty.common.biomes.BiomeGenPasture;
import biomesoplenty.common.biomes.BiomeGenPrairie;
import biomesoplenty.common.biomes.BiomeGenRainforest;
import biomesoplenty.common.biomes.BiomeGenSacredSprings;
import biomesoplenty.common.biomes.BiomeGenShrubland;
@ -126,7 +127,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenPasture(BOPConfigurationIDs.pastureID).setBiomeName("Pasture"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenRainforest(BOPConfigurationIDs.rainforestID).setBiomeName("Rainforest"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenRedwoodForest(BOPConfigurationIDs.redwoodForestID).setBiomeName("Redwood Forest"), BOPBiomeTemperatureType.WARM));*/

View File

@ -82,6 +82,12 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
j1 = l - i1;
k1 = 2 + random.nextInt(2);
break;
case 7:
i1 = 2;
j1 = l - i1;
k1 = 3;
break;
default:
i1 = 1 + random.nextInt(2);