Readded the Quagmire

This commit is contained in:
Adubbz 2014-01-10 20:12:25 +11:00
parent ebc31d1fb6
commit e3244afa65
5 changed files with 119 additions and 107 deletions

View file

@ -1,90 +1,116 @@
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.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.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
public class BiomeGenQuagmire extends BOPBiome public class BiomeGenQuagmire extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.2F, 0.3F);
public BiomeGenQuagmire(int par1) public BiomeGenQuagmire(int id)
{ {
super(par1); super(id);
/*
spawnableCreatureList.clear(); //TODO: setHeight()
spawnableWaterCreatureList.clear(); this.func_150570_a(biomeHeight);
topBlock = (byte)Blocks.mud.get().blockID; //TODO: setColor()
fillerBlock = (byte)Blocks.mud.get().blockID; this.setColor(5257771);
theBiomeDecorator = new BiomeDecoratorBOP(this); this.setTemperatureRainfall(0.8F, 0.9F);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 0; this.spawnableCreatureList.clear();
customBiomeDecorator.grassPerChunk = 10; this.spawnableWaterCreatureList.clear();
customBiomeDecorator.mushroomsPerChunk = 3;
customBiomeDecorator.flowersPerChunk = -999; this.waterColorMultiplier = 13390080;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999; this.topBlock = BOPBlockHelper.get("mud");
customBiomeDecorator.wheatGrassPerChunk = 3; this.fillerBlock = BOPBlockHelper.get("mud");
customBiomeDecorator.waterReedsPerChunk = 2; this.theBiomeDecorator.treesPerChunk = 0;
customBiomeDecorator.koruPerChunk = 1; this.theBiomeDecorator.grassPerChunk = 10;
waterColorMultiplier = 13390080; this.theBiomeDecorator.mushroomsPerChunk = 3;
customBiomeDecorator.generateQuagmire = true; this.theBiomeDecorator.flowersPerChunk = -999;
*/ this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.waterReedsPerChunk = 2;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.generateQuagmire = true;
} }
/*
@Override @Override
public void decorate(World par1World, Random par2Random, int par3, int par4) //TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{ {
super.decorate(par1World, par2Random, par3, par4); return new WorldGenDeadTree1(false, Blocks.dirt, Blocks.grass, BOPBlockHelper.get("driedDirt"), BOPBlockHelper.get("mud"));
int var5 = 12 + par2Random.nextInt(6); }
@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);
Block block = Block.blocksList[var10]; //TODO: getBlock()
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{ {
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 10, 2); //TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 10, 2);
} }
} }
} }
*/
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override @Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random) //TODO: getBiomeGrassColor()
{ public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
return new WorldGenDeadTree(false);
}
*/
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeGrassColor()
{
return 10390377;
}
*/
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeFoliageColor()
{ {
return 10390377; return 10390377;
} }
@Override @Override
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 10390377;
}
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors) return 12436670;
else return super.getSkyColorByTemp(par1);
}
/*@Override
public int getFogColour() public int getFogColour()
{ {
return 13291213; return 13291213;
@ -97,32 +123,4 @@ public class BiomeGenQuagmire extends BOPBiome
return 0.6F; return 0.6F;
} }
*/ */
/**
* takes temperature, returns color
*/
/*
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 12436670;
else
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
*/
} }

View file

@ -43,6 +43,7 @@ import biomesoplenty.common.biomes.BiomeGenOriginValley;
import biomesoplenty.common.biomes.BiomeGenOutback; import biomesoplenty.common.biomes.BiomeGenOutback;
import biomesoplenty.common.biomes.BiomeGenPasture; import biomesoplenty.common.biomes.BiomeGenPasture;
import biomesoplenty.common.biomes.BiomeGenPrairie; import biomesoplenty.common.biomes.BiomeGenPrairie;
import biomesoplenty.common.biomes.BiomeGenQuagmire;
import biomesoplenty.common.biomes.BiomeGenRainforest; import biomesoplenty.common.biomes.BiomeGenRainforest;
import biomesoplenty.common.biomes.BiomeGenSacredSprings; import biomesoplenty.common.biomes.BiomeGenSacredSprings;
import biomesoplenty.common.biomes.BiomeGenShrubland; import biomesoplenty.common.biomes.BiomeGenShrubland;
@ -128,7 +129,7 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT)); 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 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 BiomeGenQuagmire(BOPConfigurationIDs.quagmireID).setBiomeName("Quagmire"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenRainforest(BOPConfigurationIDs.rainforestID).setBiomeName("Rainforest"), 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));*/ /*registerBiome(new BOPBiomeListEntry(new BiomeGenRedwoodForest(BOPConfigurationIDs.redwoodForestID).setBiomeName("Redwood Forest"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenSacredSprings(BOPConfigurationIDs.sacredSpringsID).setBiomeName("Sacred Springs"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenSacredSprings(BOPConfigurationIDs.sacredSpringsID).setBiomeName("Sacred Springs"), BOPBiomeTemperatureType.WARM));

View file

@ -8,6 +8,7 @@ public class BOPWorldFeatures
public boolean generateStoneInGrass = false; public boolean generateStoneInGrass = false;
public boolean generateGrass = false; public boolean generateGrass = false;
public boolean generateSand = false; public boolean generateSand = false;
public boolean generateQuagmire = false;
public int waterPoolsPerChunk = 0; public int waterPoolsPerChunk = 0;
public int lavaPoolsPerChunk = 0; public int lavaPoolsPerChunk = 0;

View file

@ -149,6 +149,17 @@ public class WorldGenSplotches extends WorldGeneratorBOP
int randY = random.nextInt(128); int randY = random.nextInt(128);
int randZ = z + random.nextInt(16); int randZ = z + random.nextInt(16);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
else if (fieldName.equals("generateQuagmire") && bopDecoration.getWorldFeatures().generateQuagmire)
{
for (int i = 0; i < 15; ++i)
{
int randX = x + random.nextInt(16);
int randY = random.nextInt(64) + 64;
int randZ = z + random.nextInt(16);
worldGenerator.generate(world, random, randX, randY, randZ); worldGenerator.generate(world, random, randX, randY, randZ);
} }
} }

View file

@ -32,6 +32,7 @@ public class WorldGenFieldAssociation
associateField("generateStoneInGrass", new WorldGenSplotches(Blocks.stone, 0, 32, Blocks.grass, BOPBlockHelper.get("holyGrass"))); associateField("generateStoneInGrass", new WorldGenSplotches(Blocks.stone, 0, 32, Blocks.grass, BOPBlockHelper.get("holyGrass")));
associateField("generateGrass", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("redRock"))); associateField("generateGrass", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("redRock")));
associateField("generateSand", new WorldGenSplotches(Blocks.sand, 0, 32, BOPBlockHelper.get("redRock"))); associateField("generateSand", new WorldGenSplotches(Blocks.sand, 0, 32, BOPBlockHelper.get("redRock")));
associateField("generateQuagmire", new WorldGenSplotches(Blocks.grass, 0, 48, BOPBlockHelper.get("mud")));
associateField("waterPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_water)); associateField("waterPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_water));
associateField("lavaPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_lava)); associateField("lavaPoolsPerChunk", new WorldGenLiquids(Blocks.flowing_lava));