summaryrefslogtreewikicommitdiff
path: root/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java')
-rw-r--r--src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
index 1568a9b..6c65714 100644
--- a/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
+++ b/src/main/java/net/tylermurphy/hideAndSeek/command/Leave.java
@@ -2,20 +2,20 @@ package net.tylermurphy.hideAndSeek.command;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
-import net.tylermurphy.hideAndSeek.game.Status;
+import net.tylermurphy.hideAndSeek.game.Board;
+import net.tylermurphy.hideAndSeek.game.Game;
+import net.tylermurphy.hideAndSeek.util.Status;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
-import net.tylermurphy.hideAndSeek.Main;
-import net.tylermurphy.hideAndSeek.util.Util;
import static net.tylermurphy.hideAndSeek.configuration.Localization.*;
public class Leave implements ICommand {
public void execute(CommandSender sender, String[] args) {
- if(!Util.isSetup()) {
+ if(Game.isNotSetup()) {
sender.sendMessage(errorPrefix + message("GAME_SETUP"));
return;
}
@@ -24,20 +24,20 @@ public class Leave implements ICommand {
sender.sendMessage(errorPrefix + message("COMMAND_ERROR"));
return;
}
- if(!Main.plugin.board.isPlayer(player)) {
+ if(!Board.isPlayer(player)) {
sender.sendMessage(errorPrefix + message("GAME_NOT_INGAME"));
return;
}
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
- else Util.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
- Main.plugin.board.removeBoard(player);
- Main.plugin.board.remove(player);
+ else Game.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
+ Board.removeBoard(player);
+ Board.remove(player);
player.teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));
- if(Main.plugin.status == Status.STANDBY) {
- Main.plugin.board.reloadLobbyBoards();
+ if(Game.status == Status.STANDBY) {
+ Board.reloadLobbyBoards();
} else {
- Main.plugin.board.reloadGameBoards();
- Main.plugin.board.reloadBoardTeams();
+ Board.reloadGameBoards();
+ Board.reloadBoardTeams();
}
}