Klasse StorageSourceManager
java.lang.Object
de.luckymcdev.foundryengine.common.world.StorageSourceManager
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.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifikator und TypMethodeBeschreibungstatic voidaddAdditionalPath(Path path) Adds an additional directory to search for world data.static voidaddCandidatesFromAdditionalDirs(List<net.minecraft.world.level.storage.LevelStorageSource.LevelDirectory> out) Adds world candidates from all additional directories to the output list.static voidClears all additional world directories.static voidClears all instanced worlds and deletes the instances directory.static voiddeleteInstance(String levelId) Deletes the instanced copy of the given world.static voidensureInstanced(String levelId, Path source) Ensures an instanced copy of the world exists, copying from source if needed.Returns an unmodifiable list of additional world directories.static PathgetInstanceDir(String levelId, Path source) Returns the target directory for an instanced copy of the given world.static PathgetInstancedPath(String levelId) Returns the path to an instanced copy of the given world.static booleanisInstanced(String levelId) Checks if a world level has been instanced.static booleanisWorldExternal(Path baseDir, String levelId) Checks if a world is stored in an additional directory rather than the primary.static booleanremoveAdditionalPath(Path path) Removes an additional world directory by path.static PathresolveWorldPath(Path baseDir, String levelId) Resolves the path for a world, checking additional directories first.
-
Konstruktordetails
-
StorageSourceManager
public StorageSourceManager()
-
-
Methodendetails
-
addAdditionalPath
Adds an additional directory to search for world data. -
getAdditionalPaths
-
removeAdditionalPath
Removes an additional world directory by path. -
clearAdditionalPaths
public static void clearAdditionalPaths()Clears all additional world directories. -
resolveWorldPath
-
isWorldExternal
-
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
Checks if a world level has been instanced. -
getInstancedPath
-
deleteInstance
Deletes the instanced copy of the given world. -
clearInstanced
public static void clearInstanced()Clears all instanced worlds and deletes the instances directory. -
ensureInstanced
Ensures an instanced copy of the world exists, copying from source if needed.- Löst aus:
IOException
-
getInstanceDir
-