Skip to content

Commit 6fb79af

Browse files
committed
Add worldsOfType to WorldManager.
Just a handy shortcut for plugin developers who want to get all worlds of a type quick and easy. Signed-off-by: Chris Sanders <[email protected]>
1 parent 41ba52e commit 6fb79af

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import org.spongepowered.api.ResourceKey;
2828
import org.spongepowered.api.Server;
29+
import org.spongepowered.api.world.WorldType;
2930
import org.spongepowered.api.world.server.storage.ServerWorldProperties;
3031

3132
import java.nio.file.Path;
@@ -130,6 +131,13 @@ default List<ResourceKey> offlineWorldKeys() {
130131
*/
131132
Optional<ResourceKey> worldKey(UUID uniqueId);
132133

134+
/**
135+
* Retrieves all {@link ServerWorld worlds} that are of a particular {@link WorldType type}.
136+
* @param type The type
137+
* @return The {@link Collection worlds}
138+
*/
139+
Collection<ServerWorld> worldsOfType(WorldType type);
140+
133141
/**
134142
* Loads a {@link ServerWorld world} from a {@link WorldTemplate template}.
135143
*

0 commit comments

Comments
 (0)