Readded a few biomes, heavily altered the existing decoration system to be more configurable

This commit is contained in:
Adubbz 2014-01-07 00:26:39 +11:00
parent 2e7d567e3e
commit 49eeb93534
43 changed files with 1270 additions and 442 deletions

View file

@ -13,9 +13,10 @@ import biomesoplenty.common.core.BOPVanillaCompat;
import biomesoplenty.common.eventhandler.BOPCommonEventHandlers;
import biomesoplenty.common.helpers.CreativeTabsBOP;
import biomesoplenty.common.utils.BOPModInfo;
import biomesoplenty.common.world.WorldGenFieldAssociation;
import biomesoplenty.common.world.WorldTypeBOP;
import biomesoplenty.common.world.decoration.ForcedDecorators;
import biomesoplenty.common.world.generation.ForcedBOPWorldGenerators;
import biomesoplenty.common.world.generation.WorldGenFieldAssociation;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
@ -53,6 +54,7 @@ public class BiomesOPlenty
BOPCrafting.init();
BOPBiomes.init();
WorldGenFieldAssociation.init();
ForcedBOPWorldGenerators.init();
ForcedDecorators.init();
BOPEntities.init();
BOPVanillaCompat.init();

View file

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

View file

@ -32,12 +32,12 @@ public class BiomeGenBambooForest extends BOPBiome
this.theBiomeDecorator.grassPerChunk = 5;
this.theBiomeDecorator.flowersPerChunk = -999;
this.bopWorldFeatures.perChunk.riverCanePerChunk = 6;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 6;
this.bopWorldFeatures.perChunk.bushesPerChunk = 5;
this.bopWorldFeatures.perChunk.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.riverCanePerChunk = 6;
this.bopWorldFeatures.shrubsPerChunk = 6;
this.bopWorldFeatures.bushesPerChunk = 5;
this.bopWorldFeatures.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.doGeneration.generatePumpkins = false;
this.bopWorldFeatures.generatePumpkins = false;
}
@Override

View file

@ -1,89 +1,98 @@
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.EntityWolf;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPTaiga2;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
public class BiomeGenBorealForest extends BOPBiome
{
private static final Height biomeHeight = new Height(0.2F, 1.0F);
@SuppressWarnings("unchecked")
public BiomeGenBorealForest(int par1)
public BiomeGenBorealForest(int id)
{
super(par1);
/*
spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 20;
customBiomeDecorator.grassPerChunk = 50;
customBiomeDecorator.wheatGrassPerChunk = 25;
customBiomeDecorator.shrubsPerChunk = 10;
customBiomeDecorator.waterReedsPerChunk = 4;
*/
}
super(id);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(2) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
*/
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(10467185);
this.setTemperatureRainfall(0.6F, 0.7F);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenRainforestTree1(false) : (par1Random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(3) == 0 ? worldGeneratorForest : new WorldGenTaiga10(false))));
//return (WorldGenerator)(par1Random.nextInt(2) == 0 ? this.worldGeneratorTrees : (par1Random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (par1Random.nextInt(3) == 0 ? new WorldGenAutumn(false) : (par1Random.nextInt(3) == 0 ? this.worldGeneratorForest : new WorldGenTaiga10(false)))));
this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4));
this.theBiomeDecorator.treesPerChunk = 20;
this.theBiomeDecorator.grassPerChunk = 50;
this.bopWorldFeatures.shrubsPerChunk = 10;
this.bopWorldFeatures.waterReedsPerChunk = 4;
}
@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);
int var5 = 3 + par2Random.nextInt(6);
return random.nextInt(4) == 0 ? new WorldGenOriginalTree(Blocks.log, Blocks.leaves, 0, 0, false, 8, 2, false) : (random.nextInt(5) == 0 ? new WorldGenShrub(0,0) : (random.nextInt(3) == 0 ? new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves1"), 2, 0, false, 5, 3, false) :
(random.nextInt(3) == 0 ? worldGeneratorTrees : new WorldGenBOPTaiga2(Blocks.log, Blocks.leaves, 1, 1, false, 13, 9, 4, 4, 2, 1))));
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 2D);
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 var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
//TODO: getBlock()
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, Block.oreEmerald.blockID, 0, 2);
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 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 10467185;
}
*/
/**
* 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 13225573;
}
*/
}

View file

@ -1,30 +1,31 @@
package biomesoplenty.common.biomes;
import java.util.HashMap;
import biomesoplenty.api.BOPBlockHelper;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
import net.minecraft.world.gen.feature.WorldGenerator;
public class BiomeGenBrushland extends BOPBiome
{
public BiomeGenBrushland(int par1)
public BiomeGenBrushland(int id)
{
super(par1);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 10;
customBiomeDecorator.grassPerChunk = 6;
customBiomeDecorator.thornsPerChunk = 4;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.wheatGrassPerChunk = 3;
super(id);
this.theBiomeDecorator.treesPerChunk = 10;
this.theBiomeDecorator.grassPerChunk = 6;
this.theBiomeDecorator.flowersPerChunk = -999;
/*customBiomeDecorator.thornsPerChunk = 4;
customBiomeDecorator.shrubsPerChunk = 30;
customBiomeDecorator.waterReedsPerChunk = 2;
customBiomeDecorator.generateQuicksand = true;
*/
customBiomeDecorator.generateQuicksand = true;*/
}
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
@ -33,25 +34,29 @@ public class BiomeGenBrushland extends BOPBiome
}
*/
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
grassMap.put(new WorldGenTallGrass(Blocks.tallgrass, 1), 1D);
return grassMap;
}
@Override
public int getBiomeGrassColor()
{
//TODO: getBiomeGrassColor()
public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
{
return 13222271;
}
*/
/**
* 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 11716223;
}
*/
}

View file

@ -1,76 +1,107 @@
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.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPBigTree;
public class BiomeGenCherryBlossomGrove extends BOPBiome
{
private static final Height biomeHeight = new Height(0.3F, 0.4F);
public BiomeGenCherryBlossomGrove(int par1)
public BiomeGenCherryBlossomGrove(int id)
{
super(par1);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 3;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.pinkFlowersPerChunk = 15;
customBiomeDecorator.whiteFlowersPerChunk = 30;
customBiomeDecorator.tinyFlowersPerChunk = 25;
customBiomeDecorator.grassPerChunk = 15;
customBiomeDecorator.lilyflowersPerChunk = 9;
customBiomeDecorator.wheatGrassPerChunk = 1;
customBiomeDecorator.shrubsPerChunk = 2;
customBiomeDecorator.cloverPatchesPerChunk = 15;
customBiomeDecorator.generatePumpkins = false;
*/
}
super(id);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(3) == 0 ? new WorldGenCherry2(false) : new WorldGenCherry1(false);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(16289679);
this.setTemperatureRainfall(0.7F, 0.8F);
this.theBiomeDecorator.treesPerChunk = 3;
this.theBiomeDecorator.grassPerChunk = 15;
this.theBiomeDecorator.flowersPerChunk = -999;
this.bopWorldFeatures.shrubsPerChunk = 2;
this.bopWorldFeatures.cloverPatchesPerChunk = 15;
this.bopWorldFeatures.generatePumpkins = false;
}
@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);
int var5 = 3 + par2Random.nextInt(6);
return random.nextInt(3) == 0 ? new WorldGenBOPBigTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves3"), 1, 3) : new WorldGenBOPBigTree(BOPBlockHelper.get("logs1"), BOPBlockHelper.get("leaves3"), 1, 1);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 3D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 9), 6D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 0), 5D);
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)
{
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);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
//TODO: getBlock()
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, Block.oreEmerald.blockID, 0, 2);
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 6, 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 x, int y, int z)
{
return 10747818;
}
@Override
public int getBiomeFoliageColor()
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 10747818;
}
*/
}

View file

@ -11,8 +11,7 @@ public class BiomeGenConiferousForest extends BOPBiome
super(par1);
/*
spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4));
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 8;
customBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.mushroomsPerChunk = 8;

View file

@ -1,92 +1,100 @@
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.WorldGenShrub;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBulbTree;
public class BiomeGenDeciduousForest extends BOPBiome
{
//private static final Height biomeHeight = new Height(); Not set?
public BiomeGenDeciduousForest(int par1)
public BiomeGenDeciduousForest(int id)
{
super(par1);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = 15;
customBiomeDecorator.grassPerChunk = 10;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.toadstoolsPerChunk = 1;
customBiomeDecorator.bushesPerChunk = 8;
customBiomeDecorator.berryBushesPerChunk = 2;
customBiomeDecorator.blueMilksPerChunk = 2;
customBiomeDecorator.poisonIvyPerChunk = 1;
customBiomeDecorator.wheatGrassPerChunk = 10;
customBiomeDecorator.shrubsPerChunk = 10;
customBiomeDecorator.waterReedsPerChunk = 2;
*/
}
super(id);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenShrub(2,2) : new WorldGenDeciduous(false);
}
*/
//this.func_150570_a(biomeHeight); Not set?
//TODO: setColor()
this.setColor(12695369);
this.setTemperatureRainfall(0.7F, 0.8F);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return par1Random.nextInt(5) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1);
this.theBiomeDecorator.treesPerChunk = 15;
this.theBiomeDecorator.grassPerChunk = 10;
this.theBiomeDecorator.flowersPerChunk = -999;
this.bopWorldFeatures.toadstoolsPerChunk = 1;
this.bopWorldFeatures.bushesPerChunk = 8;
this.bopWorldFeatures.berryBushesPerChunk = 2;
this.bopWorldFeatures.blueMilksPerChunk = 2;
this.bopWorldFeatures.poisonIvyPerChunk = 1;
this.bopWorldFeatures.shrubsPerChunk = 10;
this.bopWorldFeatures.waterReedsPerChunk = 2;
}
@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);
int var5 = 3 + par2Random.nextInt(6);
return random.nextInt(4) == 0 ? new WorldGenShrub(2,2) : new WorldGenBulbTree(Blocks.log, Blocks.leaves, 0, 0, false, 10, 15, false);
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 2), 2D);
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 var7 = par3 + par2Random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
Block block = Block.blocksList[var10];
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID))
//TODO: getBlock()
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, Block.oreEmerald.blockID, 0, 2);
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 0, 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 12695369;
}
*/
/**
* 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 12896570;
}
*/
}

View file

@ -35,9 +35,9 @@ public class BiomeGenDunes extends BOPBiome
this.theBiomeDecorator.grassPerChunk = 75;
this.theBiomeDecorator.generateLakes = false;
this.bopWorldFeatures.perChunk.desertSproutsPerChunk = 25;
this.bopWorldFeatures.perChunk.bromeliadsPerChunk = 5;
this.bopWorldFeatures.perChunk.waterReedsPerChunk = 4;
this.bopWorldFeatures.desertSproutsPerChunk = 25;
this.bopWorldFeatures.bromeliadsPerChunk = 5;
this.bopWorldFeatures.waterReedsPerChunk = 4;
}
@Override

View file

@ -33,9 +33,9 @@ public class BiomeGenFrostForest extends BOPBiome
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.mushroomsPerChunk = -999;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 1;
this.bopWorldFeatures.perChunk.bopFlowersPerChunk = 3;
this.bopWorldFeatures.doGeneration.generatePumpkins = false;
this.bopWorldFeatures.shrubsPerChunk = 1;
this.bopWorldFeatures.bopFlowersPerChunk = 3;
this.bopWorldFeatures.generatePumpkins = false;
}
@Override

View file

@ -42,11 +42,11 @@ public class BiomeGenGrassland extends BOPBiome
this.theBiomeDecorator.reedsPerChunk = 35;
this.theBiomeDecorator.mushroomsPerChunk = 20;
this.bopWorldFeatures.perChunk.waterLakesPerChunk = 15;
this.bopWorldFeatures.perChunk.portobellosPerChunk = 3;
this.bopWorldFeatures.perChunk.riverCanePerChunk = 5;
this.bopWorldFeatures.perChunk.waterReedsPerChunk = 2;
this.bopWorldFeatures.doGeneration.generatePumpkins = false;
this.bopWorldFeatures.waterPondsPerChunk = 15;
this.bopWorldFeatures.portobellosPerChunk = 3;
this.bopWorldFeatures.riverCanePerChunk = 5;
this.bopWorldFeatures.waterReedsPerChunk = 2;
this.bopWorldFeatures.generatePumpkins = false;
}
@Override

View file

@ -29,8 +29,8 @@ public class BiomeGenHighland extends BOPBiome
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = 25;
this.bopWorldFeatures.perChunk.doubleTallGrassPerChunk = 25;
this.bopWorldFeatures.perChunk.wildCarrotsPerChunk = 1;
this.bopWorldFeatures.doubleTallGrassPerChunk = 25;
this.bopWorldFeatures.wildCarrotsPerChunk = 1;
}
@Override

View file

@ -31,7 +31,7 @@ public class BiomeGenJadeCliffs extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 12;
this.theBiomeDecorator.grassPerChunk = 3;
this.bopWorldFeatures.perChunk.wildCarrotsPerChunk = 1;
this.bopWorldFeatures.wildCarrotsPerChunk = 1;
}
@Override

View file

@ -30,7 +30,7 @@ public class BiomeGenLavenderFields extends BOPBiome
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = 20;
this.bopWorldFeatures.perChunk.lavenderPerChunk = 999;
this.bopWorldFeatures.lavenderPerChunk = 999;
}
@Override

View file

@ -1,59 +1,87 @@
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.monster.EntitySlime;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
public class BiomeGenMarsh extends BOPBiome
{
private static final Height biomeHeight = new Height(0.2F, 0.2F);
public BiomeGenMarsh(int par1)
public BiomeGenMarsh(int id)
{
super(par1);
/*
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = -999;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.grassPerChunk = 50;
customBiomeDecorator.wheatGrassPerChunk = 50;
customBiomeDecorator.highGrassPerChunk = 50;
customBiomeDecorator.reedsPerChunk = -999;
customBiomeDecorator.waterLakesPerChunk = 100;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.mudPerChunk = 1;
customBiomeDecorator.mudPerChunk2 = 1;
customBiomeDecorator.koruPerChunk = 1;
customBiomeDecorator.waterReedsPerChunk = 10;
customBiomeDecorator.generatePumpkins = false;
spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
*/
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(6725742);
this.setTemperatureRainfall(0.5F, 0.9F);
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 1, 3));
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = 50;
this.theBiomeDecorator.reedsPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.doubleTallGrassPerChunk = 50;
this.bopWorldFeatures.mudPerChunk = 1;
this.bopWorldFeatures.waterPondsPerChunk = 100;
this.bopWorldFeatures.waterReedsPerChunk = 10;
this.bopWorldFeatures.generatePumpkins = false;
}
/*
@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 par1World, Random par2Random, int par3, int par4)
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(par1World, par2Random, par3, par4);
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
int var55 = 12 + par2Random.nextInt(6);
for (int var66 = 0; var66 < var55; ++var66)
for (int var6 = 0; var6 < var5; ++var6)
{
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);
int x = chunkX + random.nextInt(16);
int y = random.nextInt(28) + 4;
int z = chunkZ + random.nextInt(16);
if (var100 == Block.stone.blockID)
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{
par1World.setBlock(var77, var88, var99, Blocks.amethystOre.get().blockID, 12, 2);
//TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 12, 2);
}
}
}
@Override
/*@Override
public int getFogColour()
{
return 12638463;

View file

@ -29,9 +29,9 @@ public class BiomeGenMountain extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 2;
this.theBiomeDecorator.grassPerChunk = 3;
this.bopWorldFeatures.perChunk.berryBushesPerChunk = 3;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 10;
this.bopWorldFeatures.perChunk.waterReedsPerChunk = 4;
this.bopWorldFeatures.berryBushesPerChunk = 3;
this.bopWorldFeatures.shrubsPerChunk = 10;
this.bopWorldFeatures.waterReedsPerChunk = 4;
}
@Override

View file

@ -38,8 +38,8 @@ public class BiomeGenMysticGrove extends BOPBiome
customBiomeDecorator.lilyflowersPerChunk = 3;
customBiomeDecorator.poisonWaterPerChunk = 1;*/
this.bopWorldFeatures.perChunk.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 4;
this.bopWorldFeatures.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.shrubsPerChunk = 4;
}

View file

@ -49,9 +49,9 @@ public class BiomeGenOminousWoods extends BOPBiome
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.perChunk.bopFlowersPerChunk = 1;
this.bopWorldFeatures.perChunk.thornsPerChunk = 9;
this.bopWorldFeatures.perChunk.poisonIvyPerChunk = 3;
this.bopWorldFeatures.bopFlowersPerChunk = 1;
this.bopWorldFeatures.thornsPerChunk = 9;
this.bopWorldFeatures.poisonIvyPerChunk = 3;
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 15;
}

View file

@ -37,10 +37,10 @@ public class BiomeGenRainforest extends BOPBiome
this.theBiomeDecorator.mushroomsPerChunk = 25;
this.bopWorldFeatures.perChunk.bopFlowersPerChunk = 25;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 5;
this.bopWorldFeatures.perChunk.cloverPatchesPerChunk = 20;
this.bopWorldFeatures.doGeneration.generatePumpkins = false;
this.bopWorldFeatures.bopFlowersPerChunk = 25;
this.bopWorldFeatures.shrubsPerChunk = 5;
this.bopWorldFeatures.cloverPatchesPerChunk = 20;
this.bopWorldFeatures.generatePumpkins = false;
/*TODO: FEATURE customBiomeDecorator.pinkFlowersPerChunk = 2;
customBiomeDecorator.rosesPerChunk = 10;

View file

@ -32,7 +32,7 @@ public class BiomeGenSacredSprings extends BOPBiome
this.theBiomeDecorator.grassPerChunk = 4;
this.theBiomeDecorator.waterlilyPerChunk = 5;
this.bopWorldFeatures.perChunk.bopFlowersPerChunk = 2;
this.bopWorldFeatures.bopFlowersPerChunk = 2;
}
@Override

View file

@ -33,9 +33,9 @@ public class BiomeGenShrubland extends BOPBiome
this.theBiomeDecorator.flowersPerChunk = 0;
this.theBiomeDecorator.grassPerChunk = 5;
this.bopWorldFeatures.perChunk.bushesPerChunk = 7;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 5;
this.bopWorldFeatures.doGeneration.generatePumpkins = false;
this.bopWorldFeatures.bushesPerChunk = 7;
this.bopWorldFeatures.shrubsPerChunk = 5;
this.bopWorldFeatures.generatePumpkins = false;
}
@Override

View file

@ -27,8 +27,8 @@ public class BiomeGenThicket extends BOPBiome
this.theBiomeDecorator.treesPerChunk = 17;
this.theBiomeDecorator.grassPerChunk = 1;
this.bopWorldFeatures.perChunk.thornsPerChunk = 25;
this.bopWorldFeatures.perChunk.shrubsPerChunk = 15;
this.bopWorldFeatures.thornsPerChunk = 25;
this.bopWorldFeatures.shrubsPerChunk = 15;
}
@Override

View file

@ -159,6 +159,8 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
//TODO: getBlock()
Block block = world.func_147439_a(x, y - 1, z);
if (block == Blocks.air) return false;
switch (metadata)
{
case GRASSTOP:
@ -176,6 +178,9 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
//TODO: canReplace()
public boolean func_149705_a(World world, int x, int y, int z, int side, ItemStack itemStack)
{
//TODO: getBlock()
if (world.func_147439_a(x, y - 1, z) == Blocks.air) return false;
return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.isValidPosition(world, x, y, z, itemStack.getItemDamage());
}
@ -186,9 +191,6 @@ public class BlockBOPFoliage extends BlockTallGrass implements IShearable
//TODO: getBlock()
Block block = world.func_147439_a(x, y, z);
//TODO: updateTick()
super.func_149695_a(world, x, y, z, block);
this.dropIfCantStay(world, x, y, z, new ItemStack(block, 1, world.getBlockMetadata(x, y, z)));
}

View file

@ -7,7 +7,10 @@ import biomesoplenty.api.BOPBiomeHelper.BOPBiomeTemperatureType;
import biomesoplenty.common.biomes.BiomeGenAlps;
import biomesoplenty.common.biomes.BiomeGenArctic;
import biomesoplenty.common.biomes.BiomeGenBambooForest;
import biomesoplenty.common.biomes.BiomeGenBorealForest;
import biomesoplenty.common.biomes.BiomeGenCherryBlossomGrove;
import biomesoplenty.common.biomes.BiomeGenCrag;
import biomesoplenty.common.biomes.BiomeGenDeciduousForest;
import biomesoplenty.common.biomes.BiomeGenDunes;
import biomesoplenty.common.biomes.BiomeGenFlowerField;
import biomesoplenty.common.biomes.BiomeGenFrostForest;
@ -15,6 +18,7 @@ import biomesoplenty.common.biomes.BiomeGenGrassland;
import biomesoplenty.common.biomes.BiomeGenHighland;
import biomesoplenty.common.biomes.BiomeGenJadeCliffs;
import biomesoplenty.common.biomes.BiomeGenLavenderFields;
import biomesoplenty.common.biomes.BiomeGenMarsh;
import biomesoplenty.common.biomes.BiomeGenMountain;
import biomesoplenty.common.biomes.BiomeGenOminousWoods;
import biomesoplenty.common.biomes.BiomeGenPasture;
@ -67,18 +71,18 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenArctic(BOPConfigurationIDs.arcticID).setBiomeName("Arctic"), BOPBiomeTemperatureType.ICY));
registerBiome(new BOPBiomeListEntry(new BiomeGenBambooForest(BOPConfigurationIDs.bambooForestID).setBiomeName("Bamboo Forest"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenBayou(BOPConfigurationIDs.bayouID).setBiomeName("Bayou"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenBog(BOPConfigurationIDs.bogID).setBiomeName("Bog"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenBog(BOPConfigurationIDs.bogID).setBiomeName("Bog"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenBorealForest(BOPConfigurationIDs.borealForestID).setBiomeName("Boreal Forest"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenBrushland(BOPConfigurationIDs.brushlandID).setBiomeName("Brushland"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenCanyon(BOPConfigurationIDs.canyonID).setBiomeName("Canyon"), BOPBiomeTemperatureType.HOT));
registerBiome(new BOPBiomeListEntry(new BiomeGenChaparral(BOPConfigurationIDs.chaparralID).setBiomeName("Chaparral"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenBrushland(BOPConfigurationIDs.brushlandID).setBiomeName("Brushland"), BOPBiomeTemperatureType.HOT));
//registerBiome(new BOPBiomeListEntry(new BiomeGenCanyon(BOPConfigurationIDs.canyonID).setBiomeName("Canyon"), BOPBiomeTemperatureType.HOT));
//registerBiome(new BOPBiomeListEntry(new BiomeGenChaparral(BOPConfigurationIDs.chaparralID).setBiomeName("Chaparral"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenCherryBlossomGrove(BOPConfigurationIDs.cherryBlossomGroveID).setBiomeName("Cherry Blossom Grove"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenConiferousForest(BOPConfigurationIDs.coniferousForestID).setBiomeName("Coniferous Forest"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenConiferousForest(BOPConfigurationIDs.coniferousForestID).setBiomeName("Coniferous Forest"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenConiferousForestSnow(BOPConfigurationIDs.coniferousForestSnowID).setBiomeName("Snowy Coniferous Forest"), BOPBiomeTemperatureType.ICY));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenCrag(BOPConfigurationIDs.cragID).setBiomeName("Crag"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenDeadForest(BOPConfigurationIDs.deadForestID).setBiomeName("Dead Forest"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenDeadSwamp(BOPConfigurationIDs.deadSwampID).setBiomeName("Dead Swamp"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenDeciduousForest(BOPConfigurationIDs.deciduousForestID).setBiomeName("Deciduous Forest"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenDeadSwamp(BOPConfigurationIDs.deadSwampID).setBiomeName("Dead Swamp"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenDeciduousForest(BOPConfigurationIDs.deciduousForestID).setBiomeName("Deciduous Forest"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenDunes(BOPConfigurationIDs.dunesID).setBiomeName("Dunes"), BOPBiomeTemperatureType.HOT));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenFen(BOPConfigurationIDs.fenID).setBiomeName("Fen"), BOPBiomeTemperatureType.WARM));*/;
registerBiome(new BOPBiomeListEntry(new BiomeGenFlowerField(BOPConfigurationIDs.flowerFieldID).setBiomeName("Flower Field"), BOPBiomeTemperatureType.WARM));
@ -88,13 +92,13 @@ public class BOPBiomes
/*registerBiome(new BOPBiomeListEntry(new BiomeGenHeathland(BOPConfigurationIDs.heathlandID).setBiomeName("Heathland"), BOPBiomeTemperatureType.WARM));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenHighland(BOPConfigurationIDs.highlandID).setBiomeName("Highland"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenJadeCliffs(BOPConfigurationIDs.jadeCliffsID).setBiomeName("Jade Cliffs"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID).setBiomeName("Lavender Fields"), BOPBiomeTemperatureType.WARM));
registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenLavenderFields(BOPConfigurationIDs.lavenderFieldsID).setBiomeName("Lavender Fields"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenLushDesert(BOPConfigurationIDs.lushDesertID).setBiomeName("Lush Desert"), BOPBiomeTemperatureType.HOT));
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 BiomeGenMeadow(BOPConfigurationIDs.meadowID).setBiomeName("Meadow"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenMoor(BOPConfigurationIDs.moorID).setBiomeName("Moor"), BOPBiomeTemperatureType.COOL));*/
//registerBiome(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 BiomeGenMountain(BOPConfigurationIDs.mountainID).setBiomeName("Mountain"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenOminousWoods(BOPConfigurationIDs.ominousWoodsID).setBiomeName("Ominous Woods"), BOPBiomeTemperatureType.COOL));

View file

@ -8,6 +8,7 @@ import biomesoplenty.common.eventhandler.misc.CapeEventHandler;
import biomesoplenty.common.eventhandler.potions.PotionParalysisEventHandler;
import biomesoplenty.common.eventhandler.potions.PotionPossessionEventHandler;
import biomesoplenty.common.eventhandler.world.DecorateBiomeEventHandler;
import biomesoplenty.common.eventhandler.world.DecorationModificationEventHandler;
public class BOPCommonEventHandlers
{
@ -22,6 +23,7 @@ public class BOPCommonEventHandlers
private static void registerWorldEventHandlers()
{
MinecraftForge.EVENT_BUS.register(new DecorateBiomeEventHandler());
MinecraftForge.TERRAIN_GEN_BUS.register(new DecorationModificationEventHandler());
}
private static void registerEntityEventHandlers()

View file

@ -5,22 +5,18 @@ import static net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.Ev
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeDecorator;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenLiquids;
import net.minecraft.world.gen.feature.WorldGenPumpkin;
import net.minecraft.world.gen.feature.WorldGenerator;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
import net.minecraftforge.event.terraingen.TerrainGen;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
import biomesoplenty.common.world.WorldGenFieldAssociation;
import biomesoplenty.common.world.decoration.BOPWorldFeatures;
import biomesoplenty.common.world.decoration.ForcedDecorators;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import cpw.mods.fml.common.eventhandler.Event.Result;
import biomesoplenty.common.world.generation.ForcedBOPWorldGenerators;
import biomesoplenty.common.world.generation.IWorldGeneratorBOP;
import biomesoplenty.common.world.generation.WorldGenFieldAssociation;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
@ -36,10 +32,10 @@ public class DecorateBiomeEventHandler
Random random = event.rand;
int x = chunkX + 8;
int z = chunkZ + 8;
int x = chunkX * 16;
int z = chunkZ * 16;
BiomeGenBase biome = world.getBiomeGenForCoordsBody(x, z);
BiomeGenBase biome = world.getBiomeGenForCoordsBody(x + 16, z + 16);
IBOPDecoration bopDecoration = null;
@ -54,31 +50,37 @@ public class DecorateBiomeEventHandler
if (bopDecoration != null)
{
for (Field worldGeneratorField : BOPWorldFeatures.PerChunk.class.getFields())
for (Field worldGeneratorField : BOPWorldFeatures.class.getFields())
{
try
{
int worldGenPerChunk = worldGeneratorField.getInt(bopDecoration.getWorldFeatures().perChunk);
WorldGenerator worldGenerator = null;
for (int i = 0; i < worldGenPerChunk; i++)
if (worldGeneratorField.getName().equals("bopFlowersPerChunk") && TerrainGen.decorate(world, random, chunkX, chunkZ, FLOWERS))
{
int randX = x + random.nextInt(16);
int randZ = z + random.nextInt(16);
worldGenerator = bopDecoration.getRandomWorldGenForBOPFlowers(random);
}
else
{
worldGenerator = WorldGenFieldAssociation.getAssociatedWorldGenerator(worldGeneratorField.getName());
}
WorldGenerator worldGenerator = null;
if (worldGenerator != null)
{
IWorldGeneratorBOP worldGeneratorBOP = null;
if (worldGeneratorField.getName().equals("bopFlowersPerChunk") && TerrainGen.decorate(world, random, chunkX, chunkZ, FLOWERS))
if (worldGenerator instanceof IWorldGeneratorBOP)
{
worldGenerator = bopDecoration.getRandomWorldGenForBOPFlowers(random);
worldGeneratorBOP = (IWorldGeneratorBOP)worldGenerator;
}
else
else if (ForcedBOPWorldGenerators.hasForcedGenerator(worldGenerator.getClass()))
{
worldGenerator = WorldGenFieldAssociation.getAssociatedWorldGenerator(worldGeneratorField.getName());
worldGeneratorBOP = ForcedBOPWorldGenerators.getForcedGenerator(worldGenerator.getClass());
}
if (worldGenerator != null)
if (worldGeneratorBOP != null)
{
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
worldGeneratorBOP.doGeneration(world, random, worldGeneratorField, worldGenerator, biome, bopDecoration, x, z);
}
}
}
@ -90,66 +92,6 @@ public class DecorateBiomeEventHandler
}
}
@SubscribeEvent
public void modifyDecor(Decorate event)
{
World world = event.world;
int chunkX = event.chunkX;
int chunkZ = event.chunkZ;
Random random = event.rand;
int x = chunkX + 8;
int z = chunkZ + 8;
BiomeGenBase biome = world.getBiomeGenForCoordsBody(x, z);
IBOPDecoration bopDecoration = null;
if (biome instanceof IBOPDecoration)
{
bopDecoration = (IBOPDecoration)biome;
}
else if (ForcedDecorators.biomeHasForcedDecorator(biome.biomeID))
{
bopDecoration = ForcedDecorators.getForcedDecorator(biome.biomeID);
}
if (bopDecoration != null)
{
if (event.type == EventType.PUMPKIN)
{
if (!bopDecoration.getWorldFeatures().doGeneration.generatePumpkins) event.setResult(Result.DENY);
}
else if (event.type == EventType.LAKE)
{
if (biome.theBiomeDecorator.generateLakes)
{
for (int i = 0; i < bopDecoration.getWorldFeatures().perChunk.waterLakesPerChunk; ++i)
{
int randX = x + random.nextInt(16);
int randY = random.nextInt(random.nextInt(248) + 8);
int randZ = z + random.nextInt(16);
(new WorldGenLiquids(Blocks.flowing_water)).generate(world, random, randX, randY, randZ);
}
for (int i = 0; i < bopDecoration.getWorldFeatures().perChunk.lavaLakesPerChunk; ++i)
{
int randX = x + random.nextInt(16);
int randY = random.nextInt(random.nextInt(random.nextInt(240) + 8) + 8);
int randZ = z + random.nextInt(16);
(new WorldGenLiquids(Blocks.flowing_lava)).generate(world, random, randX, randY, randZ);
}
}
event.setResult(Result.DENY);
}
}
}
public static void decorate(World world, Random random, BiomeGenBase biome, int x, int z)
{
BiomeDecorator biomeDecorator = biome.theBiomeDecorator;

View file

@ -0,0 +1,120 @@
package biomesoplenty.common.eventhandler.world;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate;
import biomesoplenty.common.world.decoration.ForcedDecorators;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import cpw.mods.fml.common.eventhandler.Event.Result;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class DecorationModificationEventHandler
{
@SubscribeEvent
public void modifyDecor(Decorate event)
{
World world = event.world;
int chunkX = event.chunkX;
int chunkZ = event.chunkZ;
Random random = event.rand;
int x = chunkX + 8;
int z = chunkZ + 8;
BiomeGenBase biome = world.getBiomeGenForCoordsBody(x, z);
IBOPDecoration bopDecoration = null;
if (biome instanceof IBOPDecoration)
{
bopDecoration = (IBOPDecoration)biome;
}
else if (ForcedDecorators.biomeHasForcedDecorator(biome.biomeID))
{
bopDecoration = ForcedDecorators.getForcedDecorator(biome.biomeID);
}
if (bopDecoration != null)
{
if (event.type == Decorate.EventType.PUMPKIN)
{
if (!bopDecoration.getWorldFeatures().generatePumpkins)
{
event.setResult(Result.DENY);
}
}
}
}
@SubscribeEvent
public void modifyPopulation(Populate event)
{
World world = event.world;
int chunkX = event.chunkX;
int chunkZ = event.chunkZ;
Random random = event.rand;
int x = chunkX * 16;
int z = chunkZ * 16;
BiomeGenBase biome = world.getBiomeGenForCoordsBody(x + 16, z + 16);
IBOPDecoration bopDecoration = null;
if (biome instanceof IBOPDecoration)
{
bopDecoration = (IBOPDecoration)biome;
}
else if (ForcedDecorators.biomeHasForcedDecorator(biome.biomeID))
{
bopDecoration = ForcedDecorators.getForcedDecorator(biome.biomeID);
}
if (bopDecoration != null)
{
if (event.type == Populate.EventType.LAKE)
{
event.setResult(Result.DENY);
for (int i = 0; i < bopDecoration.getWorldFeatures().waterPondsPerChunk; i++)
{
if (random.nextInt(4) == 0)
{
int randX = x + random.nextInt(16) + 8;
int randY = random.nextInt(256);
int randZ = z + random.nextInt(16) + 8;
(new WorldGenLakes(Blocks.water)).generate(world, random, randX, randY, randZ);
}
}
}
else if (event.type == Populate.EventType.LAVA)
{
event.setResult(Result.DENY);
for (int i = 0; i < bopDecoration.getWorldFeatures().lavaPondsPerChunk; i++)
{
if (random.nextInt(8) == 0)
{
int randX = x + random.nextInt(16) + 8;
int randY = random.nextInt(random.nextInt(248) + 8);
int randZ = z + random.nextInt(16) + 8;
if (randY < 63 || random.nextInt(10) == 0)
{
(new WorldGenLakes(Blocks.lava)).generate(world, random, randX, randY, randZ);
}
}
}
}
}
}
}

View file

@ -2,36 +2,31 @@ package biomesoplenty.common.world.decoration;
public class BOPWorldFeatures
{
public PerChunk perChunk = new PerChunk();
public DoGeneration doGeneration = new DoGeneration();
public int mudPerChunk = 0;
public int riverCanePerChunk = 0;
public int shrubsPerChunk = 0;
public int bushesPerChunk = 0;
public int cloverPatchesPerChunk = 0;
public int lavenderPerChunk = 0;
public int thornsPerChunk = 0;
public int stalagmitesPerChunk = 3;
public int stalactitesPerChunk = 6;
public int desertSproutsPerChunk = 0;
public int bromeliadsPerChunk = 0;
public int waterReedsPerChunk = 0;
public int wildCarrotsPerChunk = 0;
public int doubleTallGrassPerChunk = 0;
public int poisonIvyPerChunk = 0;
public int berryBushesPerChunk = 0;
public int waterPondsPerChunk = 0;
public int lavaPondsPerChunk = 0;
public int portobellosPerChunk = 0;
public int koruPerChunk = 0;
public int toadstoolsPerChunk = 0;
public int blueMilksPerChunk = 0;
public class PerChunk
{
public int mudPerChunk = 0;
public int riverCanePerChunk = 0;
public int shrubsPerChunk = 0;
public int bushesPerChunk = 0;
public int cloverPatchesPerChunk = 0;
public int lavenderPerChunk = 0;
public int thornsPerChunk = 0;
public int stalagmitesPerChunk = 3;
public int stalactitesPerChunk = 6;
public int desertSproutsPerChunk = 0;
public int bromeliadsPerChunk = 0;
public int waterReedsPerChunk = 0;
public int wildCarrotsPerChunk = 0;
public int doubleTallGrassPerChunk = 0;
public int poisonIvyPerChunk = 0;
public int berryBushesPerChunk = 0;
public int waterLakesPerChunk = 50;
public int lavaLakesPerChunk = 20;
public int portobellosPerChunk = 0;
public int bopFlowersPerChunk = 0;
public int bopFlowersPerChunk = 0;
}
public class DoGeneration
{
public boolean generatePumpkins = true;
}
public boolean generatePumpkins = true;
public boolean generateQuicksand = false;
}

View file

@ -1,13 +1,17 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
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 WorldGenBOPFlora extends WorldGenerator
public class WorldGenBOPFlora extends WorldGeneratorBOP
{
private Block flora;
private int floraMeta;
@ -45,4 +49,16 @@ public class WorldGenBOPFlora extends WorldGenerator
return true;
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -1,13 +1,17 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.ItemStack;
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 WorldGenBOPTallGrass extends WorldGenerator
public class WorldGenBOPTallGrass extends WorldGeneratorBOP
{
private Block tallGrass;
private int tallGrassMetadata;
@ -48,4 +52,16 @@ public class WorldGenBOPTallGrass extends WorldGenerator
return true;
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -1,14 +1,18 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.util.Direction;
import net.minecraft.util.Facing;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenMoss extends WorldGenerator
public class WorldGenMoss extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random par2Random, int par3, int par4, int par5)
@ -45,4 +49,16 @@ public class WorldGenMoss extends WorldGenerator
return true;
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -1,15 +1,19 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
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.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenMud extends WorldGenerator
public class WorldGenMud extends WorldGeneratorBOP
{
/** The maximum radius used when generating a patch of blocks. */
private int radius;
@ -57,4 +61,16 @@ public class WorldGenMud extends WorldGenerator
return true;
}
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -1,13 +1,17 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenRiverCane extends WorldGenerator
public class WorldGenRiverCane extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random par2Random, int x, int y, int z)
@ -37,4 +41,16 @@ public class WorldGenRiverCane extends WorldGenerator
return true;
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -1,16 +1,18 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP;
public class WorldGenWaterReeds extends WorldGenerator
public class WorldGenWaterReeds extends WorldGeneratorBOP
{
@Override
public boolean generate(World world, Random random, int x, int y, int z)
@ -38,4 +40,16 @@ public class WorldGenWaterReeds extends WorldGenerator
return true;
}
@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;
worldGenerator.generate(world, random, randX, world.getTopSolidOrLiquidBlock(randX, randZ), randZ);
}
}
}

View file

@ -0,0 +1,485 @@
package biomesoplenty.common.world.features.trees;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSapling;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.util.ForgeDirection;
public class WorldGenBOPBigTree extends WorldGenAbstractTree
{
static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1};
Random rand = new Random();
World worldObj;
int[] basePos = new int[] {0, 0, 0};
int heightLimit;
int height;
double heightAttenuation = 0.618D;
double branchDensity = 1.0D;
double branchSlope = 0.381D;
double scaleWidth = 1.0D;
double leafDensity = 1.0D;
int trunkSize = 1;
int heightLimitLimit = 12;
int leafDistanceLimit = 4;
int[][] leafNodes;
private final Block wood;
private final Block leaves;
private final int metaWood;
private final int metaLeaves;
public WorldGenBOPBigTree(Block wood, Block leaves, int metaWood, int metaLeaves)
{
super(false);
this.wood = wood;
this.leaves = leaves;
this.metaWood = metaWood;
this.metaLeaves = metaLeaves;
}
void generateLeafNodeList()
{
this.height = (int)((double)this.heightLimit * this.heightAttenuation);
if (this.height >= this.heightLimit)
{
this.height = this.heightLimit - 1;
}
int i = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D));
if (i < 1)
{
i = 1;
}
int[][] aint = new int[i * this.heightLimit][4];
int j = this.basePos[1] + this.heightLimit - this.leafDistanceLimit;
int k = 1;
int l = this.basePos[1] + this.height;
int i1 = j - this.basePos[1];
aint[0][0] = this.basePos[0];
aint[0][1] = j;
aint[0][2] = this.basePos[2];
aint[0][3] = l;
--j;
while (i1 >= 0)
{
int j1 = 0;
float f = this.layerSize(i1);
if (f < 0.0F)
{
--j;
--i1;
}
else
{
for (double d0 = 0.5D; j1 < i; ++j1)
{
double d1 = this.scaleWidth * (double)f * ((double)this.rand.nextFloat() + 0.328D);
double d2 = (double)this.rand.nextFloat() * 2.0D * Math.PI;
int k1 = MathHelper.floor_double(d1 * Math.sin(d2) + (double)this.basePos[0] + d0);
int l1 = MathHelper.floor_double(d1 * Math.cos(d2) + (double)this.basePos[2] + d0);
int[] aint1 = new int[] {k1, j, l1};
int[] aint2 = new int[] {k1, j + this.leafDistanceLimit, l1};
if (this.checkBlockLine(aint1, aint2) == -1)
{
int[] aint3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
double d3 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - aint1[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - aint1[2]), 2.0D));
double d4 = d3 * this.branchSlope;
if ((double)aint1[1] - d4 > (double)l)
{
aint3[1] = l;
}
else
{
aint3[1] = (int)((double)aint1[1] - d4);
}
if (this.checkBlockLine(aint3, aint1) == -1)
{
aint[k][0] = k1;
aint[k][1] = j;
aint[k][2] = l1;
aint[k][3] = aint3[1];
++k;
}
}
}
--j;
--i1;
}
}
this.leafNodes = new int[k][4];
System.arraycopy(aint, 0, this.leafNodes, 0, k);
}
void func_150529_a(int p_150529_1_, int p_150529_2_, int p_150529_3_, float p_150529_4_, byte p_150529_5_, Block p_150529_6_)
{
int l = (int)((double)p_150529_4_ + 0.618D);
byte b1 = otherCoordPairs[p_150529_5_];
byte b2 = otherCoordPairs[p_150529_5_ + 3];
int[] aint = new int[] {p_150529_1_, p_150529_2_, p_150529_3_};
int[] aint1 = new int[] {0, 0, 0};
int i1 = -l;
int j1 = -l;
for (aint1[p_150529_5_] = aint[p_150529_5_]; i1 <= l; ++i1)
{
aint1[b1] = aint[b1] + i1;
j1 = -l;
while (j1 <= l)
{
double d0 = Math.pow((double)Math.abs(i1) + 0.5D, 2.0D) + Math.pow((double)Math.abs(j1) + 0.5D, 2.0D);
if (d0 > (double)(p_150529_4_ * p_150529_4_))
{
++j1;
}
else
{
aint1[b2] = aint[b2] + j1;
Block block1 = this.worldObj.func_147439_a(aint1[0], aint1[1], aint1[2]);
if (!block1.isAir(worldObj, aint1[0], aint1[1], aint1[2]) && !block1.isLeaves(worldObj, aint1[0], aint1[1], aint1[2]))
{
++j1;
}
else
{
this.func_150516_a(this.worldObj, aint1[0], aint1[1], aint1[2], p_150529_6_, metaLeaves);
++j1;
}
}
}
}
}
// JAVADOC METHOD $$ func_76490_a
float layerSize(int par1)
{
if ((double)par1 < (double)((float)this.heightLimit) * 0.3D)
{
return -1.618F;
}
else
{
float f = (float)this.heightLimit / 2.0F;
float f1 = (float)this.heightLimit / 2.0F - (float)par1;
float f2;
if (f1 == 0.0F)
{
f2 = f;
}
else if (Math.abs(f1) >= f)
{
f2 = 0.0F;
}
else
{
f2 = (float)Math.sqrt(Math.pow((double)Math.abs(f), 2.0D) - Math.pow((double)Math.abs(f1), 2.0D));
}
f2 *= 0.5F;
return f2;
}
}
float leafSize(int par1)
{
return par1 >= 0 && par1 < this.leafDistanceLimit ? (par1 != 0 && par1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F;
}
// JAVADOC METHOD $$ func_76491_a
void generateLeafNode(int par1, int par2, int par3)
{
int l = par2;
for (int i1 = par2 + this.leafDistanceLimit; l < i1; ++l)
{
float f = this.leafSize(l - par2);
this.func_150529_a(par1, l, par3, f, (byte)1, leaves);
}
}
void func_150530_a(int[] p_150530_1_, int[] p_150530_2_, Block p_150530_3_)
{
int[] aint2 = new int[] {0, 0, 0};
byte b0 = 0;
byte b1;
for (b1 = 0; b0 < 3; ++b0)
{
aint2[b0] = p_150530_2_[b0] - p_150530_1_[b0];
if (Math.abs(aint2[b0]) > Math.abs(aint2[b1]))
{
b1 = b0;
}
}
if (aint2[b1] != 0)
{
byte b2 = otherCoordPairs[b1];
byte b3 = otherCoordPairs[b1 + 3];
byte b4;
if (aint2[b1] > 0)
{
b4 = 1;
}
else
{
b4 = -1;
}
double d0 = (double)aint2[b2] / (double)aint2[b1];
double d1 = (double)aint2[b3] / (double)aint2[b1];
int[] aint3 = new int[] {0, 0, 0};
int i = 0;
for (int j = aint2[b1] + b4; i != j; i += b4)
{
aint3[b1] = MathHelper.floor_double((double)(p_150530_1_[b1] + i) + 0.5D);
aint3[b2] = MathHelper.floor_double((double)p_150530_1_[b2] + (double)i * d0 + 0.5D);
aint3[b3] = MathHelper.floor_double((double)p_150530_1_[b3] + (double)i * d1 + 0.5D);
byte b5 = (byte)metaWood;
int k = Math.abs(aint3[0] - p_150530_1_[0]);
int l = Math.abs(aint3[2] - p_150530_1_[2]);
int i1 = Math.max(k, l);
if (i1 > 0)
{
if (k == i1)
{
b5 += 4;
}
else if (l == i1)
{
b5 += 8;
}
}
this.func_150516_a(this.worldObj, aint3[0], aint3[1], aint3[2], p_150530_3_, b5);
}
}
}
void generateLeaves()
{
int i = 0;
for (int j = this.leafNodes.length; i < j; ++i)
{
int k = this.leafNodes[i][0];
int l = this.leafNodes[i][1];
int i1 = this.leafNodes[i][2];
this.generateLeafNode(k, l, i1);
}
}
boolean leafNodeNeedsBase(int par1)
{
return (double)par1 >= (double)this.heightLimit * 0.2D;
}
void generateTrunk()
{
int i = this.basePos[0];
int j = this.basePos[1];
int k = this.basePos[1] + this.height;
int l = this.basePos[2];
int[] aint = new int[] {i, j, l};
int[] aint1 = new int[] {i, k, l};
this.func_150530_a(aint, aint1, wood);
if (this.trunkSize == 2)
{
++aint[0];
++aint1[0];
this.func_150530_a(aint, aint1, wood);
++aint[2];
++aint1[2];
this.func_150530_a(aint, aint1, wood);
aint[0] += -1;
aint1[0] += -1;
this.func_150530_a(aint, aint1, wood);
}
}
// JAVADOC METHOD $$ func_76494_d
void generateLeafNodeBases()
{
int i = 0;
int j = this.leafNodes.length;
for (int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; i < j; ++i)
{
int[] aint1 = this.leafNodes[i];
int[] aint2 = new int[] {aint1[0], aint1[1], aint1[2]};
aint[1] = aint1[3];
int k = aint[1] - this.basePos[1];
if (this.leafNodeNeedsBase(k))
{
this.func_150530_a(aint, aint2, wood);
}
}
}
// JAVADOC METHOD $$ func_76496_a
int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger)
{
int[] aint2 = new int[] {0, 0, 0};
byte b0 = 0;
byte b1;
for (b1 = 0; b0 < 3; ++b0)
{
aint2[b0] = par2ArrayOfInteger[b0] - par1ArrayOfInteger[b0];
if (Math.abs(aint2[b0]) > Math.abs(aint2[b1]))
{
b1 = b0;
}
}
if (aint2[b1] == 0)
{
return -1;
}
else
{
byte b2 = otherCoordPairs[b1];
byte b3 = otherCoordPairs[b1 + 3];
byte b4;
if (aint2[b1] > 0)
{
b4 = 1;
}
else
{
b4 = -1;
}
double d0 = (double)aint2[b2] / (double)aint2[b1];
double d1 = (double)aint2[b3] / (double)aint2[b1];
int[] aint3 = new int[] {0, 0, 0};
int i = 0;
int j;
for (j = aint2[b1] + b4; i != j; i += b4)
{
aint3[b1] = par1ArrayOfInteger[b1] + i;
aint3[b2] = MathHelper.floor_double((double)par1ArrayOfInteger[b2] + (double)i * d0);
aint3[b3] = MathHelper.floor_double((double)par1ArrayOfInteger[b3] + (double)i * d1);
Block block = this.worldObj.func_147439_a(aint3[0], aint3[1], aint3[2]);
if (!this.isReplaceable(worldObj, aint3[0], aint3[1], aint3[2]))
{
break;
}
}
return i == j ? -1 : Math.abs(i);
}
}
// JAVADOC METHOD $$ func_76497_e
boolean validTreeLocation()
{
int[] aint = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]};
int[] aint1 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]};
Block block = this.worldObj.func_147439_a(this.basePos[0], this.basePos[1] - 1, this.basePos[2]);
boolean isSoil = block.canSustainPlant(worldObj, basePos[0], basePos[1] - 1, basePos[2], ForgeDirection.UP, (BlockSapling)Blocks.sapling);
if (!isSoil)
{
return false;
}
else
{
int i = this.checkBlockLine(aint, aint1);
if (i == -1)
{
return true;
}
else if (i < 6)
{
return false;
}
else
{
this.heightLimit = i;
return true;
}
}
}
@Override
public void setScale(double par1, double par3, double par5)
{
this.heightLimitLimit = (int)(par1 * 12.0D);
if (par1 > 0.5D)
{
this.leafDistanceLimit = 5;
}
this.scaleWidth = par3;
this.leafDensity = par5;
}
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
this.worldObj = par1World;
long l = par2Random.nextLong();
this.rand.setSeed(l);
this.basePos[0] = par3;
this.basePos[1] = par4;
this.basePos[2] = par5;
if (this.heightLimit == 0)
{
this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit);
}
if (!this.validTreeLocation())
{
return false;
}
else
{
this.generateLeafNodeList();
this.generateLeaves();
this.generateTrunk();
this.generateLeafNodeBases();
return true;
}
}
}

View file

@ -21,7 +21,18 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
private final int metaWood;
private final int metaLeaves;
private final int minI;
private final int randomI;
private final int minK;
private final int randomK;
public WorldGenBOPTaiga2(Block wood, Block leaves, int metaWood, int metaLeaves, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight)
{
this(wood, leaves, metaWood, metaLeaves, doBlockNotify, minTreeHeight, randomTreeHeight, 1, 2, 2, 2);
}
public WorldGenBOPTaiga2(Block wood, Block leaves, int metaWood, int metaLeaves, boolean doBlockNotify, int minTreeHeight, int randomTreeHeight, int minI, int randomI, int minK, int randomK)
{
super(doBlockNotify);
@ -31,15 +42,21 @@ public class WorldGenBOPTaiga2 extends WorldGenAbstractTree
this.metaLeaves = metaLeaves;
this.minTreeHeight = minTreeHeight;
this.randomTreeHeight = randomTreeHeight;
this.minI = minI;
this.randomI = randomI;
this.minK = minK;
this.randomK = randomK;
}
@Override
public boolean generate(World world, Random random, int x, int y, int z)
{
int l = random.nextInt(randomTreeHeight) + minTreeHeight;
int i1 = 1 + random.nextInt(2);
int i1 = minI + random.nextInt(randomI);
int j1 = l - i1;
int k1 = 2 + random.nextInt(2);
int k1 = minK + random.nextInt(randomK);
boolean flag = true;
if (y >= 1 && y + l + 1 <= 256)

View file

@ -105,7 +105,7 @@ public class WorldGenBulbTree extends WorldGenAbstractTree
for (k1 = y - b0 + l; k1 <= y + l; ++k1)
{
i3 = k1 - (y + l);
l1 = b1 + 1 - i3 / 2;
l1 = b1 + 1 - i3 / 3;
for (i2 = x - l1; i2 <= x + l1; ++i2)
{
@ -137,38 +137,38 @@ public class WorldGenBulbTree extends WorldGenAbstractTree
//TODO: setBlockAndMetadata()
this.func_150516_a(world, x, y + k1, z, wood, metaWood);
this.func_150516_a(world, x - 1, y + (l - 4), z, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 4), z, leaves, 1);
this.func_150516_a(world, x, y + (l - 4), z - 1, leaves, 1);
this.func_150516_a(world, x, y + (l - 4), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 4), z, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 4), z, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 4), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 4), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 5), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 5), z - 1, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 5), z + 1, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 5), z - 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 5), z, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 5), z, leaves, 1);
this.func_150516_a(world, x, y + (l - 5), z - 1, leaves, 1);
this.func_150516_a(world, x, y + (l - 5), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 5), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 5), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 5), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 5), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 5), z, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 5), z, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 5), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 5), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 6), z, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 6), z, leaves, 1);
this.func_150516_a(world, x, y + (l - 6), z - 1, leaves, 1);
this.func_150516_a(world, x, y + (l), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 6), z, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 6), z, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 6), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 7), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 7), z - 1, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 7), z + 1, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 7), z - 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 7), z, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 7), z, leaves, 1);
this.func_150516_a(world, x, y + (l - 7), z - 1, leaves, 1);
this.func_150516_a(world, x, y + (l - 7), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 7), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 7), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 7), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 7), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 7), z, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 7), z, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 7), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 7), z + 1, leaves, metaLeaves);
this.func_150516_a(world, x - 1, y + (l - 8), z, leaves, 1);
this.func_150516_a(world, x + 1, y + (l - 8), z, leaves, 1);
this.func_150516_a(world, x, y + (l - 8), z - 1, leaves, 1);
this.func_150516_a(world, x, y + (l - 8), z + 1, leaves, 1);
this.func_150516_a(world, x - 1, y + (l - 8), z, leaves, metaLeaves);
this.func_150516_a(world, x + 1, y + (l - 8), z, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 8), z - 1, leaves, metaLeaves);
this.func_150516_a(world, x, y + (l - 8), z + 1, leaves, metaLeaves);
if (this.vinesGrow && k1 > 0)
{

View file

@ -9,6 +9,6 @@ public class SwampForcedDecorator extends ForcedDecorator
{
public SwampForcedDecorator()
{
this.bopWorldFeatures.perChunk.mudPerChunk = 3;
this.bopWorldFeatures.mudPerChunk = 3;
}
}

View file

@ -0,0 +1,36 @@
package biomesoplenty.common.world.generation;
import java.util.HashMap;
import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.forceddecorators.ForcedDecorator;
public class ForcedBOPWorldGenerators
{
public static HashMap<Class, ForcedWorldGeneratorBOP> forcedGeneratorMap = new HashMap();
public static void init()
{
addForcedGenerators();
}
private static void addForcedGenerators()
{
}
public static void addForcedGenerator(Class worldGenClass, ForcedWorldGeneratorBOP generator)
{
forcedGeneratorMap.put(worldGenClass, generator);
}
public static ForcedWorldGeneratorBOP getForcedGenerator(Class worldGenClass)
{
return forcedGeneratorMap.get(worldGenClass);
}
public static boolean hasForcedGenerator(Class worldGenClass)
{
return forcedGeneratorMap.containsKey(worldGenClass);
}
}

View file

@ -0,0 +1,15 @@
package biomesoplenty.common.world.generation;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
public abstract class ForcedWorldGeneratorBOP implements IWorldGeneratorBOP
{
@Override
public abstract void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception;
}

View file

@ -0,0 +1,14 @@
package biomesoplenty.common.world.generation;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
public interface IWorldGeneratorBOP
{
public void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int randX, int randZ) throws Exception;
}

View file

@ -1,8 +1,10 @@
package biomesoplenty.common.world;
package biomesoplenty.common.world.generation;
import java.util.HashMap;
import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.WorldGenDoublePlant;
import net.minecraft.world.gen.feature.WorldGenLakes;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
@ -38,6 +40,9 @@ public class WorldGenFieldAssociation
associateField("poisonIvyPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 7));
associateField("berryBushesPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 8));
associateField("portobellosPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("mushrooms"), 1));
associateField("koruPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 12));
associateField("toadstoolsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("mushrooms"), 0));
associateField("blueMilksPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("mushrooms"), 2));
WorldGenDoublePlant doubleTallGrass = new WorldGenDoublePlant();
//TODO: setMetadata() ?

View file

@ -0,0 +1,15 @@
package biomesoplenty.common.world.generation;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.common.world.decoration.IBOPDecoration;
public abstract class WorldGeneratorBOP extends WorldGenerator implements IWorldGeneratorBOP
{
@Override
public abstract void doGeneration(World world, Random random, Field worldGeneratorField, WorldGenerator worldGenerator, BiomeGenBase biome, IBOPDecoration bopDecoration, int x, int z) throws Exception;
}