public class DimensionManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
DimensionManager.Dimension |
Modifier and Type | Field and Description |
---|---|
private static it.unimi.dsi.fastutil.ints.Int2ObjectMap<DimensionManager.Dimension> |
dimensions |
private static boolean |
hasInit |
private static it.unimi.dsi.fastutil.ints.IntSet |
keepLoaded |
private static int |
lastUsedId |
private static com.google.common.collect.Multiset<java.lang.Integer> |
leakedWorlds |
private static it.unimi.dsi.fastutil.ints.IntSet |
unloadQueue |
private static it.unimi.dsi.fastutil.ints.IntSet |
usedIds |
private static java.util.concurrent.ConcurrentMap<World,World> |
weakWorldMap |
private static it.unimi.dsi.fastutil.ints.Int2ObjectMap<WorldServer> |
worlds |
Constructor and Description |
---|
DimensionManager() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
canUnloadWorld(WorldServer world) |
private static boolean |
checkAvailable(int id) |
static WorldProvider |
createProviderFor(int dim) |
static java.io.File |
getCurrentSaveRootDirectory()
Return the current root directory for the world save.
|
static int[] |
getDimensions(DimensionType type)
Returns a list of dimensions associated with this DimensionType.
|
static java.lang.Integer[] |
getIDs() |
static java.lang.Integer[] |
getIDs(boolean check) |
static int |
getNextFreeDimId()
Return the next free dimension ID.
|
static WorldProvider |
getProvider(int dim) |
static DimensionType |
getProviderType(int dim) |
static java.util.Map<DimensionType,it.unimi.dsi.fastutil.ints.IntSortedSet> |
getRegisteredDimensions() |
static java.lang.Integer[] |
getStaticDimensionIDs()
Not public API: used internally to get dimensions that should load at
server startup
|
static WorldServer |
getWorld(int id) |
static WorldServer |
getWorld(int id,
boolean resetUnloadDelay) |
static WorldServer[] |
getWorlds() |
static void |
init() |
static void |
initDimension(int dim) |
static boolean |
isDimensionRegistered(int dim) |
static boolean |
isWorldQueuedToUnload(int id) |
static boolean |
keepDimensionLoaded(int dim,
boolean keep)
Sets if a dimension should stay loaded.
|
static void |
loadDimensionDataMap(NBTTagCompound compoundTag) |
static void |
registerDimension(int id,
DimensionType type) |
static NBTTagCompound |
saveDimensionDataMap() |
static void |
setWorld(int id,
WorldServer world,
MinecraftServer server) |
static void |
unloadWorld(int id)
Queues a dimension to unload, if it can be unloaded.
|
static void |
unloadWorlds(java.util.Hashtable<java.lang.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
|
private static boolean hasInit
private static int lastUsedId
private static final it.unimi.dsi.fastutil.ints.Int2ObjectMap<WorldServer> worlds
private static final it.unimi.dsi.fastutil.ints.Int2ObjectMap<DimensionManager.Dimension> dimensions
private static final it.unimi.dsi.fastutil.ints.IntSet keepLoaded
private static final it.unimi.dsi.fastutil.ints.IntSet unloadQueue
private static final it.unimi.dsi.fastutil.ints.IntSet usedIds
private static final com.google.common.collect.Multiset<java.lang.Integer> leakedWorlds
public static int[] getDimensions(DimensionType type)
public static java.util.Map<DimensionType,it.unimi.dsi.fastutil.ints.IntSortedSet> getRegisteredDimensions()
public static void init()
public static void registerDimension(int id, DimensionType type)
public static void unregisterDimension(int id)
public static boolean isDimensionRegistered(int dim)
public static DimensionType getProviderType(int dim)
public static WorldProvider getProvider(int dim)
public static java.lang.Integer[] getIDs(boolean check)
public static java.lang.Integer[] getIDs()
public static void setWorld(int id, @Nullable WorldServer world, MinecraftServer server)
public static void initDimension(int dim)
public static WorldServer getWorld(int id)
public static WorldServer getWorld(int id, boolean resetUnloadDelay)
public static WorldServer[] getWorlds()
public static java.lang.Integer[] getStaticDimensionIDs()
public static WorldProvider createProviderFor(int dim)
public static boolean keepDimensionLoaded(int dim, boolean keep)
dim
- the dimension IDkeep
- whether or not the dimension should be kept loadedprivate static boolean canUnloadWorld(WorldServer world)
public static void unloadWorld(int id)
id
- The id of the dimensionpublic static boolean isWorldQueuedToUnload(int id)
public static void unloadWorlds(java.util.Hashtable<java.lang.Integer,long[]> worldTickTimes)
public static int getNextFreeDimId()
private static boolean checkAvailable(int id)
public static NBTTagCompound saveDimensionDataMap()
public static void loadDimensionDataMap(@Nullable NBTTagCompound compoundTag)
@Nullable public static java.io.File getCurrentSaveRootDirectory()