Readded the More, Mystic Grove and Origin Valley, also potentially fixed issues with the Tempt Event Handler

This commit is contained in:
Adubbz 2014-01-10 10:44:49 +11:00
parent c063037253
commit 04ad68c0e8
7 changed files with 202 additions and 178 deletions

View file

@ -1,123 +1,116 @@
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.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.WorldGenBOPFlora;
import biomesoplenty.common.world.features.WorldGenBOPTallGrass;
public class BiomeGenMoor extends BOPBiome
{
private static final Height biomeHeight = new Height(0.7F, 0.8F);
public BiomeGenMoor(int par1)
public BiomeGenMoor(int id)
{
super(par1);
/*
spawnableCreatureList.clear();
spawnableWaterCreatureList.clear();
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
customBiomeDecorator.treesPerChunk = -999;
customBiomeDecorator.flowersPerChunk = -999;
customBiomeDecorator.grassPerChunk = 15;
customBiomeDecorator.mushroomsPerChunk = 2;
customBiomeDecorator.sandPerChunk = -999;
customBiomeDecorator.sandPerChunk2 = -999;
customBiomeDecorator.mudPerChunk = 1;
customBiomeDecorator.mudPerChunk2 = 1;
customBiomeDecorator.waterLakesPerChunk = 10;
customBiomeDecorator.blueFlowersPerChunk = 6;
customBiomeDecorator.wheatGrassPerChunk = 7;
customBiomeDecorator.koruPerChunk = 1;
waterColorMultiplier = 5800566;
customBiomeDecorator.generatePumpkins = false;
*/
}
super(id);
//public void decorate(World par1World, Random par2Random, int par3, int par4)
//{
// super.decorate(par1World, par2Random, par3, par4);
// WorldGenMoor var5 = new WorldGenMoor();
//
// for (int var6 = 0; var6 < 16; ++var6)
// {
// int var7 = par3 + par2Random.nextInt(16) + 8;
// byte var8 = 64;
// int var9 = par4 + par2Random.nextInt(16) + 8;
// var5.generate(par1World, par2Random, var7, var8, var9);
// }
//}
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(6394725);
this.setTemperatureRainfall(0.5F, 1.0F);
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return (par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 1) : (par1Random.nextInt(3) == 0 ? new WorldGenTallGrass(Blocks.foliage.get().blockID, 2) : new WorldGenTallGrass(Blocks.foliage.get().blockID, 1)));
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
this.waterColorMultiplier = 5800566;
this.theBiomeDecorator.treesPerChunk = -999;
this.theBiomeDecorator.flowersPerChunk = -999;
this.theBiomeDecorator.grassPerChunk = 15;
this.theBiomeDecorator.mushroomsPerChunk = 2;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.bopWorldFeatures.mudPerChunk = 1;
this.bopWorldFeatures.waterLakesPerChunk = 10;
this.bopWorldFeatures.bopFlowersPerChunk = 6;
this.bopWorldFeatures.koruPerChunk = 1;
this.bopWorldFeatures.generatePumpkins = false;
}
@Override
public void decorate(World par1World, Random par2Random, int par3, int par4)
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
super.decorate(par1World, par2Random, par3, par4);
int var5 = 3 + par2Random.nextInt(6);
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 1), 1D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D);
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 6394725;
}
@Override
public int getBiomeFoliageColor()
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 6394725;
}
*/
/**
* takes temperature, returns color
*/
/*
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 10536403;
else
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
if (BOPConfigurationMisc.skyColors) return 10536403;
else return super.getSkyColorByTemp(par1);
}
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

@ -1,21 +1,34 @@
package biomesoplenty.common.biomes;
import java.util.HashMap;
import java.util.Random;
import net.minecraft.entity.monster.EntityWitch;
import net.minecraft.init.Blocks;
import net.minecraft.world.gen.feature.WorldGenTallGrass;
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.WorldGenBOPSwampTree;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
public class BiomeGenMysticGrove extends BOPBiome
{
private static final Height biomeHeight = new Height(0.3F, 0.8F);
public BiomeGenMysticGrove(int id)
{
super(id);
//TODO: setHeight()
this.func_150570_a(biomeHeight);
this.setEnableSnow();
//TODO: setColor()
this.setColor(6934491);
this.setTemperatureRainfall(0.9F, 1.0F);
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
this.spawnableWaterCreatureList.clear();
@ -27,33 +40,52 @@ public class BiomeGenMysticGrove extends BOPBiome
this.theBiomeDecorator.grassPerChunk = 15;
this.theBiomeDecorator.sandPerChunk = -999;
this.theBiomeDecorator.sandPerChunk2 = -999;
this.theBiomeDecorator.flowersPerChunk = 8;
/*customBiomeDecorator.rosesPerChunk = 8;
customBiomeDecorator.flowersPerChunk = 8;
customBiomeDecorator.pinkFlowersPerChunk = 9;
customBiomeDecorator.glowFlowersPerChunk = 10;
customBiomeDecorator.sproutsPerChunk = 1;
customBiomeDecorator.hydrangeasPerChunk = 6;
customBiomeDecorator.blueMilksPerChunk = 1;
customBiomeDecorator.lilyflowersPerChunk = 3;
customBiomeDecorator.poisonWaterPerChunk = 1;*/
this.bopWorldFeatures.bopFlowersPerChunk = 10;
this.bopWorldFeatures.sproutsPerChunk = 1;
this.bopWorldFeatures.blueMilksPerChunk = 1;
//TODO: FEATURE customBiomeDecorator.poisonWaterPerChunk = 1;
this.bopWorldFeatures.cloverPatchesPerChunk = 10;
this.bopWorldFeatures.shrubsPerChunk = 4;
}
/*@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
@Override
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return par1Random.nextInt(4) == 0 ? new WorldGenMystic2(false) : (par1Random.nextInt(3) == 0 ? new WorldGenOriginalTree(BOPBlockHelper.get("logs4"), BOPBlockHelper.get("leaves4"), 2, 1) : ((par1Random.nextInt(3) == 0 ? this.worldGeneratorBigTree : ((par1Random.nextInt(8) == 0 ? new WorldGenSwampTree(Blocks.log, Blocks.leaves, 0, 0, 6, 8) : this.worldGeneratorTrees)))));
}*/
return random.nextInt(4) == 0 ? new WorldGenOriginalTree(BOPBlockHelper.get("logs2"), BOPBlockHelper.get("leaves1"), 1, 2, false, 5, 3, false) :
(random.nextInt(3) == 0 ? new WorldGenOriginalTree(BOPBlockHelper.get("logs4"), BOPBlockHelper.get("leaves4"), 2, 1) :
((random.nextInt(3) == 0 ? this.worldGeneratorBigTree :
((random.nextInt(8) == 0 ? new WorldGenBOPSwampTree(Blocks.log, Blocks.leaves, 0, 0, 6, 8) : this.worldGeneratorTrees)))));
}
@Override
public WorldGenerator getRandomWorldGenForGrass(Random random)
public HashMap<WorldGenerator, Double> getWeightedWorldGenForBOPFlowers()
{
return (random.nextInt(5) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 1) : (random.nextInt(3) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 2) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 10) : (random.nextInt(2) == 0 ? new WorldGenTallGrass(BOPBlockHelper.get("foliage"), 11) : new WorldGenTallGrass(Blocks.tallgrass, 1)))));
HashMap<WorldGenerator, Double> flowerMap = new HashMap();
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 6), 3D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 3), 4D);
flowerMap.put(new WorldGenBOPFlora(BOPBlockHelper.get("flowers"), 4), 1D);
return flowerMap;
}
@Override
public HashMap<WorldGenerator, Double> getWeightedWorldGenForGrass()
{
HashMap<WorldGenerator, Double> grassMap = new HashMap();
grassMap.put(new WorldGenBOPTallGrass(Blocks.tallgrass, 1), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 1), 1D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 2), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 10), 0.5D);
grassMap.put(new WorldGenBOPTallGrass(BOPBlockHelper.get("foliage"), 11), 0.5D);
return grassMap;
}
@Override

View file

@ -1,77 +1,69 @@
package biomesoplenty.common.biomes;
import net.minecraft.world.biome.BiomeGenBase;
import java.util.Random;
import net.minecraft.init.Blocks;
import net.minecraft.world.biome.BiomeGenBase.Height;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraft.world.gen.feature.WorldGenerator;
import biomesoplenty.api.BOPBlockHelper;
import biomesoplenty.common.configuration.BOPConfigurationMisc;
import biomesoplenty.common.world.features.trees.WorldGenOriginalTree;
public class BiomeGenOriginValley extends BOPBiome
{
private static final Height biomeHeight = new Height(0.2F, 0.6F);
public BiomeGenOriginValley(int par1)
public BiomeGenOriginValley(int id)
{
super(par1);
super(id);
/*
theBiomeDecorator = new BiomeDecoratorBOP(this);
customBiomeDecorator = (BiomeDecoratorBOP)theBiomeDecorator;
topBlock = (byte)Blocks.originGrass.get().blockID;
customBiomeDecorator.treesPerChunk = 4;
customBiomeDecorator.grassPerChunk = -999;
customBiomeDecorator.generatePumpkins = false;
customBiomeDecorator.sandPerChunk = 0;
customBiomeDecorator.sandPerChunk2 = 0;
customBiomeDecorator.clayPerChunk = 0;
customBiomeDecorator.rootsPerChunk = -999;
customBiomeDecorator.stalagmitesPerChunk = -999;
customBiomeDecorator.stalactitesPerChunk = -999;
customBiomeDecorator.minersDelightPerChunk = -999;
customBiomeDecorator.generateUndergroundLakes = false;
*/
//TODO: setHeight()
this.func_150570_a(biomeHeight);
//TODO: setColor()
this.setColor(10341485);
this.setTemperatureRainfall(0.7F, 0.8F);
this.topBlock = BOPBlockHelper.get("originGrass");
this.theBiomeDecorator.treesPerChunk = 4;
this.theBiomeDecorator.grassPerChunk = -999;
this.theBiomeDecorator.sandPerChunk = 0;
this.theBiomeDecorator.sandPerChunk2 = 0;
this.theBiomeDecorator.clayPerChunk = 0;
this.bopWorldFeatures.rootsPerChunk = -999;
this.bopWorldFeatures.stalagmitesPerChunk = -999;
this.bopWorldFeatures.stalactitesPerChunk = -999;
this.bopWorldFeatures.minersDelightPerChunk = -999;
//TODO: FEATURE this.theBiomeDecorator.generateUndergroundLakes = false;
this.bopWorldFeatures.generatePumpkins = false;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
/*
@Override
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
//TODO: getRandomWorldGenForTrees()
public WorldGenAbstractTree func_150567_a(Random random)
{
return new WorldGenOriginTree(false);
return new WorldGenOriginalTree(Blocks.log, BOPBlockHelper.get("leaves3"), 0, 0, false, 5, 3, false);
}
*/
/*@Override
public int getBiomeGrassColor()
@Override
//TODO: getBiomeGrassColor()
public int func_150558_b(int p_150558_1_, int p_150558_2_, int p_150558_3_)
{
return 10682207;
}
@Override
public int getBiomeFoliageColor()
//TODO: getBiomeFoliageColor()
public int func_150571_c(int x, int y, int z)
{
return 3866368;
}*/
}
/*
@Override
public int getSkyColorByTemp(float par1)
{
if (BOPConfigurationMisc.skyColors)
return 8441086;
else
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
if (BOPConfigurationMisc.skyColors) return 8441086;
else return super.getSkyColorByTemp(par1);
}
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

@ -35,8 +35,11 @@ import biomesoplenty.common.biomes.BiomeGenLushSwamp;
import biomesoplenty.common.biomes.BiomeGenMapleWoods;
import biomesoplenty.common.biomes.BiomeGenMarsh;
import biomesoplenty.common.biomes.BiomeGenMeadow;
import biomesoplenty.common.biomes.BiomeGenMoor;
import biomesoplenty.common.biomes.BiomeGenMountain;
import biomesoplenty.common.biomes.BiomeGenMysticGrove;
import biomesoplenty.common.biomes.BiomeGenOminousWoods;
import biomesoplenty.common.biomes.BiomeGenOriginValley;
import biomesoplenty.common.biomes.BiomeGenPasture;
import biomesoplenty.common.biomes.BiomeGenRainforest;
import biomesoplenty.common.biomes.BiomeGenSacredSprings;
@ -115,11 +118,11 @@ public class BOPBiomes
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 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 BiomeGenMysticGrove(BOPConfigurationIDs.mysticGroveID).setBiomeName("Mystic Grove"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenOminousWoods(BOPConfigurationIDs.ominousWoodsID).setBiomeName("Ominous Woods"), BOPBiomeTemperatureType.COOL));
//registerBiome(new BOPBiomeListEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), BOPBiomeTemperatureType.WARM));
registerBiome(new BOPBiomeListEntry(new BiomeGenOriginValley(BOPConfigurationIDs.originValleyID).setBiomeName("Origin Valley"), BOPBiomeTemperatureType.WARM));
/*registerBiome(new BOPBiomeListEntry(new BiomeGenOutback(BOPConfigurationIDs.outbackID).setBiomeName("Outback"), BOPBiomeTemperatureType.HOT));*/
registerBiome(new BOPBiomeListEntry(new BiomeGenPasture(BOPConfigurationIDs.pastureID).setBiomeName("Pasture"), BOPBiomeTemperatureType.WARM));
//registerBiome(new BOPBiomeListEntry(new BiomeGenPrairie(BOPConfigurationIDs.prairieID).setBiomeName("Prairie"), BOPBiomeTemperatureType.WARM));

View file

@ -11,8 +11,8 @@ import net.minecraft.entity.passive.EntitySheep;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import biomesoplenty.api.BOPItemHelper;
import biomesoplenty.common.entities.ai.EntityAITemptArmor;
import cpw.mods.fml.common.ObfuscationReflectionHelper;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.ReflectionHelper;
public class TemptEventHandler
{
@ -25,7 +25,7 @@ public class TemptEventHandler
return;
//TODO: FEATURE Remove Reflection
EntityAITasks tasks = ReflectionHelper.getPrivateValue(EntityLiving.class, ((EntityLiving)entity), new String[] { "tasks", "field_75732_c" });
EntityAITasks tasks = ObfuscationReflectionHelper.getPrivateValue(EntityLiving.class, ((EntityLiving)entity), new String[] { "tasks" });
if (entity instanceof EntityChicken)
{

View file

@ -42,6 +42,8 @@ public class BOPWorldFeatures
public int tinyCactiPerChunk = 0;
public int oasesPerChunk = 0;
public int sunflowersPerChunk = 0;
public int minersDelightPerChunk = 2;
public int rootsPerChunk = 9;
public int bopFlowersPerChunk = 0;
}

View file

@ -64,6 +64,8 @@ public class WorldGenFieldAssociation
associateField("sproutsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("foliage"), 5));
associateField("tinyCactiPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 12));
associateField("oasesPerChunk", new WorldGenWaterside(Blocks.grass, 7, Blocks.sand, BOPBlockHelper.get("redRock")));
associateField("minersDelightPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("flowers2"), 6));
associateField("rootsPerChunk", new WorldGenBOPFlora(BOPBlockHelper.get("plants"), 15));
associateField("doubleTallGrassPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 2, 8));
associateField("sunflowersPerChunk", new WorldGenBOPDoubleFlora(Blocks.double_plant, Blocks.double_plant, 0, 8));