Readded the silk glades. 1 left.

This commit is contained in:
Adubbz 2014-01-12 15:45:11 +11:00
parent e9f70274d2
commit b5c4f19ca0
6 changed files with 208 additions and 125 deletions

View file

@ -1,105 +1,125 @@
package biomesoplenty.common.biomes; package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase; import java.util.HashMap;
import java.util.Random;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.trees.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenDeadTree1;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySpider;
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;
public class BiomeGenSilkglades extends BOPBiome public class BiomeGenSilkglades extends BOPBiome
{ {
private static final Height biomeHeight = new Height(0.3F, 0.3F);
public BiomeGenSilkglades(int par1) public BiomeGenSilkglades(int id)
{ {
super(par1); super(id);
/*
customBiomeDecorator.treesPerChunk = 6;
customBiomeDecorator.grassPerChunk = 2;
customBiomeDecorator.wheatGrassPerChunk = 1;
customBiomeDecorator.mushroomsPerChunk = 4;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.reedsPerChunk = -999;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.gravelPerChunk = 3;
customBiomeDecorator.gravelPerChunk2 = 3;
customBiomeDecorator.sproutsPerChunk = 2;
customBiomeDecorator.poisonIvyPerChunk = 2;
customBiomeDecorator.cobwebsPerChunk = 9;
customBiomeDecorator.waterReedsPerChunk = 4;
customBiomeDecorator.koruPerChunk = 1;
customBiomeDecorator.generatePumpkins = true;
waterColorMultiplier = 16777079;
spawnableWaterCreatureList.clear();
spawnableCreatureList.clear();
spawnableCreatureList.add(new SpawnListEntry(EntitySpider.class, 7, 1, 2));
*/
}
/** //TODO: setHeight()
* Gets a WorldGen appropriate for this biome. this.func_150570_a(biomeHeight);
*/ //TODO: setColor()
/* this.setColor(13420973);
@Override this.setTemperatureRainfall(0.5F, 0.9F);
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return par1Random.nextInt(5) == 0 ? new WorldGenBirchWillow() : (par1Random.nextInt(7) == 0 ? new WorldGenDeadTree(false) : (par1Random.nextInt(12) == 0 ? new WorldGenCobwebNest(0,0) : new WorldGenWillow()));
}
*/
/** this.spawnableWaterCreatureList.clear();
* Gets a WorldGen appropriate for this biome. this.spawnableCreatureList.clear();
*/
/* this.spawnableCreatureList.add(new SpawnListEntry(EntitySpider.class, 7, 1, 2));
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random) this.waterColorMultiplier = 16777079;
{
return new WorldGenTallGrass(Block.tallGrass.blockID, 0); this.theBiomeDecorator.treesPerChunk = 6;
this.theBiomeDecorator.grassPerChunk = 2;
this.theBiomeDecorator.mushroomsPerChunk = 4;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.reedsPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.sproutsPerChunk = 2;
this.bopWorldFeatures.poisonIvyPerChunk = 2;
this.bopWorldFeatures.cobwebsPerChunk = 9;
this.bopWorldFeatures.waterReedsPerChunk = 4;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.generatePumpkins = true;
this.bopWorldFeatures.cobwebNestsPerChunk = 2;
} }
@Override @Override
public void decorate(World par1World, Random par2Random, int par3, int par4) //TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{ {
super.decorate(par1World, par2Random, par3, par4); return random.nextInt(5) == 0 ? new WorldGenBOPSwampTree(Blocks.log, BOPBlockHelper.get("leaves2"), 0, 0, 6, 9, BOPBlockHelper.get("leaves2"), 0) :
int var5 = 12 + par2Random.nextInt(6); (random.nextInt(7) == 0 ? new WorldGenDeadTree1(false, Blocks.dirt, Blocks.grass, BOPBlockHelper.get("driedDirt"), BOPBlockHelper.get("mud")) :
new WorldGenBOPSwampTree(BOPBlockHelper.get("logs3"), BOPBlockHelper.get("colorizedLeaves2"), 1, 0, 6, 9, BOPBlockHelper.get("colorizedLeaves2"), 0));
}
@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, 0), 1D);
return grassMap;
}
@Override
public void decorate(World world, Random random, int chunkX, int chunkZ)
{
super.decorate(world, random, chunkX, chunkZ);
int var5 = 12 + random.nextInt(6);
for (int var6 = 0; var6 < var5; ++var6) for (int var6 = 0; var6 < var5; ++var6)
{ {
int var7 = par3 + par2Random.nextInt(16); int x = chunkX + random.nextInt(16);
int var8 = par2Random.nextInt(28) + 4; int y = random.nextInt(28) + 4;
int var9 = par4 + par2Random.nextInt(16); int z = chunkZ + random.nextInt(16);
int var10 = par1World.getBlockId(var7, var8, var9);
Block block = Block.blocksList[var10]; //TODO: getBlock()
if (block != null && block.isGenMineableReplaceable(par1World, var7, var8, var9, Block.stone.blockID)) Block block = world.func_147439_a(x, y, z);
if (block != null && block.isReplaceableOreGen(world, x, y, z, Blocks.stone))
{ {
par1World.setBlock(var7, var8, var9, Blocks.amethystOre.get().blockID, 10, 2); //TODO: setBlock()
world.func_147465_d(x, y, z, BOPBlockHelper.get("gemOre"), 10, 2);
} }
} }
} }
*/
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
/*
@Override @Override
public int getBiomeGrassColor() //TODO: getBiomeGrassColor()
public int func_150558_b(int x, int y, int z)
{ {
return 13420973; return 13420973;
} }
*/
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
/*
@Override @Override
public int getBiomeFoliageColor() //TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{ {
return 14146486; return 14146486;
} }
*/
/**
* Fog Color @Override
*/ public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors) return 13553096;
else return super.getSkyColorByTemp(par1);
}
/* /*
@Override @Override
public int getFogColour() public int getFogColour()
@ -114,32 +134,4 @@ public class BiomeGenSilkglades extends BOPBiome
return 0.8F; return 0.8F;
} }
*/ */
/**
* takes temperature, returns color
*/
/*
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 13553096;
else
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
}
*/
} }

View file

@ -50,6 +50,7 @@ import biomesoplenty.common.biomes.BiomeGenSacredSprings;
import biomesoplenty.common.biomes.BiomeGenSeasonalForest; import biomesoplenty.common.biomes.BiomeGenSeasonalForest;
import biomesoplenty.common.biomes.BiomeGenShield; import biomesoplenty.common.biomes.BiomeGenShield;
import biomesoplenty.common.biomes.BiomeGenShrubland; import biomesoplenty.common.biomes.BiomeGenShrubland;
import biomesoplenty.common.biomes.BiomeGenSilkglades;
import biomesoplenty.common.biomes.BiomeGenSludgepit; import biomesoplenty.common.biomes.BiomeGenSludgepit;
import biomesoplenty.common.biomes.BiomeGenSpruceWoods; import biomesoplenty.common.biomes.BiomeGenSpruceWoods;
import biomesoplenty.common.biomes.BiomeGenTemperateRainforest; import biomesoplenty.common.biomes.BiomeGenTemperateRainforest;
@ -149,8 +150,8 @@ public class BOPBiomes
registerBiome(new BOPBiomeListEntry(new BiomeGenSeasonalForest(BOPConfigurationIDs.seasonalForestID).setBiomeName("Seasonal Forest"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenSeasonalForest(BOPConfigurationIDs.seasonalForestID).setBiomeName("Seasonal Forest"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShield(BOPConfigurationIDs.shieldID).setBiomeName("Shield"), BOPBiomeTemperatureType.COOL));
registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenShrubland(BOPConfigurationIDs.shrublandID).setBiomeName("Shrubland"), BOPBiomeTemperatureType.COOL));
//registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL)); registerBiome(new BOPBiomeListEntry(new BiomeGenSilkglades(BOPConfigurationIDs.silkgladesID).setBiomeName("Silkglades"), BOPBiomeTemperatureType.COOL));
registerOnlyBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenSludgepit(BOPConfigurationIDs.sludgepitID).setBiomeName("Sludgepit"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenSpruceWoods(BOPConfigurationIDs.spruceWoodsID).setBiomeName("Spruce Woods"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenTemperateRainforest(BOPConfigurationIDs.temperateRainforestID).setBiomeName("Temperate Rainforest"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM)); registerBiome(new BOPBiomeListEntry(new BiomeGenThicket(BOPConfigurationIDs.thicketID).setBiomeName("Thicket"), BOPBiomeTemperatureType.WARM));

View file

@ -52,6 +52,8 @@ public class BOPWorldFeatures
public int rockpilesPerChunk = 0; public int rockpilesPerChunk = 0;
public int logsPerChunk = 0; public int logsPerChunk = 0;
public int lavaSpoutsPerChunk = 0; public int lavaSpoutsPerChunk = 0;
public int cobwebsPerChunk = 0;
public int cobwebNestsPerChunk = 0;
public int bopFlowersPerChunk = 0; public int bopFlowersPerChunk = 0;
} }

View file

@ -4,10 +4,12 @@ import java.lang.reflect.Field;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.decoration.IBOPDecoration; import biomesoplenty.common.world.decoration.IBOPDecoration;
import biomesoplenty.common.world.generation.WorldGeneratorBOP; import biomesoplenty.common.world.generation.WorldGeneratorBOP;
@ -39,8 +41,10 @@ public class WorldGenBOPFlora extends WorldGeneratorBOP
int j1 = y + random.nextInt(4) - random.nextInt(4); int j1 = y + random.nextInt(4) - random.nextInt(4);
int k1 = z + random.nextInt(8) - random.nextInt(8); int k1 = z + random.nextInt(8) - random.nextInt(8);
//TODO: isAirBlock() canReplace() //TODO: isAirBlock()
if (world.func_147437_c(i1, j1, k1) && (!world.provider.hasNoSky || j1 < 255) && this.flora.func_149705_a(world, i1, j1, k1, 0, new ItemStack(flora, 1, floraMeta))) if (world.func_147437_c(i1, j1, k1) && (!world.provider.hasNoSky || j1 < 255) &&
(flora == Blocks.web ? world.func_147439_a(i1, j1 + 1, k1) == BOPBlockHelper.get("leaves2") || world.func_147439_a(i1, j1 + 1, k1) == BOPBlockHelper.get("colorizedLeaves2") || world.func_147439_a(i1, j1 - 1, k1) == Blocks.grass :
this.flora.func_149705_a(world, i1, j1, k1, 0, new ItemStack(flora, 1, floraMeta))))
{ {
//TODO: setBlock() //TODO: setBlock()
world.func_147465_d(i1, j1, k1, this.flora, this.floraMeta, 2); world.func_147465_d(i1, j1, k1, this.flora, this.floraMeta, 2);

View file

@ -0,0 +1,81 @@
package biomesoplenty.common.world.features;
import java.lang.reflect.Field;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.entity.monster.EntitySpider;
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 WorldGenCobwebNest extends WorldGeneratorBOP
{
@Override
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
Block var15;
//TODO: getBlock()
for (boolean var6 = false; ((var15 = par1World.func_147439_a(par3, par4, par5)) == Blocks.air || var15 == Blocks.web) && par4 > 0; --par4)
{
;
}
Block block = par1World.func_147439_a(par3, par4, par5);
if (block == Blocks.grass)
{
++par4;
this.func_150516_a(par1World, par3, par4, par5, Blocks.web, 0);
int var999 = par2Random.nextInt(3);
if (var999 == 0)
{
EntitySpider spider = new EntitySpider(par1World);
spider.setLocationAndAngles((double)par3, (double)par4 + 1, (double)par5, 0.0F, 0.0F);
par1World.spawnEntityInWorld(spider);
}
for (int var8 = par4; var8 <= par4 + 1; ++var8)
{
int var9 = var8 - par4;
int var10 = 2 - var9;
for (int var11 = par3 - var10; var11 <= par3 + var10; ++var11)
{
int var12 = var11 - par3;
for (int var13 = par5 - var10; var13 <= par5 + var10; ++var13)
{
int var14 = var13 - par5;
if (Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0)
{
this.func_150516_a(par1World, var11, var8, var13, Blocks.web, 0);
}
}
}
}
}
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;
int randY = random.nextInt(world.getHeightValue(randX, randZ) * 2);
worldGenerator.generate(world, random, randX, randY, randZ);
}
}
}

View file

@ -11,6 +11,7 @@ import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora; import biomesoplenty.common.world.features.WorldGenBOPDoubleFlora;
import biomesoplenty.common.world.features.WorldGenBOPFlora; import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass; import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
import biomesoplenty.common.world.features.WorldGenCobwebNest;
import biomesoplenty.common.world.features.WorldGenGrassSplatter; import biomesoplenty.common.world.features.WorldGenGrassSplatter;
import biomesoplenty.common.world.features.WorldGenLavaSpout; import biomesoplenty.common.world.features.WorldGenLavaSpout;
import biomesoplenty.common.world.features.WorldGenLog; import biomesoplenty.common.world.features.WorldGenLog;
@ -78,6 +79,8 @@ public class WorldGenFieldAssociation
associateField("rockpilesPerChunk", new WorldGenRockpile()); associateField("rockpilesPerChunk", new WorldGenRockpile());
associateField("logsPerChunk", new WorldGenLog()); associateField("logsPerChunk", new WorldGenLog());
associateField("lavaSpoutsPerChunk", new WorldGenLavaSpout()); associateField("lavaSpoutsPerChunk", new WorldGenLavaSpout());
associateField("cobwebsPerChunk", new WorldGenBOPFlora(Blocks.web, 0));
associateField("cobwebNestsPerChunk", new WorldGenCobwebNest());
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8)); associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8)); associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));