SteamWar/FightSystem
Archiviert
13
1
Dieser Commit ist enthalten in:
Yaruma3341 2019-11-21 19:40:59 +01:00 committet von BuildTools
Ursprung cc18882a52
Commit c6efe8a5f4

Datei anzeigen

@ -4,6 +4,8 @@ import de.steamwar.fightsystem.FightSystem;
import de.steamwar.fightsystem.fight.Fight; import de.steamwar.fightsystem.fight.Fight;
import de.steamwar.fightsystem.fight.FightTeam; import de.steamwar.fightsystem.fight.FightTeam;
import de.steamwar.sql.SchematicType; import de.steamwar.sql.SchematicType;
import de.steamwar.sql.SteamwarUser;
import de.steamwar.sql.UserGroup;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -13,8 +15,20 @@ public class LockschemCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
Player player = (Player) sender; Player player = (Player) sender;
if(sender instanceof Player) { if(!(sender instanceof Player)) {
if(args.length == 1) { 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:
String teamName = args[1]; String teamName = args[1];
FightTeam fightTeam = Fight.getTeamByName(teamName); FightTeam fightTeam = Fight.getTeamByName(teamName);
@ -24,7 +38,6 @@ public class LockschemCommand implements CommandExecutor {
} }
fightTeam.getSchematic().setSchemType(SchematicType.Normal); fightTeam.getSchematic().setSchemType(SchematicType.Normal);
player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + "§cgepserrt!"); player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + "§cgepserrt!");
}
} }
return false; return false;
} }