Add restriction for checking own team schematics #494
@ -85,10 +85,11 @@ public class CheckCommand extends SWCommand {
|
||||
Message.sendPrefixless("CHECK_LIST_HEADER", player, schematicList.size());
|
||||
|
||||
SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId());
|
||||
Lixfel markierte diese Unterhaltung als gelöst
Veraltet
|
||||
int playerTeam = steamwarUser.hasPerm(UserPerm.MODERATION) ? -1 : steamwarUser.getTeam();
|
||||
int playerTeam = steamwarUser.hasPerm(UserPerm.MODERATION) ? 0 : steamwarUser.getTeam();
|
||||
for (SchematicNode schematic : schematicList) {
|
||||
SteamwarUser schematicOwner = SteamwarUser.get(schematic.getOwner());
|
||||
CheckSession current = currentSchems.get(schematic.getId());
|
||||
boolean sameTeam = SteamwarUser.get(schematic.getOwner()).getTeam() == playerTeam;
|
||||
boolean sameTeam = schematicOwner.getTeam() != 0 && schematicOwner.getTeam() == playerTeam;
|
||||
long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime();
|
||||
String color = waitedMillis > 14400000 ? (waitedMillis > 86400000 ? "§c" : "§e") : "§a";
|
||||
long hours = waitedMillis / 3600000;
|
||||
@ -99,13 +100,13 @@ public class CheckCommand extends SWCommand {
|
||||
Message.parse("CHECK_LIST_TO_CHECK_HOVER", player),
|
||||
sameTeam ? null : new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/check schematic " + schematic.getId()),
|
||||
waitTime,
|
||||
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName());
|
||||
schematic.getSchemtype().getKuerzel(), schematicOwner.getUserName(), schematic.getName());
|
||||
} else {
|
||||
Message.sendPrefixless("CHECK_LIST_CHECKING", player,
|
||||
Message.parse("CHECK_LIST_CHECKING_HOVER", player),
|
||||
new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/join " + current.checker.getName()),
|
||||
waitTime,
|
||||
schematic.getSchemtype().getKuerzel(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getName(), current.checker.getName());
|
||||
schematic.getSchemtype().getKuerzel(), schematicOwner.getUserName(), schematic.getName(), current.checker.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren
Reverte mal alles in dieser Methode, lass die hier so unverändert. (Unnötiger Aufwand)