net.minecraft.src
Class WorldProvider

java.lang.Object
  extended by net.minecraft.src.WorldProvider
Direct Known Subclasses:
WorldProviderEnd, WorldProviderHell, WorldProviderSurface

public abstract class WorldProvider
extends Object


Field Summary
 int dimensionId
          The id for the dimension (ex.
 boolean hasNoSky
          A boolean that tells if a world does not have a sky.
 boolean isHellWorld
          States whether the Hell world provider is used(true) or if the normal world provider is used(false)
 float[] lightBrightnessTable
          Light to brightness conversion table
 WorldType terrainType
           
 WorldChunkManager worldChunkMgr
          World chunk manager being used to generate chunks
 World worldObj
          world object being used
 
Constructor Summary
WorldProvider()
           
 
Method Summary
 float[] calcSunriseSunsetColors(float par1, float par2)
           
 float calculateCelestialAngle(long par1, float par3)
          Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)
 boolean canCoordinateBeSpawn(int par1, int par2)
          Will check if the x, z position specified is alright to be set as the map spawn point
 boolean canRespawnHere()
          True if the player can respawn in this dimension (true = overworld, false = nether).
 boolean doesXZShowFog(int par1, int par2)
           
 int getAverageGroundLevel()
           
 IChunkProvider getChunkProvider()
          Returns the chunk provider back for the world provider
 float getCloudHeight()
           
 String getDepartMessage()
          A Message to display to the user when they transfer out of this dismension.
abstract  String getDimensionName()
          Returns the dimension's name, e.g.
 ChunkCoordinates getEntrancePortalLocation()
          Gets the hard-coded portal location to use when entering this dimension.
 Vec3 getFogColor(float par1, float par2)
           
 int getMoonPhase(long par1, float par3)
           
 double getMovementFactor()
          The dimensions movement factor.
static WorldProvider getProviderForDimension(int par0)
           
 ChunkCoordinates getRandomizedSpawnPoint()
           
 String getSaveFolder()
          Returns the sub-folder of the world folder that this WorldProvider saves to.
 SkyProvider getSkyProvider()
           
 double getVoidFogYFactor()
           
 String getWelcomeMessage()
          A message to display to the user when they transfer to this dimension.
 boolean getWorldHasVoidParticles()
           
 boolean isSkyColored()
           
 boolean isSurfaceWorld()
          Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.
 void registerWorld(World par1World)
          associate an existing world with a World provider, and setup its lightbrightness table
 void setDimension(int dim)
          Sets the providers current dimension ID, used in default getSaveFolder() Added to allow default providers to be registered for multiple dimensions.
 void setSkyProvider(SkyProvider skyProvider)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

worldObj

public World worldObj
world object being used


terrainType

public WorldType terrainType

worldChunkMgr

public WorldChunkManager worldChunkMgr
World chunk manager being used to generate chunks


isHellWorld

public boolean isHellWorld
States whether the Hell world provider is used(true) or if the normal world provider is used(false)


hasNoSky

public boolean hasNoSky
A boolean that tells if a world does not have a sky. Used in calculating weather and skylight


lightBrightnessTable

public float[] lightBrightnessTable
Light to brightness conversion table


dimensionId

public int dimensionId
The id for the dimension (ex. -1: Nether, 0: Overworld, 1: The End)

Constructor Detail

WorldProvider

public WorldProvider()
Method Detail

registerWorld

public final void registerWorld(World par1World)
associate an existing world with a World provider, and setup its lightbrightness table


getChunkProvider

public IChunkProvider getChunkProvider()
Returns the chunk provider back for the world provider


canCoordinateBeSpawn

public boolean canCoordinateBeSpawn(int par1,
                                    int par2)
Will check if the x, z position specified is alright to be set as the map spawn point


calculateCelestialAngle

public float calculateCelestialAngle(long par1,
                                     float par3)
Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime)


getMoonPhase

public int getMoonPhase(long par1,
                        float par3)

isSurfaceWorld

public boolean isSurfaceWorld()
Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions.


calcSunriseSunsetColors

public float[] calcSunriseSunsetColors(float par1,
                                       float par2)

getFogColor

public Vec3 getFogColor(float par1,
                        float par2)

canRespawnHere

public boolean canRespawnHere()
True if the player can respawn in this dimension (true = overworld, false = nether).


getProviderForDimension

public static WorldProvider getProviderForDimension(int par0)

getCloudHeight

public float getCloudHeight()

isSkyColored

public boolean isSkyColored()

getEntrancePortalLocation

public ChunkCoordinates getEntrancePortalLocation()
Gets the hard-coded portal location to use when entering this dimension.


getAverageGroundLevel

public int getAverageGroundLevel()

getWorldHasVoidParticles

public boolean getWorldHasVoidParticles()

getVoidFogYFactor

public double getVoidFogYFactor()

doesXZShowFog

public boolean doesXZShowFog(int par1,
                             int par2)

getDimensionName

public abstract String getDimensionName()
Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".


setDimension

public void setDimension(int dim)
Sets the providers current dimension ID, used in default getSaveFolder() Added to allow default providers to be registered for multiple dimensions.

Parameters:
dim - Dimension ID

getSaveFolder

public String getSaveFolder()
Returns the sub-folder of the world folder that this WorldProvider saves to. EXA: DIM1, DIM-1

Returns:
The sub-folder name to save this world's chunks to.

getWelcomeMessage

public String getWelcomeMessage()
A message to display to the user when they transfer to this dimension.

Returns:
The message to be displayed

getDepartMessage

public String getDepartMessage()
A Message to display to the user when they transfer out of this dismension.

Returns:
The message to be displayed

getMovementFactor

public double getMovementFactor()
The dimensions movement factor. Relative to normal overworld. It is applied to the players position when they transfer dimensions. Exa: Nether movement is 8.0

Returns:
The movement factor

getSkyProvider

public SkyProvider getSkyProvider()

setSkyProvider

public void setSkyProvider(SkyProvider skyProvider)

getRandomizedSpawnPoint

public ChunkCoordinates getRandomizedSpawnPoint()