net.minecraft.world

## Class WorldProvider

- java.lang.Object
- - net.minecraft.world.WorldProvider

- Direct Known Subclasses:
    WorldProviderEnd, WorldProviderHell, WorldProviderSurface

      public abstract class WorldProvider
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `dimensionId` The id for the dimension (ex.
    `String` | `field_82913_c`
    `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

    Constructors
    Constructor and Description
    `WorldProvider()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)
    `void` | `calculateInitialWeather()`
    `boolean` | `canBlockFreeze(int x, int y, int z, boolean byWater)`
    `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` | `canDoLightning(Chunk chunk)`
    `boolean` | `canDoRainSnowIce(Chunk chunk)`
    `boolean` | `canMineBlock(EntityPlayer player, int x, int y, int z)`
    `boolean` | `canRespawnHere()` True if the player can respawn in this dimension (true = overworld, false = nether).
    `boolean` | `canSnowAt(int x, int y, int z)`
    `IChunkProvider` | `createChunkGenerator()` Returns a new chunk provider which generates chunks for this world
    `boolean` | `doesXZShowFog(int par1, int par2)`
    `Vec3` | `drawClouds(float partialTicks)`
    `int` | `getActualHeight()`
    `int` | `getAverageGroundLevel()`
    `BiomeGenBase` | `getBiomeGenForCoords(int x, int z)`
    `float` | `getCloudHeight()`
    `IRenderHandler` | `getCloudRenderer()`
    `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` | `getHeight()`
    `double` | `getHorizon()`
    `int` | `getMoonPhase(long par1)`
    `double` | `getMovementFactor()` The dimensions movement factor.
    `static WorldProvider` | `getProviderForDimension(int par0)`
    `ChunkCoordinates` | `getRandomizedSpawnPoint()`
    `int` | `getRespawnDimension(EntityPlayerMP player)` Determines the dimension the player will be respawned in, typically this brings them back to the overworld.
    `String` | `getSaveFolder()` Returns the sub-folder of the world folder that this WorldProvider saves to.
    `long` | `getSeed()`
    `Vec3` | `getSkyColor(Entity cameraEntity, float partialTicks)`
    `IRenderHandler` | `getSkyRenderer()`
    `ChunkCoordinates` | `getSpawnPoint()`
    `float` | `getStarBrightness(float par1)`
    `double` | `getVoidFogYFactor()`
    `String` | `getWelcomeMessage()` A message to display to the user when they transfer to this dimension.
    `boolean` | `getWorldHasVoidParticles()`
    `long` | `getWorldTime()`
    `boolean` | `isBlockHighHumidity(int x, int y, int z)`
    `boolean` | `isDaytime()`
    `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` | `resetRainAndThunder()`
    `void` | `setAllowedSpawnTypes(boolean allowHostile, boolean allowPeaceful)`
    `void` | `setCloudRenderer(IRenderHandler renderer)`
    `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` | `setSkyRenderer(IRenderHandler skyRenderer)`
    `void` | `setSpawnPoint(int x, int y, int z)`
    `void` | `setWorldTime(long time)`
    `boolean` | `shouldMapSpin(String entity, double x, double y, double z)` Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether.
    `void` | `toggleRain()`
    `void` | `updateWeather()`

    - ### 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

    - #### field_82913_c

          public String field_82913_c

    - #### 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

    - #### createChunkGenerator

          public IChunkProvider createChunkGenerator()

      Returns a new chunk provider which generates chunks for this world

    - #### 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)

    - #### 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

    - #### getSkyRenderer

          public IRenderHandler getSkyRenderer()

    - #### setSkyRenderer

          public void setSkyRenderer(IRenderHandler skyRenderer)

    - #### getCloudRenderer

          public IRenderHandler getCloudRenderer()

    - #### setCloudRenderer

          public void setCloudRenderer(IRenderHandler renderer)

    - #### getRandomizedSpawnPoint

          public ChunkCoordinates getRandomizedSpawnPoint()

    - #### shouldMapSpin

          public boolean shouldMapSpin(String entity,
                              double x,
                              double y,
                              double z)

      Determine if the cusor on the map should 'spin' when rendered, like it does for the player in the nether.
      Parameters:
        `entity` - The entity holding the map, playername, or frame-ENTITYID
        `x` - X Position
        `y` - Y Position
        `z` - Z Postion
      Returns:
        True to 'spin' the cursor

    - #### getRespawnDimension

          public int getRespawnDimension(EntityPlayerMP player)

      Determines the dimension the player will be respawned in, typically this brings them back to the overworld.
      Parameters:
        `player` - The player that is respawning
      Returns:
        The dimension to respawn the player in

    - #### getBiomeGenForCoords

          public BiomeGenBase getBiomeGenForCoords(int x,
                                          int z)

    - #### isDaytime

          public boolean isDaytime()

    - #### getSkyColor

          public Vec3 getSkyColor(Entity cameraEntity,
                         float partialTicks)

    - #### drawClouds

          public Vec3 drawClouds(float partialTicks)

    - #### getStarBrightness

          public float getStarBrightness(float par1)

    - #### setAllowedSpawnTypes

          public void setAllowedSpawnTypes(boolean allowHostile,
                                  boolean allowPeaceful)

    - #### calculateInitialWeather

          public void calculateInitialWeather()

    - #### updateWeather

          public void updateWeather()

    - #### toggleRain

          public void toggleRain()

    - #### canBlockFreeze

          public boolean canBlockFreeze(int x,
                               int y,
                               int z,
                               boolean byWater)

    - #### canSnowAt

          public boolean canSnowAt(int x,
                          int y,
                          int z)

    - #### setWorldTime

          public void setWorldTime(long time)

    - #### getSeed

          public long getSeed()

    - #### getWorldTime

          public long getWorldTime()

    - #### getSpawnPoint

          public ChunkCoordinates getSpawnPoint()

    - #### setSpawnPoint

          public void setSpawnPoint(int x,
                           int y,
                           int z)

    - #### canMineBlock

          public boolean canMineBlock(EntityPlayer player,
                             int x,
                             int y,
                             int z)

    - #### isBlockHighHumidity

          public boolean isBlockHighHumidity(int x,
                                    int y,
                                    int z)

    - #### getHeight

          public int getHeight()

    - #### getActualHeight

          public int getActualHeight()

    - #### getHorizon

          public double getHorizon()

    - #### resetRainAndThunder

          public void resetRainAndThunder()

    - #### canDoLightning

          public boolean canDoLightning(Chunk chunk)

    - #### canDoRainSnowIce

          public boolean canDoRainSnowIce(Chunk chunk)