summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-11-02 07:18:00 -0400
committertylermurphy534 <tylermurphy534@gmail.com>2022-11-02 07:18:00 -0400
commitbb254145ed0bb56d0482f6ba34e05cb728a7c8cc (patch)
tree9e2c645f417a1a1d77855e068b213fe4369fd056 /src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt
parent1.7.0 beta 1 (diff)
downloadkenshinshideandseek-bb254145ed0bb56d0482f6ba34e05cb728a7c8cc.tar.gz
kenshinshideandseek-bb254145ed0bb56d0482f6ba34e05cb728a7c8cc.tar.bz2
kenshinshideandseek-bb254145ed0bb56d0482f6ba34e05cb728a7c8cc.zip
1.7.0 beta 2
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java
new file mode 100644
index 0000000..9d47390
--- /dev/null
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java
@@ -0,0 +1,43 @@
+package net.tylermurphy.hideAndSeek.command.map.blockhunt;
+
+import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
+import net.tylermurphy.hideAndSeek.command.location.Locations;
+import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.configuration.Maps;
+import org.bukkit.entity.Player;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Enabled extends Command {
+
+ public void execute(Player sender, String[] args) {
+ LocationUtils.setLocation(sender, Locations.LOBBY, args[0], map -> {
+ map.setLobby(sender.getLocation());
+ });
+ }
+
+ public String getLabel() {
+ return "enabled";
+ }
+
+ public String getUsage() {
+ return "<map> <bool>";
+ }
+
+ public String getDescription() {
+ return "Sets hide and seeks lobby location to current position";
+ }
+
+ public List<String> autoComplete(String parameter) {
+ if(parameter != null && parameter.equals("map")) {
+ return Maps.getAllMaps().stream().map(net.tylermurphy.hideAndSeek.configuration.Map::getName).collect(Collectors.toList());
+ }
+ if(parameter != null && parameter.equals("bool")) {
+ return Arrays.asList("true", "false");
+ }
+ return null;
+ }
+
+}