From 808cd32c8e14e4797b9ecc7f6a07e116551e4b3a Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sun, 14 Apr 2019 00:37:47 +0200 Subject: [PATCH] added command (leave your team) Signed-off-by: Yaruma3341 --- src/me/yaruma/fightsystem/commands/AkCommand.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/me/yaruma/fightsystem/commands/AkCommand.java b/src/me/yaruma/fightsystem/commands/AkCommand.java index 0534710..919004a 100644 --- a/src/me/yaruma/fightsystem/commands/AkCommand.java +++ b/src/me/yaruma/fightsystem/commands/AkCommand.java @@ -12,6 +12,7 @@ import me.yaruma.fightsystem.kit.Kit; import me.yaruma.fightsystem.kit.KitManager; import me.yaruma.fightsystem.utils.Config; import org.bukkit.Bukkit; +import org.bukkit.GameMode; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -70,6 +71,15 @@ public class AkCommand implements CommandExecutor { } else player.sendMessage(FightSystem.PREFIX + "§cEs sind bereits zwei Leader vorhanden!"); + } else if(args[0].equalsIgnoreCase("leave")) { + FightTeam fightTeam = Fight.getPlayerTeam(player); + if(fightTeam != null) { + fightTeam.removePlayer(player); + player.setGameMode(GameMode.SPECTATOR); + player.teleport(Config.SpecSpawn); + player.sendMessage(FightSystem.PREFIX + "§aDu hast das Team verlassen!"); + } else + player.sendMessage(FightSystem.PREFIX + "§cDu befindest dich in keinem Team!"); } }else if(args.length == 2) { @@ -211,6 +221,7 @@ public class AkCommand implements CommandExecutor { p.sendMessage("§8/§6ak invite [Spieler] §8- §7Lade den Spieler in dein Team bei"); p.sendMessage("§8/§6ak accept §8- §7Einladung annehmen"); p.sendMessage("§8/§6ak decline §8- §7Einladung ablehnen"); + p.sendMessage("§8/ak leave §8- §7Team verlassen"); p.sendMessage("§8/§6ak kit §8- §7Wähle ein Kit"); p.sendMessage("§8/§6ak schem §8- §7Setze deine Schematic"); }