Filter away already loaded worlds for getPotentialWorlds

This commit is contained in:
Ben Woo 2023-09-05 15:57:10 +08:00
parent fda0e038f5
commit 8fc2371077
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -350,7 +350,9 @@ public class WorldManager {
if (files == null) {
return Collections.emptyList();
}
return Arrays.stream(files).filter(worldNameChecker::isValidWorldFolder)
return Arrays.stream(files)
.filter(file -> !isOfflineWorld(file.getName()))
.filter(worldNameChecker::isValidWorldFolder)
.map(File::getName)
.toList();
}