Readded the Meadow

This commit is contained in:
Adubbz 2014-01-09 19:45:06 +11:00
parent 9ed744df02
commit ed244a8364
6 changed files with 107 additions and 76 deletions

View file

@ -60,7 +60,7 @@ public abstract class BOPBiome extends BiomeGenBase implements IBOPDecoration
@Override @Override
public WorldGenerator getRandomWorldGenForGrass(Random random) public WorldGenerator getRandomWorldGenForGrass(Random random)
{ {
if (getWeightedWorldGenForBOPFlowers() != null && !getWeightedWorldGenForGrass().isEmpty()) if (getWeightedWorldGenForGrass() != null && !getWeightedWorldGenForGrass().isEmpty())
{ {
return getRandomWeightedWorldGenerator(getWeightedWorldGenForGrass()); return getRandomWeightedWorldGenerator(getWeightedWorldGenForGrass());
} }

View file

@ -1,82 +1,113 @@
package biomesoplenty.common.biomes; 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.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
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.WorldGenBOPShrub;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
public class BiomeGenMeadow extends BOPBiome public class BiomeGenMeadow extends BOPBiome
{ {
public BiomeGenMeadow(int id)
public BiomeGenMeadow(int par1)
{ {
super(par1); super(id);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this); //TODO: setColor()
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator; this.setColor(6533741);
customBiomeDecorator.treesPerChunk = 2; this.setTemperatureRainfall(0.7F, 0.7F);
customBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.wheatGrassPerChunk = 5; this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6));
customBiomeDecorator.tinyFlowersPerChunk = 14;
customBiomeDecorator.mushroomsPerChunk = 2; this.theBiomeDecorator.treesPerChunk = 2;
customBiomeDecorator.flowersPerChunk = 10; this.theBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.carrotsPerChunk = 1; this.theBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk = -999; this.theBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.sandPerChunk2 = -999; this.theBiomeDecorator.mushroomsPerChunk = 2;
customBiomeDecorator.hydrangeasPerChunk = 3; this.theBiomeDecorator.flowersPerChunk = 10;
customBiomeDecorator.sunflowersPerChunk = 1;
customBiomeDecorator.shrubsPerChunk = 5; this.bopWorldFeatures.bopFlowersPerChunk = 14;
customBiomeDecorator.cloverPatchesPerChunk = 15; this.bopWorldFeatures.wildCarrotsPerChunk = 1;
customBiomeDecorator.generatePumpkins = false; this.bopWorldFeatures.sunflowersPerChunk = 1;
spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); this.bopWorldFeatures.shrubsPerChunk = 5;
*/ this.bopWorldFeatures.cloverPatchesPerChunk = 15;
this.bopWorldFeatures.generatePumpkins = false;
} }
/* @Override
@Override //TODO: getRandomWorldGenForTrees()
public void decorate(World par1World, Random par2Random, int par3, int par4) public WorldGenAbstractTree func_150567_a(Random random)
{ {
super.decorate(par1World, par2Random, par3, par4); return random.nextInt(5) == 0 ? new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 6, 4, 0) : new WorldGenBOPShrub(Blocks.log, Blocks.leaves, 0, 1, Blocks.dirt, Blocks.grass);
int var5 = 12 + par2Random.nextInt(6); }
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 3D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 1D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
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) for (int var6 = 0; var6 < var5; ++var6)
{ {
int var7 = par3 + par2Random.nextInt(16); int x = chunkX + random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4; int y = random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16); int z = chunkZ + random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
Block block = Block.blocksList[var10]; if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) {
{ //TODO: setBlock()
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 4, 2); world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 4, 2);
} }
} }
} }
*/
/** @Override
* Gets a WorldGen appropriate for this biome. //TODO: getBiomeGrassColor()
*/ public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
/* {
@Override return 6533741;
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) }
{
return par1Random.nextInt(5) == 0 ? new WorldGenTaiga2(false) : new WorldGenShrub(0, 1);
}
*/
/** @Override
* Provides the basic grass color based on the biome temperature and rainfall //TODO: getBiomeFoliageColor()
*/ public int func_150571_c(int x, int y, int z)
/* {
@Override return 6533741;
public int getBiomeGrassColor() }
{
return 6533741;
}
@Override
public int getBiomeFoliageColor()
{
return 6533741;
}
*/
} }

View file

@ -34,6 +34,7 @@ import biomesoplenty.common.biomes.BiomeGenLushDesert;
import biomesoplenty.common.biomes.BiomeGenLushSwamp; import biomesoplenty.common.biomes.BiomeGenLushSwamp;
import biomesoplenty.common.biomes.BiomeGenMapleWoods; import biomesoplenty.common.biomes.BiomeGenMapleWoods;
import biomesoplenty.common.biomes.BiomeGenMarsh; import biomesoplenty.common.biomes.BiomeGenMarsh;
import biomesoplenty.common.biomes.BiomeGenMeadow;
import biomesoplenty.common.biomes.BiomeGenMountain; import biomesoplenty.common.biomes.BiomeGenMountain;
import biomesoplenty.common.biomes.BiomeGenOminousWoods; import biomesoplenty.common.biomes.BiomeGenOminousWoods;
import biomesoplenty.common.biomes.BiomeGenPasture; import biomesoplenty.common.biomes.BiomeGenPasture;
@ -113,7 +114,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID).setBiomeName("Lush Swamp"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenLushSwamp(BOPConfigurationIDs.lushSwampID).setBiomeName("Lush Swamp"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenMapleWoods(BOPConfigurationIDs.mapleWoodsID).setBiomeName("Maple Woods"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenMarsh(BOPConfigurationIDs.marshID).setBiomeName("Marsh"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL)); registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL)); //registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenMountain(BOPConfigurationIDs.mountainID).setBiomeName("Mountain"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenMountain(BOPConfigurationIDs.mountainID).setBiomeName("Mountain"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM)); //registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM));

View file

@ -41,6 +41,7 @@ public class BOPWorldFeatures
public int sproutsPerChunk = 0; public int sproutsPerChunk = 0;
public int tinyCactiPerChunk = 0; public int tinyCactiPerChunk = 0;
public int oasesPerChunk = 0; public int oasesPerChunk = 0;
public int sunflowersPerChunk = 0;
public int bopFlowersPerChunk = 0; public int bopFlowersPerChunk = 0;
} }

View file

@ -86,7 +86,7 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
default: default:
i1 = 1 + random.nextInt(2); i1 = 1 + random.nextInt(2);
j1 = l - i1; j1 = l - i1;
k1 = 1 + random.nextInt(2); k1 = 2 + random.nextInt(2);
break; break;
} }

View file

@ -65,10 +65,8 @@ public class WorldGenFieldAssociation
associateField("tinyCactiPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 12)); associateField("tinyCactiPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 12));
associateField("oasesPerChunk", new WorldGenWaterside(Blocks.grass, 7, Blocks.sand, BOPBlockHelper.get("redRock"))); associateField("oasesPerChunk", new WorldGenWaterside(Blocks.grass, 7, Blocks.sand, BOPBlockHelper.get("redRock")));
WorldGenDoublePlant doubleTallGrass = new WorldGenDoublePlant(); associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
//TODO: setMetadata() ? associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));
doubleTallGrass.func_150548_a(2);
associateField("doubleTallGrassPerChunk", doubleTallGrass);
} }
public static void associateField(String fieldName, WorldGenerator generator) public static void associateField(String fieldName, WorldGenerator generator)