001 package net.minecraft.world;
002
003 import cpw.mods.fml.relauncher.Side;
004 import cpw.mods.fml.relauncher.SideOnly;
005 import net.minecraft.util.Vec3;
006 import net.minecraft.world.biome.BiomeGenBase;
007 import net.minecraft.world.biome.WorldChunkManagerHell;
008 import net.minecraft.world.chunk.IChunkProvider;
009 import net.minecraft.world.gen.ChunkProviderHell;
010
011 public class WorldProviderHell extends WorldProvider
012 {
013 /**
014 * creates a new world chunk manager for WorldProvider
015 */
016 public void registerWorldChunkManager()
017 {
018 this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F);
019 this.isHellWorld = true;
020 this.hasNoSky = true;
021 this.dimensionId = -1;
022 }
023
024 @SideOnly(Side.CLIENT)
025
026 /**
027 * Return Vec3D with biome specific fog color
028 */
029 public Vec3 getFogColor(float par1, float par2)
030 {
031 return this.worldObj.getWorldVec3Pool().getVecFromPool(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D);
032 }
033
034 /**
035 * Creates the light to brightness table
036 */
037 protected void generateLightBrightnessTable()
038 {
039 float var1 = 0.1F;
040
041 for (int var2 = 0; var2 <= 15; ++var2)
042 {
043 float var3 = 1.0F - (float)var2 / 15.0F;
044 this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1;
045 }
046 }
047
048 /**
049 * Returns a new chunk provider which generates chunks for this world
050 */
051 public IChunkProvider createChunkGenerator()
052 {
053 return new ChunkProviderHell(this.worldObj, this.worldObj.getSeed());
054 }
055
056 /**
057 * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
058 */
059 public boolean isSurfaceWorld()
060 {
061 return false;
062 }
063
064 /**
065 * Will check if the x, z position specified is alright to be set as the map spawn point
066 */
067 public boolean canCoordinateBeSpawn(int par1, int par2)
068 {
069 return false;
070 }
071
072 /**
073 * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
074 */
075 public float calculateCelestialAngle(long par1, float par3)
076 {
077 return 0.5F;
078 }
079
080 /**
081 * True if the player can respawn in this dimension (true = overworld, false = nether).
082 */
083 public boolean canRespawnHere()
084 {
085 return false;
086 }
087
088 @SideOnly(Side.CLIENT)
089
090 /**
091 * Returns true if the given X,Z coordinate should show environmental fog.
092 */
093 public boolean doesXZShowFog(int par1, int par2)
094 {
095 return true;
096 }
097
098 /**
099 * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
100 */
101 public String getDimensionName()
102 {
103 return "Nether";
104 }
105 }