Archiviert
1
0

Update TeamCommand

Dieser Commit ist enthalten in:
yoyosource 2022-09-22 21:30:32 +02:00
Ursprung 18a16e91b0
Commit c7937847bc

Datei anzeigen

@ -128,7 +128,7 @@ public class TeamCommand extends SWCommand {
} }
@Register("stepback") @Register("stepback")
public void stepBack(@Validator("notLeader") ProxiedPlayer player) { public void stepBack(@Validator("isLeader") ProxiedPlayer player) {
SteamwarUser user = SteamwarUser.get(player); SteamwarUser user = SteamwarUser.get(player);
Team team = Team.get(user.getTeam()); Team team = Team.get(user.getTeam());
@ -157,7 +157,7 @@ public class TeamCommand extends SWCommand {
Message.send("TEAM_LEAVE_LEFT", player); Message.send("TEAM_LEAVE_LEFT", player);
} }
@Validator("noTeam") @Validator(value = "noTeam", local = true)
private TypeValidator<ProxiedPlayer> noTeamValidator() { private TypeValidator<ProxiedPlayer> noTeamValidator() {
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (SteamwarUser.get(value).getTeam() == 0) { if (SteamwarUser.get(value).getTeam() == 0) {
@ -169,7 +169,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("inTeam") @Validator(value = "inTeam", local = true)
private TypeValidator<ProxiedPlayer> inTeamValidator() { private TypeValidator<ProxiedPlayer> inTeamValidator() {
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (SteamwarUser.get(value).getTeam() != 0) { if (SteamwarUser.get(value).getTeam() != 0) {
@ -181,8 +181,8 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("notLeader") @Validator(value = "isLeader", local = true)
private TypeValidator<ProxiedPlayer> notLeaderValidator() { private TypeValidator<ProxiedPlayer> isLeaderValidator() {
TypeValidator<ProxiedPlayer> inTeam = inTeamValidator(); TypeValidator<ProxiedPlayer> inTeam = inTeamValidator();
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (!inTeam.validate(sender, value, messageSender)) return false; if (!inTeam.validate(sender, value, messageSender)) return false;
@ -195,7 +195,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("notDuringEvent") @Validator(value = "notDuringEvent", local = true)
private TypeValidator<ProxiedPlayer> notDuringEventValidator() { private TypeValidator<ProxiedPlayer> notDuringEventValidator() {
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (Event.get() == null) { if (Event.get() == null) {
@ -207,7 +207,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("teamJoin") @Validator(value = "teamJoin", local = true)
private TypeValidator<ProxiedPlayer> teamJoinValidator() { private TypeValidator<ProxiedPlayer> teamJoinValidator() {
TypeValidator<ProxiedPlayer> noTeam = noTeamValidator(); TypeValidator<ProxiedPlayer> noTeam = noTeamValidator();
TypeValidator<ProxiedPlayer> notDuringEvent = notDuringEventValidator(); TypeValidator<ProxiedPlayer> notDuringEvent = notDuringEventValidator();
@ -222,7 +222,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Mapper("teamJoinTypeMapper") @Mapper(value = "teamJoinTypeMapper", local = true)
private TypeMapper<Team> teamJoinTypeMapper() { private TypeMapper<Team> teamJoinTypeMapper() {
return new TypeMapper<Team>() { return new TypeMapper<Team>() {
@Override @Override
@ -263,7 +263,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("unusedKuerzel") @Validator(value = "unusedKuerzel", local = true)
private TypeValidator<String> unusedTeamKuerzel() { private TypeValidator<String> unusedTeamKuerzel() {
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (value.length() < 2 || value.length() > 4) { if (value.length() < 2 || value.length() > 4) {
@ -280,7 +280,7 @@ public class TeamCommand extends SWCommand {
}; };
} }
@Validator("unusedName") @Validator(value = "unusedName", local = true)
private TypeValidator<String> unusedTeamName() { private TypeValidator<String> unusedTeamName() {
return (sender, value, messageSender) -> { return (sender, value, messageSender) -> {
if (value.length() < 4 || value.length() > 15) { if (value.length() < 4 || value.length() > 15) {