code cleanup
Dieser Commit ist enthalten in:
Ursprung
cc18882a52
Commit
c6efe8a5f4
@ -4,6 +4,8 @@ import de.steamwar.fightsystem.FightSystem;
|
||||
import de.steamwar.fightsystem.fight.Fight;
|
||||
import de.steamwar.fightsystem.fight.FightTeam;
|
||||
import de.steamwar.sql.SchematicType;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import de.steamwar.sql.UserGroup;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -13,8 +15,20 @@ public class LockschemCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Player player = (Player) sender;
|
||||
if(sender instanceof Player) {
|
||||
if(args.length == 1) {
|
||||
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:
|
||||
String teamName = args[1];
|
||||
FightTeam fightTeam = Fight.getTeamByName(teamName);
|
||||
|
||||
@ -25,7 +39,6 @@ public class LockschemCommand implements CommandExecutor {
|
||||
fightTeam.getSchematic().setSchemType(SchematicType.Normal);
|
||||
player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + "§cgepserrt!");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren