kenshinshideandseek/src/main/java/net/tylermurphy/hideAndSeek/command/SetLobbyLocation.java

50 lines
1.4 KiB
Java
Raw Normal View History

2021-10-11 21:06:21 +00:00
package net.tylermurphy.hideAndSeek.command;
2021-10-21 00:14:01 +00:00
import static net.tylermurphy.hideAndSeek.Config.*;
2021-10-11 21:06:21 +00:00
import java.util.HashMap;
import java.util.Map;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
2021-10-21 00:14:01 +00:00
import net.tylermurphy.hideAndSeek.Main;
2021-10-11 21:06:21 +00:00
public class SetLobbyLocation implements ICommand {
public void execute(CommandSender sender, String[] args) {
Vector newLobbyPosition = new Vector();
Player player = (Player) sender;
newLobbyPosition.setX(player.getLocation().getBlockX());
newLobbyPosition.setY(player.getLocation().getBlockY());
newLobbyPosition.setZ(player.getLocation().getBlockZ());
2021-10-21 00:14:01 +00:00
if(!Main.plugin.status.equals("Standby")) {
2021-10-11 21:06:21 +00:00
sender.sendMessage(errorPrefix + "Game is currently in session");
return;
}
lobbyPosition = newLobbyPosition;
sender.sendMessage(messagePrefix + "Set lobby position to current location");
Map<String, Object> temp = new HashMap<String,Object>();
temp.put("x", lobbyPosition.getX());
temp.put("y", lobbyPosition.getY());
temp.put("z", lobbyPosition.getZ());
2021-10-18 02:52:57 +00:00
temp.put("world", player.getLocation().getWorld().getName());
addToSection("spawns.lobby",temp);
2021-10-11 21:06:21 +00:00
saveConfig();
}
public String getLabel() {
return "setlobby";
}
public String getUsage() {
return "";
}
public String getDescription() {
return "Sets hide and seeks lobby location to current position";
}
}