Added BiomeDictionary support to Oil gen

Can't believe I didn't see this thing sooner.
This commit is contained in:
CovertJaguar 2013-05-28 05:02:03 -07:00
parent 7e8bcadbb2
commit 95114cf79a
4 changed files with 24 additions and 8 deletions

View file

@ -64,6 +64,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.BiomeDictionary;
@Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
@ -132,9 +133,7 @@ public class BuildCraftEnergy {
if (BiomeGenBase.biomeList[oilDesertId] != null) {
throw new BiomeIdException("oilDesert", oilDesertId);
}
biomeOilDesert = new BiomeGenOilDesert(oilDesertId);
OilPopulate.INSTANCE.excessiveBiomes.add(biomeOilDesert.biomeID);
OilPopulate.INSTANCE.surfaceDepositBiomes.add(biomeOilDesert.biomeID);
biomeOilDesert = BiomeGenOilDesert.makeBiome(oilDesertId);
}
int oilOceanId = oilOceanBiomeId.getInt();
@ -142,9 +141,7 @@ public class BuildCraftEnergy {
if (BiomeGenBase.biomeList[oilOceanId] != null) {
throw new BiomeIdException("oilOcean", oilOceanId);
}
biomeOilOcean = new BiomeGenOilOcean(oilOceanId);
OilPopulate.INSTANCE.excessiveBiomes.add(biomeOilOcean.biomeID);
OilPopulate.INSTANCE.surfaceDepositBiomes.add(biomeOilOcean.biomeID);
biomeOilOcean = BiomeGenOilOcean.makeBiome(oilOceanId);
}

View file

@ -3,6 +3,7 @@ package buildcraft.energy.worldgen;
import java.util.Random;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenDesert;
import net.minecraftforge.common.BiomeDictionary;
/**
*
@ -10,7 +11,15 @@ import net.minecraft.world.biome.BiomeGenDesert;
*/
public class BiomeGenOilDesert extends BiomeGenDesert {
public BiomeGenOilDesert(int id) {
public static BiomeGenOilDesert makeBiome(int id) {
BiomeGenOilDesert biome = new BiomeGenOilDesert(id);
BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
OilPopulate.INSTANCE.excessiveBiomes.add(biome.biomeID);
OilPopulate.INSTANCE.surfaceDepositBiomes.add(biome.biomeID);
return biome;
}
private BiomeGenOilDesert(int id) {
super(id);
setColor(16421912);
setBiomeName("Desert Oil Field");

View file

@ -1,6 +1,7 @@
package buildcraft.energy.worldgen;
import net.minecraft.world.biome.BiomeGenOcean;
import net.minecraftforge.common.BiomeDictionary;
/**
*
@ -8,7 +9,15 @@ import net.minecraft.world.biome.BiomeGenOcean;
*/
public class BiomeGenOilOcean extends BiomeGenOcean {
public BiomeGenOilOcean(int id) {
public static BiomeGenOilOcean makeBiome(int id) {
BiomeGenOilOcean biome = new BiomeGenOilOcean(id);
BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.WATER);
OilPopulate.INSTANCE.excessiveBiomes.add(biome.biomeID);
OilPopulate.INSTANCE.surfaceDepositBiomes.add(biome.biomeID);
return biome;
}
private BiomeGenOilOcean(int id) {
super(id);
setBiomeName("Ocean Oil Field");
setColor(112);

View file

@ -79,6 +79,7 @@ public class OilPopulate {
boolean oilBiome = surfaceDepositBiomes.contains(biome.biomeID)
|| BiomeDictionary.isBiomeOfType(biome, DESERT)
|| BiomeDictionary.isBiomeOfType(biome, WASTELAND)
|| (BiomeDictionary.isBiomeOfType(biome, FOREST) && BiomeDictionary.isBiomeOfType(biome, FROZEN));
double bonus = oilBiome ? 4.0 : 1.0;