SteamWar/FightSystem
Archiviert
13
1
Dieses Repository wurde am 2024-08-05 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
FightSystem/FightSystem_Main/src/de/steamwar/fightsystem/commands/LeaderCommand.java

36 Zeilen
1.3 KiB
Java

2019-09-05 18:26:13 +02:00
package de.steamwar.fightsystem.commands;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class LeaderCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(!(sender instanceof Player))
return false;
Player player = (Player) sender;
if(Commands.checkSetup(player))
return false;
if(args.length == 0){
if(Fight.getFightPlayer(player) == null){
if(!Fight.getBlueTeam().hasTeamLeader())
Fight.getBlueTeam().setLeader(Fight.getBlueTeam().addMember(player));
else if(!Fight.getRedTeam().hasTeamLeader())
Fight.getRedTeam().setLeader(Fight.getRedTeam().addMember(player));
else
player.sendMessage(FightSystem.PREFIX + "§cEs sind bereits 2 Teamleader vorhanden");
}else
player.sendMessage(FightSystem.PREFIX + "§cDu bist bereits in einem Team");
}else
Commands.sendHelp(player);
return false;
}
}