mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-08-27 04:37:47 +00:00
ddd
This commit is contained in:
+22
-2
@@ -826,8 +826,13 @@ public class CommandIris implements DirectorExecutor {
|
||||
public KList<String> getPossibilities() {
|
||||
Set<String> options = new LinkedHashSet<>();
|
||||
for (World world : Bukkit.getWorlds()) {
|
||||
if (IrisToolbelt.isIrisWorld(world)) {
|
||||
options.add(IrisWorldStorage.logicalName(world));
|
||||
if (!IrisToolbelt.isIrisWorld(world)) {
|
||||
continue;
|
||||
}
|
||||
options.add(IrisWorldStorage.logicalName(world));
|
||||
String startupName = configuredStartupName(world);
|
||||
if (startupName != null) {
|
||||
options.add(startupName);
|
||||
}
|
||||
}
|
||||
for (String identity : IrisWorlds.get().getWorlds().keySet()) {
|
||||
@@ -850,6 +855,21 @@ public class CommandIris implements DirectorExecutor {
|
||||
return new KList<>(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* "iris worlds" prints the Bukkit startup name, so it has to be offered and accepted here too.
|
||||
*/
|
||||
private static String configuredStartupName(World world) {
|
||||
try {
|
||||
String configured = IrisWorldStorage.configuredWorldName(
|
||||
WorldIdentity.key(world),
|
||||
IrisWorldStorage.levelRoot().getName()
|
||||
);
|
||||
return configured.equals(world.getName()) ? configured : null;
|
||||
} catch (RuntimeException failure) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(String value) {
|
||||
return value == null ? "" : value;
|
||||
|
||||
Reference in New Issue
Block a user