From bf339a4b07b7d270f113741902c7b4677c4f3c4e Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 22 Nov 2021 17:09:33 +0100 Subject: [PATCH] e --- .../bedwars/managers/queue/QueueManager.java | 51 +++++++++---------- .../scoreboard/ScoreboardProvider.java | 12 ++--- 2 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java b/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java index a85f764..16fb9eb 100644 --- a/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java +++ b/src/main/java/rip/tilly/bedwars/managers/queue/QueueManager.java @@ -82,42 +82,37 @@ public class QueueManager { Player opponentPlayer = Bukkit.getPlayer(opponent); - List playersA = new ArrayList<>(); - List playersB = new ArrayList<>(); - - playersA.add(player.getUniqueId()); - playersB.add(opponent); - - GameTeam teamA = new GameTeam(player.getUniqueId(), playersA, 0, PlayerTeam.RED); - GameTeam teamB = new GameTeam(player.getUniqueId(), playersB, 1, PlayerTeam.LIME); + GameTeam teamA = new GameTeam(player.getUniqueId(), Collections.singletonList(player.getUniqueId()), 0, PlayerTeam.RED); + GameTeam teamB = new GameTeam(player.getUniqueId(), Collections.singletonList(opponentPlayer.getUniqueId()), 1, PlayerTeam.LIME); Arena arena = this.plugin.getArenaManager().getRandomArena(); - if (this.getQueueSizeByType(gameType) >= gameType.getQueueAmount()) { + player.sendMessage(" "); + player.sendMessage(CC.translate("&aGame found!")); + player.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + opponentPlayer.getName())); + player.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); + player.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); + player.sendMessage(" "); - player.sendMessage(" "); - player.sendMessage(CC.translate("&aGame found!")); - player.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + opponentPlayer.getName())); - player.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); - player.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); - player.sendMessage(" "); + opponentPlayer.sendMessage(" "); + opponentPlayer.sendMessage(CC.translate("&aGame found!")); + opponentPlayer.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + player.getName())); + opponentPlayer.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); + opponentPlayer.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); + opponentPlayer.sendMessage(" "); - opponentPlayer.sendMessage(" "); - opponentPlayer.sendMessage(CC.translate("&aGame found!")); - opponentPlayer.sendMessage(CC.translate("&7⚫ &fOpponent: &d" + player.getName())); - opponentPlayer.sendMessage(CC.translate("&7⚫ &fArena: &d" + arena.getName())); - opponentPlayer.sendMessage(CC.translate("&7⚫ &fGame: &d" + gameType.getName())); - opponentPlayer.sendMessage(" "); + Game game = new Game(arena, gameType, teamA, teamB); + this.plugin.getGameManager().createGame(game); - Game game = new Game(arena, gameType, teamA, teamB); - this.plugin.getGameManager().createGame(game); + this.queued.remove(player.getUniqueId()); + this.queued.remove(opponentPlayer.getUniqueId()); - this.queued.remove(player.getUniqueId()); - this.queued.remove(opponentPlayer.getUniqueId()); + this.queueTime.remove(player.getUniqueId()); + this.queueTime.remove(opponentPlayer.getUniqueId()); - this.queueTime.remove(player.getUniqueId()); - this.queueTime.remove(opponentPlayer.getUniqueId()); - } +// if (this.getQueueSizeByType(gameType) >= gameType.getQueueAmount()) { +// +// } } } diff --git a/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java b/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java index 98fe575..25afb5d 100644 --- a/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java +++ b/src/main/java/rip/tilly/bedwars/providers/scoreboard/ScoreboardProvider.java @@ -115,18 +115,18 @@ public class ScoreboardProvider implements AssembleAdapter { lines.add("&fDuration: &d" + game.getDuration()); lines.add(" "); if (yourTeam.isHasBed()) { - lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓ &7(You)"); + lines.add("&7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓ &7(You)"); } else if (yourTeam.getPlayingPlayers().size() > 0) { - lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size() + " &7(YOU)"); + lines.add("&7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size() + " &7(YOU)"); } else { - lines.add("&f7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗ &7(You)"); + lines.add("&7" + yourTeam.getPlayerTeam().getChatColor() + yourTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗ &7(You)"); } if (opposingTeam.isHasBed()) { - lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓"); + lines.add("&7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &a&l✓"); } else if (opposingTeam.getPlayingPlayers().size() > 0) { - lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size()); + lines.add("&7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &f" + yourTeam.getPlayingPlayers().size()); } else { - lines.add("&f7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗"); + lines.add("&7" + opposingTeam.getPlayerTeam().getChatColor() + opposingTeam.getPlayerTeam().getSmallName() + "&7] &c&l✗"); } lines.add(" "); lines.add("&fKills: &d" + playerData.getGameKills());