net.minecraftforge.common

## Class DimensionManager

- java.lang.Object
- - net.minecraftforge.common.DimensionManager

-     public class DimensionManager
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DimensionManager()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static WorldProvider` | `createProviderFor(int dim)`
    `static File` | `getCurrentSaveRootDirectory()` Return the current root directory for the world save.
    `static Integer[]` | `getIDs()`
    `static Integer[]` | `getIDs(boolean check)`
    `static int` | `getNextFreeDimId()` Return the next free dimension ID.
    `static WorldProvider` | `getProvider(int dim)`
    `static int` | `getProviderType(int dim)`
    `static Integer[]` | `getStaticDimensionIDs()` Not public API: used internally to get dimensions that should load at server startup
    `static WorldServer` | `getWorld(int id)`
    `static WorldServer[]` | `getWorlds()`
    `static void` | `init()`
    `static void` | `initDimension(int dim)`
    `static boolean` | `isDimensionRegistered(int dim)`
    `static void` | `loadDimensionDataMap(NBTTagCompound compoundTag)`
    `static void` | `registerDimension(int id, int providerType)`
    `static boolean` | `registerProviderType(int id, Class<? extends WorldProvider> provider, boolean keepLoaded)`
    `static NBTTagCompound` | `saveDimensionDataMap()`
    `static void` | `setWorld(int id, WorldServer world)`
    `static boolean` | `shouldLoadSpawn(int dim)`
    `static void` | `unloadWorld(int id)`
    `static void` | `unloadWorlds(Hashtable<Integer,long[]> worldTickTimes)`
    `static void` | `unregisterDimension(int id)` For unregistering a dimension when the save is changed (disconnected from a server or loaded a new save
    `static int[]` | `unregisterProviderType(int id)` Unregisters a Provider type, and returns a array of all dimensions that are registered to this provider type.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DimensionManager

          public DimensionManager()

  - ### Method Detail

    - #### registerProviderType

          public static boolean registerProviderType(int id,
                                     Class<? extends WorldProvider> provider,
                                     boolean keepLoaded)

    - #### unregisterProviderType

          public static int[] unregisterProviderType(int id)

      Unregisters a Provider type, and returns a array of all dimensions that are registered to this provider type. If the return size is greater then 0, it is required that the caller either change those dimensions's registered type, or replace this type before the world is attempted to load, else the loader will throw an exception.
      Parameters:
        `id` - The provider type ID to unreigster
      Returns:
        An array containing all dimension IDs still registered to this provider type.

    - #### init

          public static void init()

    - #### registerDimension

          public static void registerDimension(int id,
                               int providerType)

    - #### unregisterDimension

          public static void unregisterDimension(int id)

      For unregistering a dimension when the save is changed (disconnected from a server or loaded a new save

    - #### isDimensionRegistered

          public static boolean isDimensionRegistered(int dim)

    - #### getProviderType

          public static int getProviderType(int dim)

    - #### getProvider

          public static WorldProvider getProvider(int dim)

    - #### getIDs

          public static Integer[] getIDs(boolean check)

    - #### getIDs

          public static Integer[] getIDs()

    - #### setWorld

          public static void setWorld(int id,
                      WorldServer world)

    - #### initDimension

          public static void initDimension(int dim)

    - #### getWorld

          public static WorldServer getWorld(int id)

    - #### getWorlds

          public static WorldServer[] getWorlds()

    - #### shouldLoadSpawn

          public static boolean shouldLoadSpawn(int dim)

    - #### getStaticDimensionIDs

          public static Integer[] getStaticDimensionIDs()

      Not public API: used internally to get dimensions that should load at server startup

    - #### createProviderFor

          public static WorldProvider createProviderFor(int dim)

    - #### unloadWorld

          public static void unloadWorld(int id)

    - #### unloadWorlds

          public static void unloadWorlds(Hashtable<Integer,long[]> worldTickTimes)

    - #### getNextFreeDimId

          public static int getNextFreeDimId()

      Return the next free dimension ID. Note: you are not guaranteed a contiguous block of free ids. Always call for each individual ID you wish to get.
      Returns:
        the next free dimension ID

    - #### saveDimensionDataMap

          public static NBTTagCompound saveDimensionDataMap()

    - #### loadDimensionDataMap

          public static void loadDimensionDataMap(NBTTagCompound compoundTag)

    - #### getCurrentSaveRootDirectory

          public static File getCurrentSaveRootDirectory()

      Return the current root directory for the world save. Accesses getSaveHandler from the overworld
      Returns:
        the root directory of the save