Skip to content

Commit 1a462fd

Browse files
committed
Add worldDirectory to WorldManager.
This allows getting the location on a disk for a given world key. Signed-off-by: Chris Sanders <[email protected]>
1 parent 96d30c1 commit 1a462fd

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/org/spongepowered/api/world/server/WorldManager.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import org.spongepowered.api.ResourceKey;
2828
import org.spongepowered.api.Server;
2929
import org.spongepowered.api.world.server.storage.ServerWorldProperties;
30-
import org.spongepowered.api.world.storage.WorldProperties;
3130

31+
import java.nio.file.Path;
3232
import java.util.Collection;
3333
import java.util.List;
3434
import java.util.Optional;
@@ -53,6 +53,17 @@ public interface WorldManager {
5353
*/
5454
Optional<ServerWorld> world(ResourceKey key);
5555

56+
/**
57+
* Gets a {@link Path directory} that exists for the provided {@link ResourceKey world key}.
58+
*
59+
* <p>It is not required for the implementation to validate that the directory contains a proper world,
60+
* only that the directory exists.</p>
61+
*
62+
* @param key The key
63+
* @return The directory or {@link Optional#empty()} if not found
64+
*/
65+
Optional<Path> worldDirectory(ResourceKey key);
66+
5667
/**
5768
* Gets the {@link ServerWorld default world}.
5869
*

0 commit comments

Comments
 (0)