From 256bcfb1bf42e6852cb5cf28e2cd0ca44d613fee Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Fri, 22 May 2026 16:01:01 +0200 Subject: [PATCH 1/6] Update CheckCommand --- .../src/de/steamwar/sql/GameModeConfig.java | 2 +- .../src/de/steamwar/command/SWCommand.java | 7 ++- .../velocitycore/commands/CheckCommand.java | 37 ++++++++++++-- .../velocitycore/commands/CheckCommand2.java | 51 +++++++++++++++++++ 4 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index f8b27f59..51d6bf14 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -146,7 +146,7 @@ public final class GameModeConfig { public final List CheckQuestions; /** - * The allowed checkers to check this schematic type denoted by a list of SteamWar ids. + * The allowed checkers to check this schematic type denoted by a list of SteamwarUser ids. * The people need the {@link UserPerm#CHECK} to be able to check though. * * @implSpec {@code []} by default -> denoting every person with {@link UserPerm#CHECK} can check it diff --git a/VelocityCore/src/de/steamwar/command/SWCommand.java b/VelocityCore/src/de/steamwar/command/SWCommand.java index 2fdf204f..e1e0c066 100644 --- a/VelocityCore/src/de/steamwar/command/SWCommand.java +++ b/VelocityCore/src/de/steamwar/command/SWCommand.java @@ -20,6 +20,7 @@ package de.steamwar.command; import com.velocitypowered.api.command.SimpleCommand; +import com.velocitypowered.api.command.SimpleCommand.Invocation; import de.steamwar.messages.Chatter; import de.steamwar.messages.Message; import de.steamwar.sql.UserPerm; @@ -91,11 +92,15 @@ public class SWCommand extends AbstractSWCommand { @Override public boolean hasPermission(Invocation invocation) { - return permission == null || Chatter.of(invocation.source()).user().perms().contains(permission); + return SWCommand.this.hasPermission(invocation); } }; } + protected boolean hasPermission(Invocation invocation) { + return permission == null || Chatter.of(invocation.source()).user().perms().contains(permission); + } + @Override public void unregister() { if (command == null) return; diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index 637218e3..1b3aaa43 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -19,6 +19,7 @@ package de.steamwar.velocitycore.commands; +import com.velocitypowered.api.command.SimpleCommand; import com.velocitypowered.api.proxy.Player; import com.velocitypowered.api.proxy.ServerConnection; import de.steamwar.command.SWCommand; @@ -70,9 +71,38 @@ public class CheckCommand extends SWCommand { } public CheckCommand() { - super("check", UserPerm.CHECK); + super("check"); - VelocityCore.schedule(() -> sendReminder(Chatter.serverteam())).repeat(10, TimeUnit.MINUTES).schedule(); + VelocityCore.schedule(() -> sendReminder(Chatter.allStream())).repeat(10, TimeUnit.MINUTES).schedule(); + } + + @Override + protected boolean hasPermission(SimpleCommand.Invocation invocation) { + return mayCheck(Chatter.of(invocation.source()).user()); + } + + private boolean mayCheck(SteamwarUser user) { + if (user.perms().contains(UserPerm.CHECK)) return true; + return GameModeConfig.getAll() + .stream() + .filter(GameModeConfig::isActive) + .flatMap(gameMode -> gameMode.Checkers.stream()) + .anyMatch(integer -> integer == user.getId()); + } + + private boolean hasThingsToCheck(SteamwarUser user) { + return getSchemsToCheck().stream().anyMatch(schematicNode -> mayCheck(user, schematicNode)); + } + + private boolean mayCheck(SteamwarUser user, SchematicNode schematic) { + GameModeConfig gameModeConfig = ArenaMode.getBySchemType(schematic.getSchemtype()); + if (gameModeConfig == null) gameModeConfig = GameModeConfig.getDefaults(); + if (gameModeConfig.Checkers.isEmpty() && user.hasPerm(UserPerm.CHECK)) return true; + return gameModeConfig.Checkers.contains(user.getId()); + } + + private boolean needsCheck(SchematicNode schematicNode) { + return currentSchems.containsKey(schematicNode.getId()); } public static void sendReminder(Chatter chatter) { @@ -142,8 +172,7 @@ public class CheckCommand extends SWCommand { } int playerTeam = sender.user().hasPerm(UserPerm.MODERATION) ? 0 : sender.user().getTeam(); - // Ignore 795 SteamWar Team - if (playerTeam != 0 && playerTeam != 795 && SteamwarUser.byId(schem.getOwner()).getTeam() == playerTeam) { + if (playerTeam != 0 && SteamwarUser.byId(schem.getOwner()).getTeam() == playerTeam) { sender.system("CHECK_SCHEMATIC_OWN_TEAM"); return; } diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java new file mode 100644 index 00000000..e90043ef --- /dev/null +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java @@ -0,0 +1,51 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2026 SteamWar.de-Serverteam + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +package de.steamwar.velocitycore.commands; + +import com.velocitypowered.api.command.SimpleCommand; +import de.steamwar.command.SWCommand; +import de.steamwar.sql.SchematicNode; +import de.steamwar.sql.SchematicType; + +import java.util.ArrayList; +import java.util.List; + +public class CheckCommand2 extends SWCommand { + + public CheckCommand2() { + super("check"); + } + + @Override + protected boolean hasPermission(SimpleCommand.Invocation invocation) { + return false; // TODO: Implement! + } + + public static List getSchemsToCheck() { + List schematicList = new ArrayList<>(); + + for (SchematicType type : SchematicType.values()) { + if (type.check()) { + schematicList.addAll(SchematicNode.getAllSchematicsOfType(type)); + } + } + return schematicList; + } +} From 73d4ed26c8f1bec022c59dd78ce0ed646ad8e468 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 17 Jun 2026 10:47:23 +0200 Subject: [PATCH 2/6] Implement CheckCommand for Checkers not having Check perm --- .../src/de/steamwar/sql/GameModeConfig.java | 4 +- .../SQL/src/de/steamwar/sql/YMLWrapper.java | 6 ++ .../velocitycore/commands/CheckCommand.java | 77 +++++++++---------- .../velocitycore/commands/CheckCommand2.java | 51 ------------ 4 files changed, 46 insertions(+), 92 deletions(-) delete mode 100644 VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java diff --git a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java index 51d6bf14..d22d8978 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java +++ b/CommonCore/SQL/src/de/steamwar/sql/GameModeConfig.java @@ -151,7 +151,7 @@ public final class GameModeConfig { * * @implSpec {@code []} by default -> denoting every person with {@link UserPerm#CHECK} can check it */ - public final List Checkers; + public final Set Checkers; /** * Bundle for countdowns during the fight @@ -246,7 +246,7 @@ public final class GameModeConfig { } CheckQuestions = loader.getStringList("CheckQuestions"); - Checkers = loader.getIntList("Checkers"); + Checkers = loader.getIntSet("Checkers"); Times = new TimesConfig(loader.with("Times")); // Arena would be here to be in config order but needs Schematic.Size and EnterStages loaded afterwards Schematic = new SchematicConfig<>(loader.with("Schematic")); diff --git a/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java b/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java index 39eff9bb..567524ff 100644 --- a/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java +++ b/CommonCore/SQL/src/de/steamwar/sql/YMLWrapper.java @@ -139,6 +139,12 @@ final class YMLWrapper { return get(path, o -> (List) o); } + public Set getIntSet(String path) { + List list = get(path, o -> (List) o); + if (list.isEmpty()) return Collections.emptySet(); + return Collections.unmodifiableSet(new HashSet<>(list)); + } + public List getSchematicTypeList(String path) { List list = getStringList(path); if (list.isEmpty()) { diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index 1b3aaa43..76be799e 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -72,80 +72,79 @@ public class CheckCommand extends SWCommand { public CheckCommand() { super("check"); - - VelocityCore.schedule(() -> sendReminder(Chatter.allStream())).repeat(10, TimeUnit.MINUTES).schedule(); + VelocityCore.schedule(() -> Chatter.allStream().forEach(CheckCommand::sendReminder)).repeat(10, TimeUnit.MINUTES).schedule(); } @Override protected boolean hasPermission(SimpleCommand.Invocation invocation) { - return mayCheck(Chatter.of(invocation.source()).user()); - } - - private boolean mayCheck(SteamwarUser user) { + SteamwarUser user = Chatter.of(invocation.source()).user(); if (user.perms().contains(UserPerm.CHECK)) return true; return GameModeConfig.getAll() .stream() .filter(GameModeConfig::isActive) - .flatMap(gameMode -> gameMode.Checkers.stream()) - .anyMatch(integer -> integer == user.getId()); + .anyMatch(gameMode -> gameMode.Checkers.contains(user.getId())); } - private boolean hasThingsToCheck(SteamwarUser user) { - return getSchemsToCheck().stream().anyMatch(schematicNode -> mayCheck(user, schematicNode)); + private static Map getSchematics(SteamwarUser user) { + Map map = new HashMap<>(); + for (SchematicNode schematicNode : getSchemsToCheck()) { + if (!mayCheck(user, schematicNode)) continue; + CheckSession checkSession = currentSchems.get(schematicNode.getId()); + if (checkSession == null) { + map.put(schematicNode, null); + } else { + map.put(schematicNode, checkSession.checker.user()); + } + } + return map; } - private boolean mayCheck(SteamwarUser user, SchematicNode schematic) { + private static boolean mayCheck(SteamwarUser user, SchematicNode schematic) { GameModeConfig gameModeConfig = ArenaMode.getBySchemType(schematic.getSchemtype()); if (gameModeConfig == null) gameModeConfig = GameModeConfig.getDefaults(); + if (user.hasPerm(UserPerm.ADMINISTRATION)) return true; if (gameModeConfig.Checkers.isEmpty() && user.hasPerm(UserPerm.CHECK)) return true; return gameModeConfig.Checkers.contains(user.getId()); } - private boolean needsCheck(SchematicNode schematicNode) { - return currentSchems.containsKey(schematicNode.getId()); - } - public static void sendReminder(Chatter chatter) { - List schematics = getSchemsToCheck(); - if (schematics.size() == currentCheckers.size()) return; + Map schematics = getSchematics(chatter.user()); + if (schematics.isEmpty()) return; + long needsChecking = schematics.entrySet().stream().filter(entry -> entry.getValue() == null).count(); + if (needsChecking == 0) return; - chatter.system("CHECK_REMINDER", new Message("CHECK_REMINDER_HOVER"), ClickEvent.runCommand("/check list"), schematics.size() - currentCheckers.size()); + chatter.system("CHECK_REMINDER", new Message("CHECK_REMINDER_HOVER"), ClickEvent.runCommand("/check list"), needsChecking); } @Register(value = "list", description = "CHECK_HELP_LIST") public void list(Chatter sender) { - List schematicList = getSchemsToCheck(); + Map schematics = getSchematics(sender.user()); - sender.system("CHECK_LIST_HEADER", schematicList.size()); + sender.system("CHECK_LIST_HEADER", schematics.size()); - for (SchematicNode schematic : schematicList) { - GameModeConfig gameModeConfig = ArenaMode.getBySchemType(schematic.getSchemtype()); - if (gameModeConfig == null) gameModeConfig = GameModeConfig.getDefaults(); - CheckSession current = currentSchems.get(schematic.getId()); - ClickEvent clickEvent = null; - Message hoverMessage = null; - if (gameModeConfig.Checkers.isEmpty() || gameModeConfig.Checkers.contains(sender.user().getId())) { - if (current == null) { - clickEvent = ClickEvent.runCommand("/check schematic " + schematic.getId()); - hoverMessage = new Message("CHECK_LIST_TO_CHECK_HOVER"); - } else { - clickEvent = ClickEvent.runCommand("/join " + current.checker.user().getUserName()); - hoverMessage = new Message("CHECK_LIST_CHECKING_HOVER"); - } + for (Map.Entry entry : schematics.entrySet()) { + ClickEvent clickEvent; + Message hoverMessage; + if (entry.getValue() == null) { + clickEvent = ClickEvent.runCommand("/check schematic " + entry.getKey().getId()); + hoverMessage = new Message("CHECK_LIST_TO_CHECK_HOVER"); + } else { + clickEvent = ClickEvent.runCommand("/join " + entry.getValue().getUserName()); + hoverMessage = new Message("CHECK_LIST_CHECKING_HOVER"); } - if (current == null) { + if (entry.getValue() == null) { sender.prefixless("CHECK_LIST_TO_CHECK", hoverMessage, clickEvent, - getWaitTime(schematic), - schematic.getSchemtype().getKuerzel(), SteamwarUser.byId(schematic.getOwner()).getUserName(), schematic.getName()); + getWaitTime(entry.getKey()), + entry.getKey().getSchemtype().getKuerzel(), SteamwarUser.byId(entry.getKey().getOwner()).getUserName(), entry.getKey().getName()); } else { sender.prefixless("CHECK_LIST_CHECKING", hoverMessage, clickEvent, - getWaitTime(schematic), - schematic.getSchemtype().getKuerzel(), SteamwarUser.byId(schematic.getOwner()).getUserName(), schematic.getName(), current.checker.user().getUserName()); + getWaitTime(entry.getKey()), + entry.getKey().getSchemtype().getKuerzel(), SteamwarUser.byId(entry.getKey().getOwner()).getUserName(), entry.getKey().getName(), entry.getValue().getUserName()); } } } diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java deleted file mode 100644 index e90043ef..00000000 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand2.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is a part of the SteamWar software. - * - * Copyright (C) 2026 SteamWar.de-Serverteam - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -package de.steamwar.velocitycore.commands; - -import com.velocitypowered.api.command.SimpleCommand; -import de.steamwar.command.SWCommand; -import de.steamwar.sql.SchematicNode; -import de.steamwar.sql.SchematicType; - -import java.util.ArrayList; -import java.util.List; - -public class CheckCommand2 extends SWCommand { - - public CheckCommand2() { - super("check"); - } - - @Override - protected boolean hasPermission(SimpleCommand.Invocation invocation) { - return false; // TODO: Implement! - } - - public static List getSchemsToCheck() { - List schematicList = new ArrayList<>(); - - for (SchematicType type : SchematicType.values()) { - if (type.check()) { - schematicList.addAll(SchematicNode.getAllSchematicsOfType(type)); - } - } - return schematicList; - } -} From 3ec3c90f040c6637bd4863d2ed7168a7cc5d1e6d Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 17 Jun 2026 10:57:04 +0200 Subject: [PATCH 3/6] Fix message on join --- .../de/steamwar/velocitycore/listeners/ConnectionListener.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java b/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java index 7e39c822..021f65d0 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java +++ b/VelocityCore/src/de/steamwar/velocitycore/listeners/ConnectionListener.java @@ -84,8 +84,7 @@ public class ConnectionListener extends BasicListener { Player player = event.getPlayer(); SteamwarUser user = SteamwarUser.get(player.getUniqueId()); Chatter chatter = Chatter.of(player); - - if (user.hasPerm(UserPerm.CHECK)) CheckCommand.sendReminder(chatter); + CheckCommand.sendReminder(chatter); for (Subserver subserver : Subserver.getServerList()) { if (Subserver.isArena(subserver)) { From ed89770c0f1e59ebed4a080a8861d293b1231c12 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 17 Jun 2026 11:04:07 +0200 Subject: [PATCH 4/6] Fix ConcurrentModificationException --- .../src/de/steamwar/velocitycore/commands/CheckCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index 76be799e..26eac997 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -72,7 +72,7 @@ public class CheckCommand extends SWCommand { public CheckCommand() { super("check"); - VelocityCore.schedule(() -> Chatter.allStream().forEach(CheckCommand::sendReminder)).repeat(10, TimeUnit.MINUTES).schedule(); + VelocityCore.schedule(() -> Chatter.allStream().forEach(CheckCommand::sendReminder)).delay(10, TimeUnit.MINUTES).repeat(10, TimeUnit.MINUTES).schedule(); } @Override From 27e01a56ae22856f35b090ccb79d2b35abe78b8a Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 17 Jun 2026 11:09:32 +0200 Subject: [PATCH 5/6] Improve CheckCommand --- .../velocitycore/commands/CheckCommand.java | 39 +++++++------------ 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index 26eac997..f96c0b56 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -90,11 +90,7 @@ public class CheckCommand extends SWCommand { for (SchematicNode schematicNode : getSchemsToCheck()) { if (!mayCheck(user, schematicNode)) continue; CheckSession checkSession = currentSchems.get(schematicNode.getId()); - if (checkSession == null) { - map.put(schematicNode, null); - } else { - map.put(schematicNode, checkSession.checker.user()); - } + map.put(schematicNode, checkSession == null ? null : checkSession.checker.user()); } return map; } @@ -112,7 +108,6 @@ public class CheckCommand extends SWCommand { if (schematics.isEmpty()) return; long needsChecking = schematics.entrySet().stream().filter(entry -> entry.getValue() == null).count(); if (needsChecking == 0) return; - chatter.system("CHECK_REMINDER", new Message("CHECK_REMINDER_HOVER"), ClickEvent.runCommand("/check list"), needsChecking); } @@ -123,29 +118,30 @@ public class CheckCommand extends SWCommand { sender.system("CHECK_LIST_HEADER", schematics.size()); for (Map.Entry entry : schematics.entrySet()) { + String message; ClickEvent clickEvent; Message hoverMessage; + String checker; if (entry.getValue() == null) { + message = "CHECK_LIST_TO_CHECK"; clickEvent = ClickEvent.runCommand("/check schematic " + entry.getKey().getId()); hoverMessage = new Message("CHECK_LIST_TO_CHECK_HOVER"); + checker = ""; } else { + message = "CHECK_LIST_CHECKING"; clickEvent = ClickEvent.runCommand("/join " + entry.getValue().getUserName()); hoverMessage = new Message("CHECK_LIST_CHECKING_HOVER"); + checker = entry.getValue().getUserName(); } - if (entry.getValue() == null) { - sender.prefixless("CHECK_LIST_TO_CHECK", - hoverMessage, - clickEvent, - getWaitTime(entry.getKey()), - entry.getKey().getSchemtype().getKuerzel(), SteamwarUser.byId(entry.getKey().getOwner()).getUserName(), entry.getKey().getName()); - } else { - sender.prefixless("CHECK_LIST_CHECKING", - hoverMessage, - clickEvent, - getWaitTime(entry.getKey()), - entry.getKey().getSchemtype().getKuerzel(), SteamwarUser.byId(entry.getKey().getOwner()).getUserName(), entry.getKey().getName(), entry.getValue().getUserName()); - } + sender.prefixless(message, + hoverMessage, + clickEvent, + getWaitTime(entry.getKey()), + entry.getKey().getSchemtype().getKuerzel(), + SteamwarUser.byId(entry.getKey().getOwner()).getUserName(), + entry.getKey().getName(), + checker); } } @@ -237,11 +233,6 @@ public class CheckCommand extends SWCommand { return schematicList; } - public static String getChecker(SchematicNode schematic) { - if (currentSchems.get(schematic.getId()) == null) return null; - return currentSchems.get(schematic.getId()).checker.user().getUserName(); - } - private static boolean notChecking(Player player) { if (!isChecking(player)) { Chatter.of(player).system("CHECK_NOT_CHECKING"); From 6522fc77f24bff44e6981061ceaf40a131ca90b2 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Wed, 17 Jun 2026 11:14:53 +0200 Subject: [PATCH 6/6] Improve color gradient --- .../de/steamwar/velocitycore/commands/CheckCommand.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java index f96c0b56..b0183aa5 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/CheckCommand.java @@ -63,8 +63,12 @@ public class CheckCommand extends SWCommand { public static Message getWaitTime(SchematicNode schematic) { long waitedMillis = Timestamp.from(Instant.now()).getTime() - schematic.getLastUpdate().getTime(); - String ce = waitedMillis > 86400000 ? "c" : "e"; - String color = waitedMillis > 14400000 ? ce : "a"; + String color; + if (waitedMillis > 48L * 60 * 60 * 1000) color = "4"; + else if (waitedMillis > 24L * 60 * 60 * 1000) color = "c"; + else if (waitedMillis > 12L * 60 * 60 * 1000) color = "6"; + else if (waitedMillis > 4L * 60 * 60 * 1000) color = "e"; + else color = "a"; long hours = waitedMillis / 3600000; long minutes = (waitedMillis - hours * 3600000) / 60000; return new Message("CHECK_LIST_WAIT", color, hours, (minutes < 10) ? "0" + minutes : minutes);