Klasse EngineLevels
- Siehe auch:
-
Feldübersicht
FelderModifikator und TypFeldBeschreibungstatic final net.minecraft.resources.ResourceKey<net.minecraft.world.level.dimension.DimensionType> static final org.apache.logging.log4j.Logger -
Methodenübersicht
Modifikator und TypMethodeBeschreibungvoidenqueueLevelDeletion(net.minecraft.server.level.ServerLevel level) voidenqueueLevelUnloading(net.minecraft.server.level.ServerLevel level) static EngineLevelsget(net.minecraft.server.MinecraftServer server) Gets the instance for the given server instance.getOrOpenPersistentLevel(net.minecraft.resources.Identifier key, RuntimeLevelConfig config) Gets or creates a new persistent level with the given identifier andRuntimeLevelConfig.openTemporaryLevel(RuntimeLevelConfig config) Creates a new temporary level with the givenRuntimeLevelConfigthat will not be saved and will be deleted when the server exits.openTemporaryLevel(net.minecraft.resources.Identifier key, RuntimeLevelConfig config) Creates a new temporary level with the given identifier andRuntimeLevelConfigthat will not be saved and will be deleted when the server exits.booleantickDeleteLevel(net.minecraft.server.level.ServerLevel level) booleantickUnloadLevel(net.minecraft.server.level.ServerLevel level)
-
Felddetails
-
LOGGER
public static final org.apache.logging.log4j.Logger LOGGER -
DEFAULT_DIM_TYPE
public static final net.minecraft.resources.ResourceKey<net.minecraft.world.level.dimension.DimensionType> DEFAULT_DIM_TYPE
-
-
Methodendetails
-
get
Gets the instance for the given server instance.- Parameter:
server- the server to work with- Gibt zurück:
- the instance to work with runtime dimensions
-
openTemporaryLevel
Creates a new temporary level with the givenRuntimeLevelConfigthat will not be saved and will be deleted when the server exits.The created level is returned asynchronously through a
RuntimeLevelHandle. This handle can be used to acquire theServerLevelobject throughRuntimeLevelHandle.asLevel(), as well as to delete the level throughRuntimeLevelHandle.delete().- Parameter:
config- the config with which to construct this temporary level- Gibt zurück:
- a future providing the created level
-
openTemporaryLevel
public RuntimeLevelHandle openTemporaryLevel(net.minecraft.resources.Identifier key, RuntimeLevelConfig config) Creates a new temporary level with the given identifier andRuntimeLevelConfigthat will not be saved and will be deleted when the server exits.The created level is returned asynchronously through a
RuntimeLevelHandle. This handle can be used to acquire theServerLevelobject throughRuntimeLevelHandle.asLevel(), as well as to delete the level throughRuntimeLevelHandle.delete().- Parameter:
key- the unique identifier for this dimensionconfig- the config with which to construct this temporary level- Gibt zurück:
- a future providing the created level
-
getOrOpenPersistentLevel
public RuntimeLevelHandle getOrOpenPersistentLevel(net.minecraft.resources.Identifier key, RuntimeLevelConfig config) Gets or creates a new persistent level with the given identifier andRuntimeLevelConfig. These levels will be saved to disk and can be restored after a server restart.If a level with this identifier exists already, it will be returned and no new level will be constructed.
Note! These persistent levels will not be automatically restored! This function must be called after a server restart with the relevant identifier and configuration such that it can be loaded.
The created level is returned asynchronously through a
RuntimeLevelHandle. This handle can be used to acquire theServerLevelobject throughRuntimeLevelHandle.asLevel(), as well as to delete the level throughRuntimeLevelHandle.delete().- Parameter:
key- the unique identifier for this dimensionconfig- the config with which to construct this persistent level- Gibt zurück:
- a future providing the created level
-
enqueueLevelDeletion
public void enqueueLevelDeletion(net.minecraft.server.level.ServerLevel level) -
enqueueLevelUnloading
public void enqueueLevelUnloading(net.minecraft.server.level.ServerLevel level) -
tickDeleteLevel
public boolean tickDeleteLevel(net.minecraft.server.level.ServerLevel level) -
tickUnloadLevel
public boolean tickUnloadLevel(net.minecraft.server.level.ServerLevel level)
-