diff --git a/src/de/steamwar/misslewars/commands/AcceptCommand.java b/src/de/steamwar/misslewars/commands/AcceptCommand.java
new file mode 100644
index 0000000..b411460
--- /dev/null
+++ b/src/de/steamwar/misslewars/commands/AcceptCommand.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 SteamWar.de-Serverteam
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ * /
+ */
+
+package de.steamwar.misslewars.commands;
+
+import de.steamwar.misslewars.Config;
+import de.steamwar.misslewars.MWTeam;
+import de.steamwar.misslewars.MissileWars;
+import de.steamwar.command.SWCommand;
+import de.steamwar.command.TypeValidator;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+public class AcceptCommand extends SWCommand {
+ public AcceptCommand() {
+ super("accept");
+ }
+
+ @Register
+ public void onCommand(@Validator Player player, String... varargs) {
+ MWTeam teamInvitation = MissileWars.getInvitation(player);
+ if (teamInvitation == null) {
+ player.sendMessage("§cDu wurdest nicht eingeladen.");
+ }
+ else {
+ teamInvitation.acceptInvite(player);
+ message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 ist dem Team §abeigetreten§7.");
+ }
+ }
+
+ @ClassValidator(value = Player.class, local = true)
+ public TypeValidator validator() {
+ return new TypeValidator() {
+ @Override
+ public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
+ if (Config.isChallenge()) {
+ messageSender.send("§cDieser Command ist deaktiviert.");
+ return false;
+ }
+ return true;
+ }
+ };
+ }
+
+ private void message(MWTeam mwTeam, String s) {
+ mwTeam.getPlayers().forEach(player -> player.sendMessage(s));
+ }
+}
diff --git a/src/de/steamwar/misslewars/commands/DeclineCommand.java b/src/de/steamwar/misslewars/commands/DeclineCommand.java
new file mode 100644
index 0000000..a667c80
--- /dev/null
+++ b/src/de/steamwar/misslewars/commands/DeclineCommand.java
@@ -0,0 +1,68 @@
+/*
+ *
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 SteamWar.de-Serverteam
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ * /
+ */
+
+package de.steamwar.misslewars.commands;
+
+import de.steamwar.misslewars.Config;
+import de.steamwar.misslewars.MWTeam;
+import de.steamwar.misslewars.MissileWars;
+import de.steamwar.command.SWCommand;
+import de.steamwar.command.TypeValidator;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class DeclineCommand extends SWCommand {
+ public DeclineCommand() {
+ super("decline");
+ }
+
+ @Register
+ public void onCommand(@Validator Player player, String... varargs) {
+ MWTeam teamInvitation = MissileWars.getInvitation(player);
+ if (teamInvitation == null) {
+ player.sendMessage("§cDu wurdest nicht eingeladen.");
+ }
+ else {
+ MWTeam.removeInvitations(player);
+ message(teamInvitation, "§7Der Spieler §e" + player.getName() + "§7 hat die Einladung §cabgelehnt§7.");
+ }
+ }
+
+ @ClassValidator(value = Player.class, local = true)
+ public TypeValidator validator() {
+ return new TypeValidator() {
+ @Override
+ public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
+ if (!Config.isChallenge()) {
+ messageSender.send("§cDieser Command ist deaktiviert.");
+ return false;
+ }
+ return true;
+ }
+ };
+ }
+
+ private void message(MWTeam mwTeam, String s) {
+ mwTeam.getPlayers().forEach(player -> player.sendMessage(s));
+ }
+
+}
diff --git a/src/de/steamwar/misslewars/commands/InviteCommand.java b/src/de/steamwar/misslewars/commands/InviteCommand.java
new file mode 100644
index 0000000..a6b22f3
--- /dev/null
+++ b/src/de/steamwar/misslewars/commands/InviteCommand.java
@@ -0,0 +1,79 @@
+package de.steamwar.misslewars.commands;
+
+import de.steamwar.command.SWCommand;
+import de.steamwar.command.TypeValidator;
+import de.steamwar.misslewars.Config;
+import de.steamwar.misslewars.MWTeam;
+import de.steamwar.misslewars.MissileWars;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.command.TabCompleter;
+import org.bukkit.entity.Player;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class InviteCommand extends SWCommand implements TabCompleter {
+
+ public InviteCommand() {
+ super("invite", "inv");
+ }
+
+ @Register
+ public void onCommand(@Validator Player player, String playerName, String... varargs) {
+ MWTeam team = MissileWars.getTeam(player);
+ Player invitedPlayer = Bukkit.getPlayer(playerName);
+ if (!Config.RedLeader.equals(player.getUniqueId()) && !Config.BlueLeader.equals(player.getUniqueId()) || team == null) {
+ player.sendMessage("§cDu kannst keine Spieler einladen.");
+ }
+ else if (invitedPlayer == null) {
+ player.sendMessage("§cDieser Spieler ist nicht online.");
+ }
+ else if (MissileWars.getTeam(invitedPlayer) != null) {
+ player.sendMessage("§cDieser Spieler ist bereits in einem Team.");
+ }
+ else if (MissileWars.getInvitation(invitedPlayer) != null) {
+ player.sendMessage("§cDieser Spieler wurde bereits eingeladen.");
+ }
+ else {
+ team.invitePlayer(invitedPlayer);
+ player.sendMessage("§7Du hast §e" + invitedPlayer.getName() + " §7eingeladen.");
+ invitedPlayer.sendMessage("§7Du wurdest von §e" + player.getName() + "§7 in das Team §e" + MissileWars.getTeam(player).getColoredName() + "§7 eingeladen.");
+ invitedPlayer.sendMessage("§8/§eaccept §8- §7Zum akzeptieren.");
+ invitedPlayer.sendMessage("§8/§edecline §8- §7Zum ablehnen.");
+ }
+ }
+
+ @Override
+ public List onTabComplete(CommandSender sender, Command command, String label, String[] args) {
+ if (args.length == 1) {
+ return Bukkit.getOnlinePlayers()
+ .stream()
+ .filter(p -> MissileWars.getTeam(p) != null)
+ .filter(p -> MissileWars.getInvitation(p) != null)
+ .map(Player::getName)
+ .collect(Collectors.toList());
+ }
+ return new ArrayList<>();
+ }
+
+ @ClassValidator(value = Player.class, local = true)
+ public TypeValidator validator() {
+ return new TypeValidator() {
+ @Override
+ public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
+ if (Config.isChallenge()) {
+ messageSender.send("§cDieser Command ist deaktiviert.");
+ return false;
+ }
+ return true;
+ }
+ };
+ }
+
+ private void message(MWTeam mwTeam, String s) {
+ mwTeam.getPlayers().forEach(player -> player.sendMessage(s));
+ }
+}
diff --git a/src/de/steamwar/misslewars/commands/SpectateCommand.java b/src/de/steamwar/misslewars/commands/SpectateCommand.java
new file mode 100644
index 0000000..07b0763
--- /dev/null
+++ b/src/de/steamwar/misslewars/commands/SpectateCommand.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * This file is a part of the SteamWar software.
+ *
+ * Copyright (C) 2020 SteamWar.de-Serverteam
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ * /
+ */
+
+package de.steamwar.misslewars.commands;
+
+import de.steamwar.misslewars.Config;
+import de.steamwar.misslewars.MWTeam;
+import de.steamwar.misslewars.MissileWars;
+import de.steamwar.command.SWCommand;
+import de.steamwar.command.TypeValidator;
+import org.bukkit.GameMode;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+
+
+public class SpectateCommand extends SWCommand {
+ public SpectateCommand() {
+ super("spectate", "spec");
+ }
+
+ @Register
+ public void onCommand(@Validator Player player, String... varargs) {
+ MWTeam mwTeam = MissileWars.getTeam(player);
+ if (mwTeam == null) return;
+ if (mwTeam.size() == 1) {
+ player.sendMessage("§cDu bist alleine im Team, zuschauen ist daher nicht möglich.");
+ }
+ MissileWars.leave(player);
+ player.setGameMode(GameMode.SPECTATOR);
+ player.getInventory().clear();
+ player.updateInventory();
+ }
+
+ @ClassValidator(value = Player.class, local = true)
+ public TypeValidator validator() {
+ return new TypeValidator() {
+ @Override
+ public boolean validate(CommandSender commandSender, Player player, MessageSender messageSender) {
+ if (Config.isChallenge()) {
+ messageSender.send("§cDieser Command ist deaktiviert.");
+ return false;
+ }
+ return true;
+ }
+ };
+ }
+}