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/LockschemCommand.java

45 Zeilen
1.6 KiB
Java

2019-11-21 16:20:57 +01:00
package de.steamwar.fightsystem.commands;
import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.sql.SchematicType;
2019-11-21 19:40:59 +01:00
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserGroup;
2019-11-21 16:20:57 +01:00
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class LockschemCommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender;
2019-11-21 19:40:59 +01:00
if(!(sender instanceof Player)) {
return false;
}
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
UserGroup userGroup = steamwarUser.getUserGroup();
if(userGroup != UserGroup.Admin &&
userGroup != UserGroup.Developer &&
userGroup != UserGroup.Moderator &&
userGroup != UserGroup.Supporter)
return false;
switch (args.length) {
case 1:
2019-11-21 16:20:57 +01:00
String teamName = args[1];
FightTeam fightTeam = Fight.getTeamByName(teamName);
if(fightTeam == null) {
player.sendMessage(FightSystem.PREFIX + "§cDieses Team existiert nicht!");
return false;
}
fightTeam.getSchematic().setSchemType(SchematicType.Normal);
player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + "§cgepserrt!");
}
return false;
}
}