From 04d9f38f7df3e7dc3c14fa4c8b1869fb75a6b3af Mon Sep 17 00:00:00 2001 From: TheBreadBeard Date: Thu, 29 Aug 2024 22:53:22 +0200 Subject: [PATCH 1/2] Add team changecolor command alias --- .../velocitycore/commands/TeamCommand.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java index 32b65e93..04225449 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java @@ -478,6 +478,21 @@ public class TeamCommand extends SWCommand { } @Register("color") + public void color(@Validator("isLeader") PlayerChatter sender) { + Team team = Team.get(sender.user().getTeam()); + + if(notDuringEvent(sender)) + return; + + SWListInv inv = new SWListInv<>(sender, new Message("TEAM_COLOR_TITLE"), COLOR_CODES.entrySet().stream().map(entry -> new SWListInv.SWListEntry<>(new SWItem(new Message("PLAIN_STRING", "§" + entry.getKey() + team.getTeamKuerzel()), entry.getValue()), entry.getKey())).toList(), (click, element) -> {}); + inv.setCallback((click, element) -> { + inv.close(); + team.setTeamColor(element); + }); + inv.open(); + } + + @Register("changecolor") public void changeColor(@Validator("isLeader") PlayerChatter sender) { Team team = Team.get(sender.user().getTeam()); From a64f6292e909b48bed65e4963fac08d88e687017 Mon Sep 17 00:00:00 2001 From: TheBreadBeard Date: Fri, 30 Aug 2024 11:00:56 +0200 Subject: [PATCH 2/2] Add team changecolor command alias --- .../velocitycore/commands/TeamCommand.java | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java index 04225449..928d6e78 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/TeamCommand.java @@ -478,20 +478,6 @@ public class TeamCommand extends SWCommand { } @Register("color") - public void color(@Validator("isLeader") PlayerChatter sender) { - Team team = Team.get(sender.user().getTeam()); - - if(notDuringEvent(sender)) - return; - - SWListInv inv = new SWListInv<>(sender, new Message("TEAM_COLOR_TITLE"), COLOR_CODES.entrySet().stream().map(entry -> new SWListInv.SWListEntry<>(new SWItem(new Message("PLAIN_STRING", "§" + entry.getKey() + team.getTeamKuerzel()), entry.getValue()), entry.getKey())).toList(), (click, element) -> {}); - inv.setCallback((click, element) -> { - inv.close(); - team.setTeamColor(element); - }); - inv.open(); - } - @Register("changecolor") public void changeColor(@Validator("isLeader") PlayerChatter sender) { Team team = Team.get(sender.user().getTeam());