From a2169ec3e181b613d107b9d249cae4d4c469d763 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Mon, 28 Dec 2020 19:16:51 +0100 Subject: [PATCH] Fixing --- src/de/steamwar/bungeecore/commands/EventCommand.java | 4 ++-- src/de/steamwar/bungeecore/commands/TeamCommand.java | 9 +++++---- src/de/steamwar/bungeecore/inventory/SWListInv.java | 4 ---- src/de/steamwar/bungeecore/sql/Team.java | 1 + 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/de/steamwar/bungeecore/commands/EventCommand.java b/src/de/steamwar/bungeecore/commands/EventCommand.java index 4a93cc1..6e4b8e5 100644 --- a/src/de/steamwar/bungeecore/commands/EventCommand.java +++ b/src/de/steamwar/bungeecore/commands/EventCommand.java @@ -91,9 +91,9 @@ public class EventCommand extends BasicCommand { e.getEventName()); Set teams = TeamTeilnahme.getTeams(e.getEventID()); if(!teams.isEmpty()){ - StringBuilder tline = new StringBuilder("§7 Mit§8: §e"); + StringBuilder tline = new StringBuilder("§7 Mit§8: "); for(Team t : teams){ - tline.append(t.getTeamKuerzel()).append(" "); + tline.append("§").append(t.getTeamColor()).append(t.getTeamKuerzel()).append(" "); } BungeeCore.send(player, tline.toString()); } diff --git a/src/de/steamwar/bungeecore/commands/TeamCommand.java b/src/de/steamwar/bungeecore/commands/TeamCommand.java index f1e2fda..9b25543 100644 --- a/src/de/steamwar/bungeecore/commands/TeamCommand.java +++ b/src/de/steamwar/bungeecore/commands/TeamCommand.java @@ -402,7 +402,7 @@ public class TeamCommand extends BasicCommand { return; } - BungeeCore.send(player, "§7Team §e" + team.getTeamName() + " §8[§e" + team.getTeamKuerzel() + "§8]"); + BungeeCore.send(player, "§7Team §e" + team.getTeamName() + " §8[§" + team.getTeamColor() + team.getTeamKuerzel() + "§8]"); BungeeCore.send(player, "§7Leader§8: " + SteamwarUser.get(team.getTeamLeader()).getUserName()); if(team.getMembers().size() > 1) { @@ -454,7 +454,7 @@ public class TeamCommand extends BasicCommand { for(int i = (page-1) * TEAMS_PER_PAGE; i < (page-1) * TEAMS_PER_PAGE + TEAMS_PER_PAGE && i < all.size(); i++){ Team tm = all.get(i); BungeeCore.send(player, - "§8" + tm.getTeamKuerzel() + " §e" + tm.getTeamName() + " §8[§7" + SteamwarUser.get(tm.getTeamLeader()).getUserName() + "§8]", + "§" + tm.getTeamColor() + tm.getTeamKuerzel() + " §e" + tm.getTeamName() + " §8[§7" + SteamwarUser.get(tm.getTeamLeader()).getUserName() + "§8]", "§7Teaminfo", new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/team info " + tm.getTeamKuerzel())); } @@ -531,8 +531,9 @@ public class TeamCommand extends BasicCommand { List> colors = new ArrayList<>(); COLOR_CODES.forEach(stringSWListEntry -> colors.add(new SWListInv.SWListEntry<>(stringSWListEntry.getItem().setName(stringSWListEntry.getItem().getTitle() + Team.get(user.getTeam()).getTeamKuerzel()), stringSWListEntry.getObject()))); - SWListInv inv = new SWListInv<>(player, "§6Farbe wählen", colors, (click, element) -> { - SWListInv.closeInventory(player); + SWListInv inv = new SWListInv<>(player, "§6Farbe wählen", colors, (click, element) -> {}); + inv.setCallback((click, element) -> { + inv.close(); team.setTeamColor(element); }); inv.open(); diff --git a/src/de/steamwar/bungeecore/inventory/SWListInv.java b/src/de/steamwar/bungeecore/inventory/SWListInv.java index e10925c..d12c432 100644 --- a/src/de/steamwar/bungeecore/inventory/SWListInv.java +++ b/src/de/steamwar/bungeecore/inventory/SWListInv.java @@ -144,8 +144,4 @@ public class SWListInv extends SWInventory { return object; } } - - public static void closeInventory(ProxiedPlayer player) { - new CloseInventoryPacket(SteamwarUser.get(player).getId()).send(player); - } } diff --git a/src/de/steamwar/bungeecore/sql/Team.java b/src/de/steamwar/bungeecore/sql/Team.java index 2e7ba35..8ca7124 100644 --- a/src/de/steamwar/bungeecore/sql/Team.java +++ b/src/de/steamwar/bungeecore/sql/Team.java @@ -150,6 +150,7 @@ public class Team { public void setTeamColor(String teamColor) { this.teamColor = teamColor; + updateDB(); } public int size(){