summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/map
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-11-20 23:39:55 -0500
committerTyler Murphy <tylermurphy534@gmail.com>2022-11-20 23:39:55 -0500
commit5615fa7f325bb45762d13a704a9ffddda3efbfbb (patch)
treed75d721bc4f0098d7fe661197bd40a6be41654bb /src/main/java/net/tylermurphy/hideAndSeek/command/map
parent1.7.0 beta 4 (diff)
downloadkenshinshideandseek-5615fa7f325bb45762d13a704a9ffddda3efbfbb.tar.gz
kenshinshideandseek-5615fa7f325bb45762d13a704a9ffddda3efbfbb.tar.bz2
kenshinshideandseek-5615fa7f325bb45762d13a704a9ffddda3efbfbb.zip
1.7.0 beta 5
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/map')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java15
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java6
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java14
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Add.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/List.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Remove.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java4
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java7
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java7
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java12
16 files changed, 52 insertions, 51 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java
index 89a5b79..72f0740 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Add.java
@@ -1,7 +1,7 @@
package net.tylermurphy.hideAndSeek.command.map;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -15,7 +15,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 Add extends Command {
+public class Add implements ICommand {
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/Debug.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java
index c5d0352..209d0d6 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Debug.java
@@ -2,7 +2,7 @@ package net.tylermurphy.hideAndSeek.command.map;
import com.cryptomorin.xseries.XMaterial;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.PlayerLoader;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -23,7 +23,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class Debug extends Command {
+public class Debug implements ICommand {
private static final Map<Player, Map<Integer, Consumer<Player>>> debugMenuFunctions = new HashMap<>();
@@ -68,7 +68,7 @@ public class Debug extends Command {
debugMenu.setItem(3, createOption(functions, 3, XMaterial.BARRIER.parseMaterial(), "&cUnload from Game", 1, player -> {
Main.getInstance().getBoard().remove(player);
PlayerLoader.unloadPlayer(player);
- player.teleport(exitPosition);
+ exitPosition.teleport(player);
}));
debugMenu.setItem(4, createOption(functions, 4, XMaterial.BARRIER.parseMaterial(), "&cDie In Game", 2, player -> {
if((Main.getInstance().getBoard().isSeeker(player) || Main.getInstance().getBoard().isHider(player)) && Main.getInstance().getGame().getStatus() == Status.PLAYING){
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java
index 34ca8f9..7d27642 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/GoTo.java
@@ -1,6 +1,6 @@
package net.tylermurphy.hideAndSeek.command.map;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.entity.Player;
@@ -10,11 +10,10 @@ 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.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class GoTo extends Command {
+public class GoTo implements ICommand {
public void execute(Player sender, String[] args) {
Map map = Maps.getMap(args[0]);
@@ -28,13 +27,13 @@ public class GoTo extends Command {
}
switch (args[1].toLowerCase()) {
case "spawn":
- sender.teleport(map.getSpawn()); break;
+ map.getSpawn().teleport(sender); break;
case "lobby":
- sender.teleport(map.getLobby()); break;
+ map.getLobby().teleport(sender); break;
case "seekerlobby":
- sender.teleport(map.getSeekerLobby()); break;
+ map.getSeekerLobby().teleport(sender); break;
case "exit":
- sender.teleport(exitPosition); break;
+ exitPosition.teleport(sender); break;
default:
sender.sendMessage(errorPrefix + message("COMMAND_INVALID_ARG").addAmount(args[1].toLowerCase()));
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java
index 65b33d1..ac2badf 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/List.java
@@ -1,6 +1,6 @@
package net.tylermurphy.hideAndSeek.command.map;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.ChatColor;
@@ -13,7 +13,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 List extends Command {
+public class List implements ICommand {
public void execute(Player sender, String[] args) {
Collection<Map> maps = Maps.getAllMaps();
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java
index 4f708b6..d681848 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Remove.java
@@ -1,7 +1,7 @@
package net.tylermurphy.hideAndSeek.command.map;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -15,7 +15,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 Remove extends Command {
+public class Remove implements ICommand {
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/Save.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java
index c28d2e9..a612026 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Save.java
@@ -20,7 +20,7 @@
package net.tylermurphy.hideAndSeek.command.map;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -35,7 +35,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class Save extends Command {
+public class Save implements ICommand {
public static boolean runningBackup = false;
@@ -63,7 +63,7 @@ public class Save extends Command {
}
sender.sendMessage(messagePrefix + message("MAPSAVE_START"));
sender.sendMessage(warningPrefix + message("MAPSAVE_WARNING"));
- World world = map.getSpawn().getWorld();
+ World world = map.getSpawn().load();
if (world == null) {
sender.sendMessage(warningPrefix + message("MAPSAVE_FAIL_WORLD"));
return;
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java
index 053603b..c7da88a 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/Status.java
@@ -19,7 +19,7 @@
package net.tylermurphy.hideAndSeek.command.map;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import org.bukkit.entity.Player;
@@ -31,7 +31,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class Status extends Command {
+public class Status implements ICommand {
public void execute(Player sender, String[] args) {
@@ -42,19 +42,19 @@ public class Status extends Command {
sender.sendMessage(errorPrefix + message("INVALID_MAP"));
return;
}
- if (map.getSpawn().getBlockX() == 0 && map.getSpawn().getBlockY() == 0 && map.getSpawn().getBlockZ() == 0 || Map.worldDoesntExist(map.getLobbyName())) {
+ if (map.getSpawn().getBlockX() == 0 && map.getSpawn().getBlockY() == 0 && map.getSpawn().getBlockZ() == 0 || !map.getSpawn().exists()) {
msg = msg + "\n" + message("SETUP_GAME");
count++;
}
- if (map.getLobby().getBlockX() == 0 && map.getLobby().getBlockY() == 0 && map.getLobby().getBlockZ() == 0 || Map.worldDoesntExist(map.getLobbyName())) {
+ if (map.getLobby().getBlockX() == 0 && map.getLobby().getBlockY() == 0 && map.getLobby().getBlockZ() == 0 || !map.getLobby().exists()) {
msg = msg + "\n" + message("SETUP_LOBBY");
count++;
}
- if (map.getSeekerLobby().getBlockX() == 0 && map.getSeekerLobby().getBlockY() == 0 && map.getSeekerLobby().getBlockZ() == 0 || Map.worldDoesntExist(map.getSeekerLobbyName())) {
+ if (map.getSeekerLobby().getBlockX() == 0 && map.getSeekerLobby().getBlockY() == 0 && map.getSeekerLobby().getBlockZ() == 0 || !map.getSeekerLobby().exists()) {
msg = msg + "\n" + message("SETUP_SEEKER_LOBBY");
count++;
}
- if (exitPosition.getBlockX() == 0 && exitPosition.getBlockY() == 0 && exitPosition.getBlockZ() == 0 || Map.worldDoesntExist(exitWorld)) {
+ if (exitPosition.getBlockX() == 0 && exitPosition.getBlockY() == 0 && exitPosition.getBlockZ() == 0 || !exitPosition.exists()) {
msg = msg + "\n" + message("SETUP_EXIT");
count++;
}
@@ -62,7 +62,7 @@ public class Status extends Command {
msg = msg + "\n" + message("SETUP_BOUNDS");
count++;
}
- if (mapSaveEnabled && Map.worldDoesntExist(map.getGameSpawnName())) {
+ if (mapSaveEnabled && !map.getGameSpawn().exists()) {
msg = msg + "\n" + message("SETUP_SAVEMAP");
count++;
}
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
index ed14380..14ae8e0 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/Enabled.java
@@ -1,7 +1,7 @@
package net.tylermurphy.hideAndSeek.command.map.blockhunt;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -17,7 +17,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 Enabled extends Command {
+public class Enabled implements ICommand {
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/blockhunt/blocks/Add.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Add.java
index bd4cf9f..fbdeecb 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Add.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Add.java
@@ -1,7 +1,7 @@
package net.tylermurphy.hideAndSeek.command.map.blockhunt.blocks;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -17,7 +17,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 Add extends Command {
+public class Add implements ICommand {
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/blockhunt/blocks/List.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/List.java
index 396f2dd..18f1b3c 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/List.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/List.java
@@ -1,6 +1,6 @@
package net.tylermurphy.hideAndSeek.command.map.blockhunt.blocks;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
@@ -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 List extends Command {
+public class List implements ICommand {
public void execute(Player sender, String[] args) {
Map map = Maps.getMap(args[0]);
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Remove.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Remove.java
index fed9dfa..d2afdc1 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Remove.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/blockhunt/blocks/Remove.java
@@ -1,7 +1,7 @@
package net.tylermurphy.hideAndSeek.command.map.blockhunt.blocks;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -17,7 +17,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 Remove extends Command {
+public class Remove implements ICommand {
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/set/Border.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java
index 1b59abc..f9e14f8 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Border.java
@@ -20,7 +20,7 @@
package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -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 Border extends Command {
+public class Border implements ICommand {
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/set/Bounds.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java
index 1adfc59..960863b 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Bounds.java
@@ -20,7 +20,7 @@
package net.tylermurphy.hideAndSeek.command.map.set;
import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.configuration.Map;
import net.tylermurphy.hideAndSeek.configuration.Maps;
import net.tylermurphy.hideAndSeek.game.util.Status;
@@ -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 Bounds extends Command {
+public class Bounds implements ICommand {
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/set/Lobby.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java
index f2395f1..ada76e2 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Lobby.java
@@ -19,21 +19,22 @@
package net.tylermurphy.hideAndSeek.command.map.set;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
import net.tylermurphy.hideAndSeek.command.location.Locations;
import net.tylermurphy.hideAndSeek.configuration.Maps;
+import net.tylermurphy.hideAndSeek.util.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.stream.Collectors;
-public class Lobby extends Command {
+public class Lobby implements ICommand {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.LOBBY, args[0], map -> {
- map.setLobby(sender.getLocation());
+ map.setLobby(Location.from(sender));
});
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java
index ebbef1c..9bc0249 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/SeekerLobby.java
@@ -1,9 +1,10 @@
package net.tylermurphy.hideAndSeek.command.map.set;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
import net.tylermurphy.hideAndSeek.command.location.LocationUtils;
import net.tylermurphy.hideAndSeek.command.location.Locations;
import net.tylermurphy.hideAndSeek.configuration.Maps;
+import net.tylermurphy.hideAndSeek.util.Location;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
@@ -12,7 +13,7 @@ import java.util.stream.Collectors;
import static net.tylermurphy.hideAndSeek.configuration.Localization.message;
-public class SeekerLobby extends Command {
+public class SeekerLobby implements ICommand {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.SEEKER, args[0], map -> {
@@ -22,7 +23,7 @@ public class SeekerLobby extends Command {
if(!map.getSpawnName().equals(sender.getLocation().getWorld().getName())) {
throw new RuntimeException(message("SEEKER_LOBBY_INVALID").toString());
}
- map.setSeekerLobby(sender.getLocation());
+ map.setSeekerLobby(Location.from(sender));
});
}
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java
index c954876..b983404 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/map/set/Spawn.java
@@ -19,11 +19,11 @@
package net.tylermurphy.hideAndSeek.command.map.set;
-import net.tylermurphy.hideAndSeek.command.util.Command;
+import net.tylermurphy.hideAndSeek.command.util.ICommand;
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 net.tylermurphy.hideAndSeek.util.Location;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
@@ -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 Spawn extends Command {
+public class Spawn implements ICommand {
public void execute(Player sender, String[] args) {
LocationUtils.setLocation(sender, Locations.GAME, args[0], map -> {
@@ -45,11 +45,11 @@ public class Spawn extends Command {
throw new RuntimeException("World border not enabled or not in valid position!");
}
- map.setSpawn(sender.getLocation());
+ map.setSpawn(Location.from(sender));
- if(map.getSeekerLobby().getWorld() != null && !map.getSeekerLobby().getWorld().getName().equals(sender.getLocation().getWorld().getName())) {
+ if(map.getSeekerLobby().getWorld() != null && !map.getSeekerLobby().getWorld().equals(sender.getLocation().getWorld().getName())) {
sender.sendMessage(message("SEEKER_LOBBY_SPAWN_RESET").toString());
- map.setSeekerLobby(new Location(null, 0, 0, 0));
+ map.setSeekerLobby(Location.getDefault());
}
if (!sender.getLocation().getWorld().getName().equals(map.getSpawnName()) && mapSaveEnabled) {