Tab complete /p list

This commit is contained in:
Alexander Söderberg
2020-05-24 21:08:11 +02:00
parent 2436a6a402
commit 46b68e489d
3 changed files with 70 additions and 0 deletions

View File

@ -36,6 +36,9 @@ import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
/**
* Default Bukkit world manager. It will handle world creation by
@ -76,4 +79,13 @@ public class BukkitWorldManager implements PlatformWorldManager<World> {
return "bukkit";
}
@Override public Collection<String> getWorlds() {
final List<World> worlds = Bukkit.getWorlds();
final List<String> worldNames = new ArrayList<>();
for (final World world : worlds) {
worldNames.add(world.getName());
}
return worldNames;
}
}