Klasse StorageSourceManager

java.lang.Object
de.luckymcdev.foundryengine.common.world.StorageSourceManager

public class StorageSourceManager extends Object
Manages additional world storage directories and world instancing for pack distribution.

All state lives in process-global static fields. This is only safe for a single-player / single-client process; it is not designed for multi-process or multi-instance server hosting where isolated per-instance state would be required.

  • Konstruktordetails

    • StorageSourceManager

      public StorageSourceManager()
  • Methodendetails

    • addAdditionalPath

      public static void addAdditionalPath(Path path)
      Adds an additional directory to search for world data.
    • getAdditionalPaths

      public static List<Path> getAdditionalPaths()
      Returns an unmodifiable list of additional world directories.
    • removeAdditionalPath

      public static boolean removeAdditionalPath(Path path)
      Removes an additional world directory by path.
    • clearAdditionalPaths

      public static void clearAdditionalPaths()
      Clears all additional world directories.
    • resolveWorldPath

      public static Path resolveWorldPath(Path baseDir, String levelId)
      Resolves the path for a world, checking additional directories first.
    • isWorldExternal

      public static boolean isWorldExternal(Path baseDir, String levelId)
      Checks if a world is stored in an additional directory rather than the primary.
    • addCandidatesFromAdditionalDirs

      public static void addCandidatesFromAdditionalDirs(List<net.minecraft.world.level.storage.LevelStorageSource.LevelDirectory> out) throws net.minecraft.world.level.storage.LevelStorageException
      Adds world candidates from all additional directories to the output list.
      Löst aus:
      net.minecraft.world.level.storage.LevelStorageException
    • isInstanced

      public static boolean isInstanced(String levelId)
      Checks if a world level has been instanced.
    • getInstancedPath

      public static Path getInstancedPath(String levelId)
      Returns the path to an instanced copy of the given world.
    • deleteInstance

      public static void deleteInstance(String levelId)
      Deletes the instanced copy of the given world.
    • clearInstanced

      public static void clearInstanced()
      Clears all instanced worlds and deletes the instances directory.
    • ensureInstanced

      public static void ensureInstanced(String levelId, Path source) throws IOException
      Ensures an instanced copy of the world exists, copying from source if needed.
      Löst aus:
      IOException
    • getInstanceDir

      public static Path getInstanceDir(String levelId, Path source)
      Returns the target directory for an instanced copy of the given world.