summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/About.java54
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java21
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Send.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/SetMap.java)6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/SetExitLocation.java)6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Start.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Top.java2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/location/LocationUtils.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/util/LocationUtils.java)2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/util/Locations.java)2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/AddMap.java)2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java)2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java63
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/ListMaps.java)5
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/RemoveMap.java)2
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/SaveMap.java)5
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/Setup.java)6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java43
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBorder.java)6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBounds.java)4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/SetLobbyLocation.java)8
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSeekerLobbyLocation.java)8
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java (renamed from src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java)8
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java13
23 files changed, 167 insertions, 107 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java b/src/main/java/net/tylermurphy/hideAndSeek/command/About.java
deleted file mode 100644
index 119888b..0000000
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/About.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * This file is part of Kenshins Hide and Seek
- *
- * Copyright (c) 2021 Tyler Murphy.
- *
- * Kenshins Hide and Seek free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * he Free Software Foundation version 3.
- *
- * Kenshins Hide and Seek is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package net.tylermurphy.hideAndSeek.command;
-
-import net.tylermurphy.hideAndSeek.command.util.Command;
-import org.bukkit.ChatColor;
-import org.bukkit.entity.Player;
-
-import java.util.List;
-
-public class About extends Command {
-
- public void execute(Player sender, String[] args) {
- sender.sendMessage(
- String.format("%s%sHide and Seek %s(%s1.7.0 ALPHA%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) +
- String.format("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) +
- String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE)
- );
- }
-
- public String getLabel() {
- return "about";
- }
-
- public String getUsage() {
- return "";
- }
-
- public String getDescription() {
- return "Get information about the plugin";
- }
-
- public List<String> autoComplete(String parameter) {
- return null;
- }
-
-}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
index 51bc509..9f8392f 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Reload.java
@@ -21,10 +21,7 @@ package net.tylermurphy.hideAndSeek.command;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.Command;
-import net.tylermurphy.hideAndSeek.configuration.Config;
-import net.tylermurphy.hideAndSeek.configuration.Items;
-import net.tylermurphy.hideAndSeek.configuration.Localization;
-import net.tylermurphy.hideAndSeek.configuration.Maps;
+import net.tylermurphy.hideAndSeek.configuration.*;
import net.tylermurphy.hideAndSeek.game.util.Status;
import org.bukkit.entity.Player;
@@ -42,10 +39,18 @@ public class Reload extends Command {
sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
return;
}
- Config.loadConfig();
- Maps.loadMaps();
- Localization.loadLocalization();
- Items.loadItems();
+
+ try {
+ Config.loadConfig();
+ Maps.loadMaps();
+ Localization.loadLocalization();
+ Items.loadItems();
+ Leaderboard.loadLeaderboard();
+ } catch (Exception e) {
+ sender.sendMessage(errorPrefix + message("CONFIG_ERROR"));
+ return;
+ }
+
sender.sendMessage(messagePrefix + message("CONFIG_RELOAD"));
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Send.java
index 2df5824..9978c3c 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Send.java
@@ -1,4 +1,4 @@
-package net.tylermurphy.hideAndSeek.command.map;
+package net.tylermurphy.hideAndSeek.command;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.Command;
@@ -13,7 +13,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SetMap extends Command {
+public class Send extends Command {
public void execute(Player sender, String[] args) {
@@ -46,7 +46,7 @@ public class SetMap extends Command {
}
public String getLabel() {
- return "goto";
+ return "send";
}
public String getUsage() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetExitLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java
index 01e1512..874909b 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetExitLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetExitLocation.java
@@ -17,11 +17,11 @@
*
*/
-package net.tylermurphy.hideAndSeek.command.location;
+package net.tylermurphy.hideAndSeek.command;
import net.tylermurphy.hideAndSeek.command.util.Command;
-import net.tylermurphy.hideAndSeek.command.location.util.LocationUtils;
-import net.tylermurphy.hideAndSeek.command.location.util.Locations;
+import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
+import net.tylermurphy.hideAndSeek.command.location.Locations;
import org.bukkit.entity.Player;
import java.util.List;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
index 54ad4af..674edd6 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Start.java
@@ -57,7 +57,7 @@ public class Start extends Command {
if (args.length < 1) {
Optional<Player> rand = Main.getInstance().getBoard().getPlayers().stream().skip(new Random().nextInt(Main.getInstance().getBoard().size())).findFirst();
if (!rand.isPresent()) {
- Main.getInstance().getLogger().warning("Failed to select random seeker.");
+ sender.sendMessage(errorPrefix + message("START_FAILED_SEEKER"));
return;
}
seekerName = rand.get().getName();
@@ -82,7 +82,7 @@ public class Start extends Command {
}
public String getUsage() {
- return "<player>";
+ return "<*player>";
}
public String getDescription() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
index 1582be9..7c8cabf 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Stop.java
@@ -34,7 +34,7 @@ public class Stop extends Command {
public void execute(Player sender, String[] args) {
if (Main.getInstance().getGame().checkCurrentMap()) {
- sender.sendMessage(errorPrefix + "Game is not setup. Run /hs setup to see what you needed to do");
+ sender.sendMessage(errorPrefix + message("GAME_SETUP"));
return;
}
if (Main.getInstance().getGame().getStatus() == Status.STARTING || Main.getInstance().getGame().getStatus() == Status.PLAYING) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java
index 8116eaf..0a5358d 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Top.java
@@ -76,7 +76,7 @@ public class Top extends Command {
}
public String getUsage() {
- return "<page>";
+ return "<*page>";
}
public String getDescription() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/util/LocationUtils.java b/src/main/java/net/tylermurphy/hideAndSeek/command/location/LocationUtils.java
index 69d7c26..5e4afb5 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/util/LocationUtils.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/location/LocationUtils.java
@@ -1,4 +1,4 @@
-package net.tylermurphy.hideAndSeek.command.location.util;
+package net.tylermurphy.hideAndSeek.command.location;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.configuration.Map;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/util/Locations.java b/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java
index 35f74ea..dd73dac 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/util/Locations.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/location/Locations.java
@@ -1,4 +1,4 @@
-package net.tylermurphy.hideAndSeek.command.location.util;
+package net.tylermurphy.hideAndSeek.command.location;
/**
* @author bobby29831
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/AddMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java
index 55b4267..03c2a95 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/AddMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java
@@ -14,7 +14,7 @@ import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix;
import static net.tylermurphy.hideAndSeek.configuration.Config.messagePrefix;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class AddMap extends Command {
+public class Add extends Command {
public void execute(Player sender, String[] args) {
if (Main.getInstance().getGame().getStatus() != Status.STANDBY) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java
index 2eb0eb9..2ec0525 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Debug.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java
@@ -1,4 +1,4 @@
-package net.tylermurphy.hideAndSeek.command;
+package net.tylermurphy.hideAndSeek.command.map;
import com.cryptomorin.xseries.XMaterial;
import net.tylermurphy.hideAndSeek.Main;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java
new file mode 100644
index 0000000..8e74922
--- /dev/null
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java
@@ -0,0 +1,63 @@
+package net.tylermurphy.hideAndSeek.command.map;
+
+import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.configuration.Map;
+import net.tylermurphy.hideAndSeek.configuration.Maps;
+import org.bukkit.entity.Player;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix;
+import static net.tylermurphy.hideAndSeek.configuration.Config.exitPosition;
+import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
+
+public class GoTo extends Command {
+
+ public void execute(Player sender, String[] args) {
+ Map map = Maps.getMap(args[0]);
+ if(map == null) {
+ sender.sendMessage(errorPrefix + message("INVALID_MAP"));
+ return;
+ }
+ if (map.isNotSetup()) {
+ sender.sendMessage(errorPrefix + message("MAP_NOT_SETUP").addAmount(map.getName()));
+ return;
+ }
+ switch (args[1].toLowerCase()) {
+ case "spawn":
+ sender.teleport(map.getSpawn()); break;
+ case "lobby":
+ sender.teleport(map.getLobby()); break;
+ case "seekerlobby":
+ sender.teleport(map.getSeekerLobby()); break;
+ case "exit":
+ sender.teleport(exitPosition); break;
+ default:
+ sender.sendMessage(errorPrefix + message("COMMAND_INVALID_ARG").addAmount(args[1].toLowerCase()));
+ }
+ }
+
+ public String getLabel() {
+ return "goto";
+ }
+
+ public String getUsage() {
+ return "<map> <spawn>";
+ }
+
+ public String getDescription() {
+ return "Get the commands for the plugin";
+ }
+
+ 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());
+ } else if(parameter != null && parameter.equals("spawn")) {
+ return Arrays.asList("spawn","lobby","seekerlobby","exit");
+ }
+ return null;
+ }
+
+}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/ListMaps.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java
index 79490a7..635c011 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/ListMaps.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java
@@ -7,13 +7,12 @@ import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.util.Collection;
-import java.util.List;
import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix;
import static net.tylermurphy.hideAndSeek.configuration.Config.messagePrefix;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class ListMaps extends Command {
+public class List extends Command {
public void execute(Player sender, String[] args) {
Collection<Map> maps = Maps.getAllMaps();
@@ -40,7 +39,7 @@ public class ListMaps extends Command {
return "List all maps in the plugin";
}
- public List<String> autoComplete(String parameter) {
+ public java.util.List<String> autoComplete(String parameter) {
return null;
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/RemoveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java
index 216cca9..45dec99 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/RemoveMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java
@@ -14,7 +14,7 @@ import static net.tylermurphy.hideAndSeek.configuration.Config.errorPrefix;
import static net.tylermurphy.hideAndSeek.configuration.Config.messagePrefix;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class RemoveMap extends Command {
+public class Remove extends Command {
public void execute(Player sender, String[] args) {
if (Main.getInstance().getGame().getStatus() != Status.STANDBY) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SaveMap.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java
index f3eb4d7..b93250f 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SaveMap.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java
@@ -34,7 +34,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SaveMap extends Command {
+public class Save extends Command {
public static boolean runningBackup = false;
@@ -60,7 +60,8 @@ public class SaveMap extends Command {
sender.sendMessage(warningPrefix + message("MAPSAVE_WARNING"));
World world = map.getSpawn().getWorld();
if (world == null) {
- throw new RuntimeException("Unable to get spawn world");
+ sender.sendMessage(warningPrefix + message("MAPSAVE_FAIL_WORLD"));
+ return;
}
world.save();
BukkitRunnable runnable = new BukkitRunnable() {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Setup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java
index 46b41f7..29442c1 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Setup.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java
@@ -19,20 +19,18 @@
package net.tylermurphy.hideAndSeek.command.map;
-import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.Command;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.entity.Player;
-import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class Setup extends Command {
+public class Status extends Command {
public void execute(Player sender, String[] args) {
@@ -76,7 +74,7 @@ public class Setup extends Command {
}
public String getLabel() {
- return "setup";
+ return "status";
}
public String getUsage() {
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;
+ }
+
+}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBorder.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java
index 8362e02..92339b4 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBorder.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java
@@ -17,7 +17,7 @@
*
*/
-package net.tylermurphy.hideAndSeek.command.map;
+package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.Command;
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SetBorder extends Command {
+public class Border extends Command {
public void execute(Player sender, String[] args) {
if (Main.getInstance().getGame().getStatus() != Status.STANDBY) {
@@ -86,7 +86,7 @@ public class SetBorder extends Command {
change
);
Maps.setMap(map.getName(), map);
- sender.sendMessage(messagePrefix + message("WORLDBORDER_ENABLE").addAmount(num).addAmount(delay));
+ sender.sendMessage(messagePrefix + message("WORLDBORDER_ENABLE").addAmount(num).addAmount(delay).addAmount(change));
map.getWorldBorder().resetWorldBorder();
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBounds.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java
index 92bf5a4..9896389 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/SetBounds.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java
@@ -17,7 +17,7 @@
*
*/
-package net.tylermurphy.hideAndSeek.command.map;
+package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.Main;
import net.tylermurphy.hideAndSeek.command.util.Command;
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SetBounds extends Command {
+public class Bounds extends Command {
public void execute(Player sender, String[] args) {
if (Main.getInstance().getGame().getStatus() != Status.STANDBY) {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetLobbyLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java
index da41d91..c691787 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetLobbyLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java
@@ -17,18 +17,18 @@
*
*/
-package net.tylermurphy.hideAndSeek.command.location;
+package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.command.util.Command;
-import net.tylermurphy.hideAndSeek.command.location.util.LocationUtils;
-import net.tylermurphy.hideAndSeek.command.location.util.Locations;
+import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
+import net.tylermurphy.hideAndSeek.command.location.Locations;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.entity.Player;
import java.util.List;
import java.util.stream.Collectors;
-public class SetLobbyLocation extends Command {
+public class Lobby extends Command {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.LOBBY, args[0], map -> {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSeekerLobbyLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java
index 8a5ebd1..2521f19 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSeekerLobbyLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java
@@ -1,8 +1,8 @@
-package net.tylermurphy.hideAndSeek.command.location;
+package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.command.util.Command;
-import net.tylermurphy.hideAndSeek.command.location.util.LocationUtils;
-import net.tylermurphy.hideAndSeek.command.location.util.Locations;
+import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
+import net.tylermurphy.hideAndSeek.command.location.Locations;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.entity.Player;
@@ -11,7 +11,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SetSeekerLobbyLocation extends Command {
+public class SeekerLobby extends Command {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.SEEKER, args[0], map -> {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java
index 82f71d1..3e8f77e 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/location/SetSpawnLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java
@@ -17,11 +17,11 @@
*
*/
-package net.tylermurphy.hideAndSeek.command.location;
+package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.command.util.Command;
-import net.tylermurphy.hideAndSeek.command.location.util.LocationUtils;
-import net.tylermurphy.hideAndSeek.command.location.util.Locations;
+import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
+import net.tylermurphy.hideAndSeek.command.location.Locations;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@@ -33,7 +33,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SetSpawnLocation extends Command {
+public class Spawn extends Command {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.GAME, args[0], map -> {
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java b/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
index 9079ccc..e7f43eb 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/util/CommandGroup.java
@@ -20,7 +20,8 @@
package net.tylermurphy.hideAndSeek.command.util;
import net.tylermurphy.hideAndSeek.command.*;
-import net.tylermurphy.hideAndSeek.command.map.SaveMap;
+import net.tylermurphy.hideAndSeek.command.map.Save;
+import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -38,7 +39,7 @@ public class CommandGroup {
public CommandGroup(String label, Object... data) {
this.label = label;
- this.commandRegister = new HashMap<>();
+ this.commandRegister = new LinkedHashMap<>();
for(Object o : data) registerCommand(o);
}
@@ -65,11 +66,15 @@ public class CommandGroup {
if (permissionsRequired && !player.hasPermission("hs.about")) {
player.sendMessage(errorPrefix + message("COMMAND_NOT_ALLOWED"));
} else {
- new About().execute(player, null);
+ player.sendMessage(
+ String.format("%s%sHide and Seek %s(%s1.7.0 ALPHA%s)\n", ChatColor.AQUA, ChatColor.BOLD, ChatColor.GRAY,ChatColor.WHITE,ChatColor.GRAY) +
+ String.format("%sAuthor: %s[KenshinEto]\n", ChatColor.GRAY, ChatColor.WHITE) +
+ String.format("%sHelp Command: %s/hs %shelp", ChatColor.GRAY, ChatColor.AQUA, ChatColor.WHITE)
+ );
}
} else {
String invoke = args[0].toLowerCase();
- if (!invoke.equals("about") && !invoke.equals("help") && SaveMap.runningBackup) {
+ if (!invoke.equals("about") && !invoke.equals("help") && Save.runningBackup) {
player.sendMessage(errorPrefix + message("MAPSAVE_INPROGRESS"));
} else if (permissionsRequired && !player.hasPermission(permission+"."+invoke)) {
player.sendMessage(errorPrefix + message("COMMAND_NOT_ALLOWED"));