From 750cf0ee972a9049cc7ccadc0f0f36d8707d5d87 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Wed, 9 Mar 2022 20:56:01 +0100 Subject: [PATCH] Remove RankCommand.java --- src/de/steamwar/bungeecore/BungeeCore.java | 1 - .../bungeecore/commands/RankCommand.java | 68 ------------------- .../steamwar/messages/BungeeCore.properties | 14 ---- 3 files changed, 83 deletions(-) delete mode 100644 src/de/steamwar/bungeecore/commands/RankCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index d77ea58..b7338af 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -116,7 +116,6 @@ public class BungeeCore extends Plugin { new BugCommand(); new WhoisCommand(); new RegelnCommand(); - new RankCommand(); new IgnoreCommand(); new UnIgnoreCommand(); new PollresultCommand(); diff --git a/src/de/steamwar/bungeecore/commands/RankCommand.java b/src/de/steamwar/bungeecore/commands/RankCommand.java deleted file mode 100644 index 60d6a01..0000000 --- a/src/de/steamwar/bungeecore/commands/RankCommand.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - This file is a part of the SteamWar software. - - Copyright (C) 2020 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.bungeecore.commands; - -import de.steamwar.bungeecore.ArenaMode; -import de.steamwar.bungeecore.Message; -import de.steamwar.bungeecore.sql.Elo; -import de.steamwar.bungeecore.sql.Season; -import de.steamwar.bungeecore.sql.SteamwarUser; -import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.connection.ProxiedPlayer; - -import java.util.ArrayList; -import java.util.List; - -public class RankCommand extends BasicCommand { - public RankCommand() { - super("rank", null); - } - - @Override - public void execute(CommandSender sender, String[] args) { - if(!(sender instanceof ProxiedPlayer)) - return; - - ProxiedPlayer player = (ProxiedPlayer) sender; - Message.send("RANK_HEADER", player, Season.convertSeasonToString(Season.getSeason())); - SteamwarUser user = SteamwarUser.get(player.getUniqueId()); - for(ArenaMode mode : ArenaMode.getAllModes()){ - if(!mode.isRanked()) - continue; - int elo = Elo.getElo(user.getId(), mode.getSchemType()); - int placement = Elo.getPlacement(elo, mode.getSchemType()); - - if(placement == -1) - Message.send("RANK_UNPLACED", player, mode.getChatName()); - else - Message.send("RANK_PLACED", player, mode.getChatName(), placement, elo); - } - } - - @Override - public Iterable onTabComplete(CommandSender commandSender, String[] args) { - if(args.length > 1) - return new ArrayList<>(); - - List result = ArenaMode.getAllRankedChatNames(); - result.removeIf(name -> !name.startsWith(args[0])); - return result; - } -} diff --git a/src/de/steamwar/messages/BungeeCore.properties b/src/de/steamwar/messages/BungeeCore.properties index 3db3d41..c872b85 100644 --- a/src/de/steamwar/messages/BungeeCore.properties +++ b/src/de/steamwar/messages/BungeeCore.properties @@ -301,20 +301,6 @@ POLL_NO_ANSWER=§cDas ist keine Antwortmöglichkeit! POLL_ANSWER_REFRESH=§aDeine Antwort wurde aktualisiert. POLL_ANSWER_NEW=§aDeine Antwort wurde registriert. -#RankCommand -RANK_HEADER=§7§lPlatzierungen {0} -RANK_UNPLACED=§7{0}§8: §eunplatziert -RANK_PLACED=§7{0}§8: §e{1}§8. §7mit §e{2} §7Elo§8. - -#RankedCommand -RANKED_NO_RANKED_MODE=§cDieser Spielmodus ist nicht für Ranglistenspiele freigeschalten. -RANKED_QUEUE_JOINED=§aRanglistenspiel-Warteschlange betreten. -RANKED_QUEUE_HOW_TO_LEAVE=§7Wiederhole den Befehl zum Verlassen der Warteschlange. -RANKED_QUEUE_LEFT=§cRanglistenspiel-Warteschlange verlassen. -RANKED_ENEMY_SPOTTED=§eGegner gefunden! Ranglistenspiel startet. -RANKED_BROADCAST=§7{0}§8-§7Ranglistenspiel§8: §e{1} vs {2} -RANKED_BROADCAST_HOVER=§aZuschauen - #RCommand R_USAGE=§8/§7r §8[§eAntwort§8] R_NOTHING=§cDu hast bisher mit niemandem geschrieben!