public class DimensionManager
extends java.lang.Object
修飾子とタイプ | クラスと説明 |
---|---|
static class |
DimensionManager.SavedEntry |
コンストラクタと説明 |
---|
DimensionManager() |
修飾子とタイプ | メソッドと説明 |
---|---|
static void |
fireRegister() |
static MutableRegistry<DimensionType> |
getRegistry()
非推奨です。
|
static ServerWorld |
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 ServerWorld |
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(CompoundNBT data) |
static boolean |
rebuildPlayerMap(PlayerList players,
boolean changed) |
static DimensionType |
registerDimension(ResourceLocation name,
ModDimension type,
PacketBuffer data,
boolean hasSkyLight)
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,
boolean hasSkyLight) |
static DimensionType |
registerOrGetDimension(ResourceLocation name,
ModDimension type,
PacketBuffer data,
boolean hasSkyLight)
Register or get the existing dimension type for the given dimtype name.
|
static void |
unloadWorld(ServerWorld 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(CompoundNBT data) |
public static DimensionType registerOrGetDimension(ResourceLocation name, ModDimension type, PacketBuffer data, boolean hasSkyLight)
RegisterDimensionsEvent
is fired.
You can use this helper to get your existing dimension, or create it if it is not found.name
- Registry nametype
- ModDimension type datadata
- Extra data for the ModDimensionhasSkyLight
- does this dimension have a skylight?magnifier
- The biome generation processorpublic static DimensionType registerDimension(ResourceLocation name, ModDimension type, PacketBuffer data, boolean hasSkyLight)
name
- Registry name for this new dimension.type
- Dimension Type.data
- Configuration data for this dimension, passed intohasSkyLight
- skylight for this dimensionmagnifier
- The biome generation processorpublic 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 ServerWorld getWorld(MinecraftServer server, DimensionType dim, boolean resetUnloadDelay, boolean forceLoad)
server
- The server that controls 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, boolean hasSkyLight)
public static ServerWorld initWorld(MinecraftServer server, DimensionType dim)
public static void unloadWorld(ServerWorld world)
world
- The world to unloadpublic static void unloadWorlds(MinecraftServer server, boolean checkLeaks)
public static void writeRegistry(CompoundNBT data)
public static void readRegistry(CompoundNBT data)
public static void fireRegister()
@Deprecated public static MutableRegistry<DimensionType> getRegistry()
public static boolean rebuildPlayerMap(PlayerList players, boolean changed)