From 67aba9081bb73aeaa822b059e8ca6defc8352a2f Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Sat, 6 Sep 2025 23:11:25 -0400 Subject: rename pacakges dev.tylerm -> cat.freya --- .../java/cat/freya/khs/command/map/set/Lobby.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/main/java/cat/freya/khs/command/map/set/Lobby.java (limited to 'src/main/java/cat/freya/khs/command/map/set/Lobby.java') diff --git a/src/main/java/cat/freya/khs/command/map/set/Lobby.java b/src/main/java/cat/freya/khs/command/map/set/Lobby.java new file mode 100644 index 0000000..847211c --- /dev/null +++ b/src/main/java/cat/freya/khs/command/map/set/Lobby.java @@ -0,0 +1,42 @@ +package cat.freya.khs.command.map.set; + +import cat.freya.khs.command.location.LocationUtils; +import cat.freya.khs.command.location.Locations; +import cat.freya.khs.command.util.ICommand; +import cat.freya.khs.configuration.Map; +import cat.freya.khs.configuration.Maps; +import cat.freya.khs.util.Location; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; + +import java.util.List; +import java.util.stream.Collectors; + +public class Lobby implements ICommand { + + public void execute(Player sender, String[] args) { + LocationUtils.setLocation(sender, Locations.LOBBY, args[0], map -> { + map.setLobby(Location.from(sender)); + }); + } + + public String getLabel() { + return "lobby"; + } + + public String getUsage() { + return ""; + } + + public String getDescription() { + return "Sets the maps lobby location"; + } + + public List autoComplete(@NotNull String parameter, @NotNull String typed) { + if(parameter.equals("map")) { + return Maps.getAllMaps().stream().map(Map::getName).collect(Collectors.toList()); + } + return null; + } + +} -- cgit v1.2.3-freya