Readded the Wetland and Woodland. 6 remaining.

This commit is contained in:
Adubbz 2014-01-11 23:14:03 +11:00
parent d934a1c9cd
commit 6af747de2e
8 changed files with 292 additions and 158 deletions

View File

@ -52,7 +52,7 @@ public class BiomeGenLushSwamp extends BOPBiome
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return new WorldGenBOPSwampTree(Blocks.log, Blocks.leaves, 0, 0, 8, 6, BOPBlockHelper.get("ivy"));
return new WorldGenBOPSwampTree(Blocks.log, Blocks.leaves, 0, 0, 8, 6, BOPBlockHelper.get("ivy"), -1);
}
@Override

View File

@ -1,133 +1,158 @@
package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenMoss;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenWetland extends BOPBiome
{
private static final Height biomeHeight = new Height(0.3F, 0.5F);
public BiomeGenWetland(int par1)
{
super(par1);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 10;
customBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.wheatGrassPerChunk = 5;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.mushroomsPerChunk = 8;
customBiomeDecorator.toadstoolsPerChunk = 1;
customBiomeDecorator.reedsPerChunk = 15;
customBiomeDecorator.reedsBOPPerChunk = 15;
customBiomeDecorator.clayPerChunk = 2;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.mudPerChunk = 5;
customBiomeDecorator.mudPerChunk2 = 5;
customBiomeDecorator.waterlilyPerChunk = 4;
customBiomeDecorator.lilyflowersPerChunk = 4;
customBiomeDecorator.cattailsPerChunk = 20;
customBiomeDecorator.highCattailsPerChunk = 10;
customBiomeDecorator.blueFlowersPerChunk = 6;
customBiomeDecorator.blueMilksPerChunk = 1;
customBiomeDecorator.portobellosPerChunk = 1;
customBiomeDecorator.berryBushesPerChunk = 1;
customBiomeDecorator.shrubsPerChunk = 10;
customBiomeDecorator.waterReedsPerChunk = 8;
customBiomeDecorator.koruPerChunk = 1;
customBiomeDecorator.cloverPatchesPerChunk = 15;
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
waterColorMultiplier = 6512772;
*/
}
public BiomeGenWetland(int id)
{
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(5215831);
this.setTemperatureRainfall(0.8F, 0.9F);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
//return (WorldGenerator)(par1Random.nextInt(2) == 0 ? new WorldGenWillow2() : (par1Random.nextInt(4) == 0 ? new WorldGenLarch1() : (par1Random.nextInt(2) == 0 ? new WorldGenLarch2() : new WorldGenWillow1())));
return par1Random.nextInt(2) == 0 ? new WorldGenTaiga5(false) : new WorldGenWillow();
}
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
WorldGenMoss var5 = new WorldGenMoss();
int var55 = 12 + par2Random.nextInt(6);
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
for (int var66 = 0; var66 < var55; ++var66)
{
int var77 = par3 + par2Random.nextInt(16);
int var88 = par2Random.nextInt(28) + 4;
int var99 = par4 + par2Random.nextInt(16);
int var100 = par1World.getBlockId(var77, var88, var99);
this.waterColorMultiplier = 6512772;
if (var100 == Block.stone.blockID)
{
par1World.setBlock(var77, var88, var99, Blocks.amethystOre.get().blockID, 10, 2);
}
}
this.theBiomeDecorator.treesPerChunk = 10;
this.theBiomeDecorator.grassPerChunk = 10;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.mushroomsPerChunk = 8;
this.theBiomeDecorator.reedsPerChunk = 15;
this.theBiomeDecorator.clayPerChunk = 2;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.waterlilyPerChunk = 4;
for (int var6 = 0; var6 < 20; ++var6)
{
int var7 = par3 + par2Random.nextInt(16) + 8;
byte var8 = 58;
int var9 = par4 + par2Random.nextInt(16) + 8;
var5.generate(par1World, par2Random, var7, var8, var9);
}
}
*/
this.bopWorldFeatures.toadstoolsPerChunk = 1;
this.bopWorldFeatures.riverCanePerChunk = 15;
this.bopWorldFeatures.mudPerChunk = 5;
this.bopWorldFeatures.cattailsPerChunk = 20;
this.bopWorldFeatures.highCattailsPerChunk = 10;
this.bopWorldFeatures.bopFlowersPerChunk = 6;
this.bopWorldFeatures.blueMilksPerChunk = 1;
this.bopWorldFeatures.portobellosPerChunk = 1;
this.bopWorldFeatures.berryBushesPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 10;
this.bopWorldFeatures.waterReedsPerChunk = 8;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.cloverPatchesPerChunk = 15;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(6) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
*/
@Override
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return random.nextInt(2) == 0 ? new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 9, 9, 6) :
new WorldGenBOPSwampTree(BOPBlockHelper.get("logs3"), BOPBlockHelper.get("colorizedLeaves2"), 1, 0, 6, 9, BOPBlockHelper.get("colorizedLeaves2"), 0);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 1D);
return flowerMap;
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeGrassColor()
{
return 5935967;
}
*/
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
/*
@Override
public int getBiomeFoliageColor()
{
return 5215831;
}
@Override
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, 2), 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 i = 0; i < var5; ++i)
{
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"), 10, 2);
}
}
for (int i = 0; i < 20; i++)
{
int x = chunkX + random.nextInt(16) + 8;
short y = 58;
int z = chunkZ + random.nextInt(16) + 8;
new WorldGenMoss().generate(world, random, x, y, z);
}
}
@Override
//TODO: getBiomeGrassColor()
public int func_150558_b(int x, int y, int z)
{
return 5935967;
}
@Override
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 5215831;
}
/*@Override
public int getFogColour()
{
return 6189472;
}
@Override
public float getFogCloseness()
{
// TODO Auto-generated method stub
return 0.8F;
}
*/
*/
}

View File

@ -1,58 +1,83 @@
package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenWoodland extends BOPBiome
{
public BiomeGenWoodland(int par1)
private static final Height biomeHeight = new Height(0.3F, 0.7F);
public BiomeGenWoodland(int id)
{
super(par1);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 9;
customBiomeDecorator.grassPerChunk = 7;
customBiomeDecorator.mushroomsPerChunk = 4;
customBiomeDecorator.wheatGrassPerChunk = 3;
customBiomeDecorator.toadstoolsPerChunk = 3;
customBiomeDecorator.shrubsPerChunk = 20;
customBiomeDecorator.waterReedsPerChunk = 2;
customBiomeDecorator.cloverPatchesPerChunk = 10;
*/
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(8694061);
this.setTemperatureRainfall(1.7F, 0.2F);
this.theBiomeDecorator.treesPerChunk = 9;
this.theBiomeDecorator.grassPerChunk = 7;
this.theBiomeDecorator.mushroomsPerChunk = 4;
this.bopWorldFeatures.toadstoolsPerChunk = 3;
this.bopWorldFeatures.shrubsPerChunk = 20;
this.bopWorldFeatures.waterReedsPerChunk = 2;
this.bopWorldFeatures.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.logsPerChunk = 10;
}
/*
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + 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);
@Override
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return random.nextInt(10) == 0 ? worldGeneratorBigTree : worldGeneratorTrees;
}
@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);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
{
par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2);
}
}
}
*/
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);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(5) == 0 ? new WorldGenLog() : (par1Random.nextInt(10) == 0 ? worldGeneratorBigTree : worldGeneratorTrees);
}
*/
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 2);
}
}
}
}

View File

@ -55,6 +55,8 @@ import biomesoplenty.common.biomes.BiomeGenThicket;
import biomesoplenty.common.biomes.BiomeGenTimber;
import biomesoplenty.common.biomes.BiomeGenTropicalRainforest;
import biomesoplenty.common.biomes.BiomeGenTundra;
import biomesoplenty.common.biomes.BiomeGenWetland;
import biomesoplenty.common.biomes.BiomeGenWoodland;
import biomesoplenty.common.configuration.BOPConfigurationIDs;
import biomesoplenty.common.world.WorldTypeBOP;
@ -151,11 +153,11 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenTimber(BOPConfigurationIDs.timberID).setBiomeName("Timber"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenTropicalRainforest(BOPConfigurationIDs.tropicalRainforestID).setBiomeName("Tropical Rainforest"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenTropics(BOPConfigurationIDs.tropicsID).setBiomeName("Tropics"), BOPBiomeTemperatureType.HOT));*/
registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY));
registerBiome(new BOPBiomeListEntry(new BiomeGenTundra(BOPConfigurationIDs.tundraID).setBiomeName("Tundra"), BOPBiomeTemperatureType.ICY));
//registerBiome(new BOPBiomeListEntry(new BiomeGenVolcano(BOPConfigurationIDs.volcanoID).setBiomeName("Volcano"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenWasteland(BOPConfigurationIDs.wastelandID).setBiomeName("Wasteland"), BOPBiomeTemperatureType.HOT));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenWetland(BOPConfigurationIDs.wetlandID).setBiomeName("Wetland"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenWoodland(BOPConfigurationIDs.woodlandID).setBiomeName("Woodland"), BOPBiomeTemperatureType.WARM));
}
private static void useOnlyBiome()

View File

@ -49,6 +49,7 @@ public class BOPWorldFeatures
public int rootsPerChunk = 9;
public int grassSplatterPerChunk = 0;
public int rockpilesPerChunk = 0;
public int logsPerChunk = 0;
public int bopFlowersPerChunk = 0;
}

View File

@ -0,0 +1,73 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
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;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenLog extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
//TODO: isAirBlock()
while (!world.func_147437_c(x, y, z) && y > 2)
{
++y;
}
int length = 3 + random.nextInt(3);
int direction = random.nextInt(2);
boolean isAllowed = true;
System.out.println(direction);
for (int i = 0; i < length; i++)
{
int ix = 0;
int iz = 0;
if (direction == 0) ix = i;
else iz = i;
//TODO: isAirBlock() getBlock()
if (!world.func_147437_c(x + ix, y, z + iz) || world.func_147439_a(x + ix, y - 1, z + iz) != Blocks.grass)
{
isAllowed = false;
break;
}
}
if (isAllowed)
{
for (int i = 0; i < length; i++)
{
if (direction == 0) world.func_147465_d(x + i, y, z, Blocks.log, 4, 2);
else world.func_147465_d(x, y, z + i, Blocks.log, 8, 2);
}
return true;
}
return false;
}
@Override
public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception
{
for (int i = 0; i < worldGeneratorField.getInt(bopDecoration.getWorldFeatures()); i++)
{
int randX = x + random.nextInt(16) + 8;
int randZ = z + random.nextInt(16) + 8;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
}

View File

@ -23,12 +23,14 @@ public class WorldGenBOPSwampTree extends WorldGenAbstractTree
private Block vineBlock;
private int vineMeta;
public WorldGenBOPSwampTree(Block wood, Block leaves, int woodMeta, int leavesMeta, int minTreeHeight, int randomTreeHeight)
{
this(wood, leaves, woodMeta, leavesMeta, minTreeHeight, randomTreeHeight, Blocks.vine);
this(wood, leaves, woodMeta, leavesMeta, minTreeHeight, randomTreeHeight, Blocks.vine, -1);
}
public WorldGenBOPSwampTree(Block wood, Block leaves, int woodMeta, int leavesMeta, int minTreeHeight, int randomTreeHeight, Block vineBlock)
public WorldGenBOPSwampTree(Block wood, Block leaves, int woodMeta, int leavesMeta, int minTreeHeight, int randomTreeHeight, Block vineBlock, int vineMeta)
{
super(false);
@ -42,6 +44,8 @@ public class WorldGenBOPSwampTree extends WorldGenAbstractTree
this.randomTreeHeight = randomTreeHeight;
this.vineBlock = vineBlock;
this.vineMeta = vineMeta;
}
@Override
@ -203,6 +207,8 @@ public class WorldGenBOPSwampTree extends WorldGenAbstractTree
private void generateVines(World par1World, int par2, int par3, int par4, int par5)
{
if (vineMeta != -1) par5 = vineMeta;
this.func_150516_a(par1World, par2, par3, par4, vineBlock, par5);
int i1 = 4;

View File

@ -12,6 +12,7 @@ import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenGrassSplatter;
import biomesoplenty.common.world.features.WorldGenLog;
import biomesoplenty.common.world.features.WorldGenRiverCane;
import biomesoplenty.common.world.features.WorldGenRockpile;
import biomesoplenty.common.world.features.WorldGenSplotches;
@ -73,6 +74,7 @@ public class WorldGenFieldAssociation
associateField("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15));
associateField("grassSplatterPerChunk", new WorldGenGrassSplatter());
associateField("rockpilesPerChunk", new WorldGenRockpile());
associateField("logsPerChunk", new WorldGenLog());
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));