This commit is contained in:
Adubbz 2013-05-31 22:01:21 +10:00
commit 06cb92294f
3 changed files with 61 additions and 111 deletions

View file

@ -1,5 +1,7 @@
package biomesoplenty.api;
import java.util.ArrayList;
import net.minecraft.world.biome.BiomeGenBase;
import com.google.common.base.Optional;
@ -11,10 +13,10 @@ public class Biomes
public static Optional<? extends BiomeGenBase> badlands = Optional.absent();
public static Optional<? extends BiomeGenBase> bambooForest = Optional.absent();
public static Optional<? extends BiomeGenBase> bayou = Optional.absent();
public static Optional<? extends BiomeGenBase> beachGravel = Optional.absent();
public static Optional<? extends BiomeGenBase> beachOvergrown = Optional.absent();
public static Optional<? extends BiomeGenBase> birchForest = Optional.absent();
public static Optional<? extends BiomeGenBase> bog = Optional.absent();
public static Optional<? extends BiomeGenBase> borealForest = Optional.absent();
@ -54,18 +56,18 @@ public class Biomes
public static Optional<? extends BiomeGenBase> moor = Optional.absent();
public static Optional<? extends BiomeGenBase> mountain = Optional.absent();
public static Optional<? extends BiomeGenBase> mysticGrove = Optional.absent();
public static Optional<? extends BiomeGenBase> netherBase = Optional.absent();
public static Optional<? extends BiomeGenBase> netherGarden = Optional.absent();
public static Optional<? extends BiomeGenBase> netherDesert = Optional.absent();
public static Optional<? extends BiomeGenBase> netherLava = Optional.absent();
public static Optional<? extends BiomeGenBase> netherBone = Optional.absent();
public static Optional<? extends BiomeGenBase> oasis = Optional.absent();
public static Optional<? extends BiomeGenBase> oceanCoral = Optional.absent();
public static Optional<? extends BiomeGenBase> oceanKelp = Optional.absent();
public static Optional<? extends BiomeGenBase> ominousWoods = Optional.absent();
public static Optional<? extends BiomeGenBase> orchard = Optional.absent();
public static Optional<? extends BiomeGenBase> originValley = Optional.absent();
@ -73,11 +75,11 @@ public class Biomes
public static Optional<? extends BiomeGenBase> pasture = Optional.absent();
public static Optional<? extends BiomeGenBase> polar = Optional.absent();
public static Optional<? extends BiomeGenBase> prairie = Optional.absent();
public static Optional<? extends BiomeGenBase> promisedLandForest = Optional.absent();
public static Optional<? extends BiomeGenBase> promisedLandPlains = Optional.absent();
public static Optional<? extends BiomeGenBase> promisedLandSwamp = Optional.absent();
public static Optional<? extends BiomeGenBase> quagmire = Optional.absent();
public static Optional<? extends BiomeGenBase> rainforest = Optional.absent();
public static Optional<? extends BiomeGenBase> redwoodForest = Optional.absent();
@ -101,7 +103,7 @@ public class Biomes
public static Optional<? extends BiomeGenBase> wasteland = Optional.absent();
public static Optional<? extends BiomeGenBase> wetland = Optional.absent();
public static Optional<? extends BiomeGenBase> woodland = Optional.absent();
public static Optional<? extends BiomeGenBase> plainsNew = Optional.absent();
public static Optional<? extends BiomeGenBase> desertNew = Optional.absent();
public static Optional<? extends BiomeGenBase> extremeHillsNew = Optional.absent();
@ -109,4 +111,9 @@ public class Biomes
public static Optional<? extends BiomeGenBase> taigaNew = Optional.absent();
public static Optional<? extends BiomeGenBase> swamplandNew = Optional.absent();
public static Optional<? extends BiomeGenBase> jungleNew = Optional.absent();
/**
* Add any biomes you wish to spawn in the Nether
*/
public static ArrayList<BiomeGenBase> netherBiomes = new ArrayList<BiomeGenBase>();
}

View file

@ -1,85 +1,25 @@
package biomesoplenty.world;
import net.minecraft.util.Vec3;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.chunk.IChunkProvider;
import biomesoplenty.api.Biomes;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class WorldProviderBOPhell extends WorldProvider
public class WorldProviderBOPhell extends WorldProviderHell
{
@Override
public void registerWorldChunkManager()
{
public void registerWorldChunkManager()
{
if (Biomes.netherGarden.isPresent() || Biomes.netherDesert.isPresent() || Biomes.netherLava.isPresent() || Biomes.netherBone.isPresent())
{
worldChunkMgr = new WorldChunkManagerBOPhell(worldObj);
this.worldChunkMgr = new WorldChunkManagerBOPhell(worldObj);
}
isHellWorld = true;
hasNoSky = true;
dimensionId = -1;
}
@Override
@SideOnly(Side.CLIENT)
public Vec3 getFogColor(float par1, float par2)
{
return worldObj.getWorldVec3Pool().getVecFromPool(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D);
}
@Override
protected void generateLightBrightnessTable()
{
float f = 0.1F;
for (int i = 0; i <= 15; ++i)
{
float f1 = 1.0F - i / 15.0F;
lightBrightnessTable[i] = (1.0F - f1) / (f1 * 3.0F + 1.0F) * (1.0F - f) + f;
}
}
@Override
public boolean isSurfaceWorld()
{
return false;
}
@Override
public boolean canCoordinateBeSpawn(int par1, int par2)
{
return false;
}
@Override
public float calculateCelestialAngle(long par1, float par3)
{
return 0.5F;
}
@Override
public boolean canRespawnHere()
{
return false;
}
@Override
@SideOnly(Side.CLIENT)
public boolean doesXZShowFog(int par1, int par2)
{
return true;
}
@Override
public String getDimensionName()
{
return "Nether";
}
this.isHellWorld = true;
this.hasNoSky = true;
this.dimensionId = -1;
}
@Override
public IChunkProvider createChunkGenerator()
{
return new ChunkProviderBOPhell(worldObj, worldObj.getSeed());
return new ChunkProviderBOPhell(this.worldObj, this.worldObj.getSeed());
}
}

View file

@ -9,22 +9,22 @@ import biomesoplenty.api.Biomes;
public class BiomeLayerBiomes extends BiomeLayer
{
private int dimension = 0;
private int dimension = 0;
private BiomeGenBase[] surfaceBiomes;
private static ArrayList<BiomeGenBase> oceanBiomes = new ArrayList<BiomeGenBase>();
private static ArrayList<BiomeGenBase> netherBiomes = new ArrayList<BiomeGenBase>();
private static ArrayList<BiomeGenBase> promisedBiomes = new ArrayList<BiomeGenBase>();
public BiomeLayerBiomes(long par1, BiomeLayer par3GenLayer, WorldType par4WorldType, int dim)
{
super(par1);
public BiomeLayerBiomes(long par1, BiomeLayer par3GenLayer, WorldType par4WorldType, int dim)
{
super(par1);
parent = par3GenLayer;
dimension = dim;
//SURFACE BIOMES
surfaceBiomes = par4WorldType.getBiomesForWorldType();
//OCEAN BIOMES
oceanBiomes.add(BiomeGenBase.ocean);
if (Biomes.oceanCoral.isPresent())
@ -57,7 +57,11 @@ public class BiomeLayerBiomes extends BiomeLayer
{
netherBiomes.add(Biomes.netherBone.get());
}
if (Biomes.netherBiomes.size() > 0)
{
netherBiomes.addAll(Biomes.netherBiomes);
}
//PROMISED BIOMES
if (Biomes.promisedLandForest.isPresent())
{
@ -71,34 +75,33 @@ public class BiomeLayerBiomes extends BiomeLayer
{
promisedBiomes.add(Biomes.promisedLandSwamp.get());
}
}
}
@Override
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = parent.getInts(par1, par2, par3, par4);
int[] var6 = IntCache.getIntCache(par3 * par4);
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
for (int var7 = 0; var7 < par4; ++var7)
{
for (int var8 = 0; var8 < par3; ++var8)
{
this.initChunkSeed(var8 + par1, var7 + par2);
int var9 = var5[var8 + var7 * par3];
public int[] getInts(int par1, int par2, int par3, int par4)
{
int[] var5 = this.parent.getInts(par1, par2, par3, par4);
int[] var6 = IntCache.getIntCache(par3 * par4);
boolean coral = Biomes.oceanCoral.isPresent();
boolean kelp = Biomes.oceanKelp.isPresent();
for (int var7 = 0; var7 < par4; ++var7)
{
for (int var8 = 0; var8 < par3; ++var8)
{
this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
int var9 = var5[var8 + var7 * par3];
if(dimension == 0) //SURFACE BIOMES
{
if (var9 == 0)
{
var6[var8 + var7 * par3] = 0;
}
else
else
{
var6[var8 + var7 * par3] = surfaceBiomes[this.nextInt(surfaceBiomes.length)].biomeID;
}
if (coral)
{
if(var9 == Biomes.oceanCoral.get().biomeID)
@ -106,7 +109,7 @@ public class BiomeLayerBiomes extends BiomeLayer
var6[var8 + var7 * par3] = oceanBiomes.get(this.nextInt(oceanBiomes.size())).biomeID;
}
}
if (kelp)
{
if(var9 == Biomes.oceanKelp.get().biomeID)
@ -128,8 +131,8 @@ public class BiomeLayerBiomes extends BiomeLayer
{
var6[var8 + var7 * par3] = surfaceBiomes[this.nextInt(surfaceBiomes.length)].biomeID;
}
}
}
return var6;
}
}
}
return var6;
}
}