public class DimensionManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DimensionManager.SavedEntry |
Constructor and Description |
---|
DimensionManager() |
Modifier and Type | Method and Description |
---|---|
static IRegistry<DimensionType> |
getRegistry()
Deprecated.
|
static WorldServer |
getWorld(MinecraftServer server,
DimensionType dim,
boolean resetUnloadDelay,
boolean forceLoad)
Retrieves the world from the server allowing for null return, and optionally resetting it's unload timer.
|
static WorldServer |
initWorld(MinecraftServer server,
DimensionType dim) |
static boolean |
keepLoaded(DimensionType dim)
Determines if the dimension will stay loaded in memory even if all chunks are unloaded.
|
static boolean |
keepLoaded(DimensionType dim,
boolean value)
Configures if the dimension will stay loaded in memory even if all chunks are unloaded.
|
static void |
readRegistry(NBTTagCompound data) |
static DimensionType |
registerDimension(ResourceLocation name,
ModDimension type,
PacketBuffer data)
Registers a real unique dimension, Should be called on server init, or when the dimension is created.
|
static DimensionType |
registerDimensionInternal(int id,
ResourceLocation name,
ModDimension type,
PacketBuffer data) |
static void |
unloadWorld(WorldServer world)
Queues a dimension to unload, if it can be unloaded.
|
static void |
unloadWorlds(MinecraftServer server,
boolean checkLeaks) |
static void |
unregisterDimension(int id) |
static void |
writeRegistry(NBTTagCompound data) |
public static DimensionType registerDimension(ResourceLocation name, ModDimension type, PacketBuffer data)
name
- Registry name for this new dimension.type
- Dimension Type.data
- Configuration data for this dimension, passed intopublic static boolean keepLoaded(DimensionType dim, boolean value)
dim
- The dimensionvalue
- True to keep loaded, false to allow unloadingpublic static boolean keepLoaded(DimensionType dim)
dim
- The dimension@Nullable public static WorldServer getWorld(MinecraftServer server, DimensionType dim, boolean resetUnloadDelay, boolean forceLoad)
server
- The server that controlls this world.dim
- Dimension to load.resetUnloadDelay
- True to reset the unload timer, which is a delay that is used to prevent constant world loading/unloading cycle.forceLoad
- True to attempt to load the dimension if the server has it unloaded.public static void unregisterDimension(int id)
public static DimensionType registerDimensionInternal(int id, ResourceLocation name, ModDimension type, PacketBuffer data)
public static WorldServer initWorld(MinecraftServer server, DimensionType dim)
public static void unloadWorld(WorldServer world)
id
- The id of the dimensionpublic static void unloadWorlds(MinecraftServer server, boolean checkLeaks)
public static void writeRegistry(NBTTagCompound data)
public static void readRegistry(NBTTagCompound data)
@Deprecated public static IRegistry<DimensionType> getRegistry()