001 package net.minecraft.src;
002
003 import cpw.mods.fml.common.Side;
004 import cpw.mods.fml.common.asm.SideOnly;
005
006 public class WorldProviderEnd extends WorldProvider
007 {
008 /**
009 * creates a new world chunk manager for WorldProvider
010 */
011 public void registerWorldChunkManager()
012 {
013 this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F);
014 this.dimensionId = 1;
015 this.hasNoSky = true;
016 }
017
018 /**
019 * Returns the chunk provider back for the world provider
020 */
021 public IChunkProvider getChunkProvider()
022 {
023 return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed());
024 }
025
026 /**
027 * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
028 */
029 public float calculateCelestialAngle(long par1, float par3)
030 {
031 return 0.0F;
032 }
033
034 @SideOnly(Side.CLIENT)
035
036 /**
037 * Returns array with sunrise/sunset colors
038 */
039 public float[] calcSunriseSunsetColors(float par1, float par2)
040 {
041 return null;
042 }
043
044 @SideOnly(Side.CLIENT)
045
046 /**
047 * Return Vec3D with biome specific fog color
048 */
049 public Vec3 getFogColor(float par1, float par2)
050 {
051 int var3 = 10518688;
052 float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
053
054 if (var4 < 0.0F)
055 {
056 var4 = 0.0F;
057 }
058
059 if (var4 > 1.0F)
060 {
061 var4 = 1.0F;
062 }
063
064 float var5 = (float)(var3 >> 16 & 255) / 255.0F;
065 float var6 = (float)(var3 >> 8 & 255) / 255.0F;
066 float var7 = (float)(var3 & 255) / 255.0F;
067 var5 *= var4 * 0.0F + 0.15F;
068 var6 *= var4 * 0.0F + 0.15F;
069 var7 *= var4 * 0.0F + 0.15F;
070 return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var5, (double)var6, (double)var7);
071 }
072
073 @SideOnly(Side.CLIENT)
074 public boolean isSkyColored()
075 {
076 return false;
077 }
078
079 /**
080 * True if the player can respawn in this dimension (true = overworld, false = nether).
081 */
082 public boolean canRespawnHere()
083 {
084 return false;
085 }
086
087 /**
088 * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
089 */
090 public boolean isSurfaceWorld()
091 {
092 return false;
093 }
094
095 @SideOnly(Side.CLIENT)
096
097 /**
098 * the y level at which clouds are rendered.
099 */
100 public float getCloudHeight()
101 {
102 return 8.0F;
103 }
104
105 /**
106 * Will check if the x, z position specified is alright to be set as the map spawn point
107 */
108 public boolean canCoordinateBeSpawn(int par1, int par2)
109 {
110 int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
111 return var3 == 0 ? false : Block.blocksList[var3].blockMaterial.blocksMovement();
112 }
113
114 /**
115 * Gets the hard-coded portal location to use when entering this dimension.
116 */
117 public ChunkCoordinates getEntrancePortalLocation()
118 {
119 return new ChunkCoordinates(100, 50, 0);
120 }
121
122 public int getAverageGroundLevel()
123 {
124 return 50;
125 }
126
127 @SideOnly(Side.CLIENT)
128
129 /**
130 * Returns true if the given X,Z coordinate should show environmental fog.
131 */
132 public boolean doesXZShowFog(int par1, int par2)
133 {
134 return true;
135 }
136
137 /**
138 * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
139 */
140 public String getDimensionName()
141 {
142 return "The End";
143 }
144 }