Klasse EngineLevels

java.lang.Object
de.luckymcdev.foundryengine.common.world.level.EngineLevels

  • 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

      public static EngineLevels get(net.minecraft.server.MinecraftServer server)
      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

      public RuntimeLevelHandle openTemporaryLevel(RuntimeLevelConfig config)
      Creates a new temporary level with the given RuntimeLevelConfig that 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 the ServerLevel object through RuntimeLevelHandle.asLevel(), as well as to delete the level through RuntimeLevelHandle.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 and RuntimeLevelConfig that 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 the ServerLevel object through RuntimeLevelHandle.asLevel(), as well as to delete the level through RuntimeLevelHandle.delete().

      Parameter:
      key - the unique identifier for this dimension
      config - 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 and RuntimeLevelConfig. 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 the ServerLevel object through RuntimeLevelHandle.asLevel(), as well as to delete the level through RuntimeLevelHandle.delete().

      Parameter:
      key - the unique identifier for this dimension
      config - 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)