MiniGames/src/main/java/net/knarcraft/dropper/util/TabCompleteHelper.java
EpicKnarvik97 3626d997b8 Implements #2 and #4
Adds a unique identifier to arenas
Stores frequently updated arena data separately from arena settings
Stores arenas keyed by their id
Prepares for storage of which players have beaten an arena
2023-03-27 21:43:16 +02:00

33 lines
774 B
Java

package net.knarcraft.dropper.util;
import net.knarcraft.dropper.Dropper;
import net.knarcraft.dropper.arena.DropperArena;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
/**
* A helper-class for common tab-completions
*/
public final class TabCompleteHelper {
private TabCompleteHelper() {
}
/**
* Gets the names of all current arenas
*
* @return <p>All arena names</p>
*/
public static @NotNull List<String> getArenas() {
List<String> arenaNames = new ArrayList<>();
for (DropperArena dropperArena : Dropper.getInstance().getArenaHandler().getArenas().values()) {
arenaNames.add(dropperArena.getArenaName());
}
return arenaNames;
}
}