From 72e88502d2b44b0d7cc374f8eb8339d502c69378 Mon Sep 17 00:00:00 2001 From: YoyoNow Date: Sat, 21 Mar 2026 09:26:02 +0100 Subject: [PATCH] Fix TeamCommand /team event ... --- .../steamwar/velocitycore/commands/TeamCommand.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java index 70bde6a2..16270087 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java @@ -466,11 +466,11 @@ public class TeamCommand extends SWCommand { return new TypeMapper<>() { @Override public Event map(Chatter sender, PreviousArguments previousArguments, String s) { - try { - return Event.byId(Integer.parseInt(s)); - } catch (NumberFormatException e) { - return null; - } + return Event.getComing() + .stream() + .filter(event -> event.getEventName().replace(" ", "").equalsIgnoreCase(s)) + .findFirst() + .orElse(null); } @Override @@ -485,7 +485,7 @@ public class TeamCommand extends SWCommand { @Override public Collection tabCompletes(Chatter sender, PreviousArguments previousArguments, String s) { - return Event.getComing().stream().map(Event::getEventID).map(i -> i + "").toList(); + return Event.getComing().stream().map(Event::getEventName).map(e -> e.replace(" ", "")).toList(); } }; }