summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
index 4002bee..df5d512 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java
@@ -2,21 +2,19 @@ package net.tylermurphy.hideAndSeek.command;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
-import java.util.HashMap;
-import java.util.Map;
-
-import net.tylermurphy.hideAndSeek.game.Status;
+import net.tylermurphy.hideAndSeek.game.Game;
+import net.tylermurphy.hideAndSeek.util.Status;
+import org.bukkit.World;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
-import net.tylermurphy.hideAndSeek.Main;
import static net.tylermurphy.hideAndSeek.configuration.Localization.*;
public class SetLobbyLocation implements ICommand {
public void execute(CommandSender sender, String[] args) {
- if(Main.plugin.status != Status.STANDBY) {
+ if(Game.status != Status.STANDBY) {
sender.sendMessage(errorPrefix + message("GAME_INPROGRESS"));
return;
}
@@ -29,7 +27,11 @@ public class SetLobbyLocation implements ICommand {
newLobbyPosition.setX(player.getLocation().getBlockX());
newLobbyPosition.setY(player.getLocation().getBlockY());
newLobbyPosition.setZ(player.getLocation().getBlockZ());
- lobbyWorld = player.getLocation().getWorld().getName();
+ World world = player.getLocation().getWorld();
+ if(world == null){
+ throw new RuntimeException("Unable to get world: " + spawnWorld);
+ }
+ lobbyWorld = world.getName();
lobbyPosition = newLobbyPosition;
sender.sendMessage(messagePrefix + message("LOBBY_SPAWN"));
addToConfig("spawns.lobby.x", lobbyPosition.getX());