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; package biomesoplenty.api;
import java.util.ArrayList;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import com.google.common.base.Optional; import com.google.common.base.Optional;
@ -109,4 +111,9 @@ public class Biomes
public static Optional<? extends BiomeGenBase> taigaNew = Optional.absent(); public static Optional<? extends BiomeGenBase> taigaNew = Optional.absent();
public static Optional<? extends BiomeGenBase> swamplandNew = Optional.absent(); public static Optional<? extends BiomeGenBase> swamplandNew = Optional.absent();
public static Optional<? extends BiomeGenBase> jungleNew = 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; package biomesoplenty.world;
import net.minecraft.util.Vec3; import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.chunk.IChunkProvider;
import biomesoplenty.api.Biomes; 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()) if (Biomes.netherGarden.isPresent() || Biomes.netherDesert.isPresent() || Biomes.netherLava.isPresent() || Biomes.netherBone.isPresent())
{ {
worldChunkMgr = new WorldChunkManagerBOPhell(worldObj); this.worldChunkMgr = new WorldChunkManagerBOPhell(worldObj);
} }
isHellWorld = true; this.isHellWorld = true;
hasNoSky = true; this.hasNoSky = true;
dimensionId = -1; this.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";
} }
@Override @Override
public IChunkProvider createChunkGenerator() public IChunkProvider createChunkGenerator()
{ {
return new ChunkProviderBOPhell(worldObj, worldObj.getSeed()); return new ChunkProviderBOPhell(this.worldObj, this.worldObj.getSeed());
} }
} }

View file

@ -57,6 +57,10 @@ public class BiomeLayerBiomes extends BiomeLayer
{ {
netherBiomes.add(Biomes.netherBone.get()); netherBiomes.add(Biomes.netherBone.get());
} }
if (Biomes.netherBiomes.size() > 0)
{
netherBiomes.addAll(Biomes.netherBiomes);
}
//PROMISED BIOMES //PROMISED BIOMES
if (Biomes.promisedLandForest.isPresent()) if (Biomes.promisedLandForest.isPresent())
@ -73,10 +77,9 @@ public class BiomeLayerBiomes extends BiomeLayer
} }
} }
@Override
public int[] getInts(int par1, int par2, int par3, int par4) public int[] getInts(int par1, int par2, int par3, int par4)
{ {
int[] var5 = parent.getInts(par1, par2, par3, par4); int[] var5 = this.parent.getInts(par1, par2, par3, par4);
int[] var6 = IntCache.getIntCache(par3 * par4); int[] var6 = IntCache.getIntCache(par3 * par4);
boolean coral = Biomes.oceanCoral.isPresent(); boolean coral = Biomes.oceanCoral.isPresent();
@ -86,7 +89,7 @@ public class BiomeLayerBiomes extends BiomeLayer
{ {
for (int var8 = 0; var8 < par3; ++var8) for (int var8 = 0; var8 < par3; ++var8)
{ {
this.initChunkSeed(var8 + par1, var7 + par2); this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2));
int var9 = var5[var8 + var7 * par3]; int var9 = var5[var8 + var7 * par3];
if(dimension == 0) //SURFACE BIOMES if(dimension == 0) //SURFACE BIOMES
{ {