diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java index 0e66d6d..ff07546 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.java @@ -138,6 +138,7 @@ public class FightSystem extends JavaPlugin { new KitCommand(); new RemoveCommand(); new RequestsCommand(); + new InfoCommand(); new WGCommand(); new TBCommand(); new GamemodeCommand(); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties index a6ab2ab..c60b91b 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties +++ b/FightSystem_Core/src/de/steamwar/fightsystem/FightSystem.properties @@ -47,6 +47,10 @@ REMOVE_HELP=§8/§eremove §8[§eplayer§8] NOT_FIGHTLEADER=§cYou are not the fight leader WIN_HELP=§8/§7win §8[§eteam §8or §etie§8] +INFO_RANKED=§7Ranked§8: §e{0} +INFO_LEADER=§7Leader {0}§8: {1} +INFO_SCHEMATIC=§7Schematic {0}§8: §e{1} §7from {2}, Rank: {3} + # GUI STATE_TITLE=Fight state diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/commands/InfoCommand.java b/FightSystem_Core/src/de/steamwar/fightsystem/commands/InfoCommand.java new file mode 100644 index 0000000..abc1c2a --- /dev/null +++ b/FightSystem_Core/src/de/steamwar/fightsystem/commands/InfoCommand.java @@ -0,0 +1,63 @@ +/* + * This file is a part of the SteamWar software. + * + * Copyright (C) 2023 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.fightsystem.commands; + +import de.steamwar.fightsystem.ArenaMode; +import de.steamwar.fightsystem.FightSystem; +import de.steamwar.fightsystem.fight.Fight; +import de.steamwar.fightsystem.fight.FightTeam; +import de.steamwar.fightsystem.states.FightState; +import de.steamwar.fightsystem.states.StateDependentCommand; +import de.steamwar.fightsystem.utils.FightStatistics; +import de.steamwar.sql.SchematicNode; +import de.steamwar.sql.SteamwarUser; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public class InfoCommand implements CommandExecutor { + + public InfoCommand() { + new StateDependentCommand(ArenaMode.All, FightState.All, "info", this); + } + + @Override + public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { + if(!(sender instanceof Player)) + return false; + + Player player = (Player) sender; + if(!SteamwarUser.get(player.getUniqueId()).getUserGroup().isTeamGroup()) + return false; + + FightSystem.getMessage().send("INFO_RANKED", player, !FightStatistics.isUnranked()); + for(FightTeam team : Fight.teams()) { + if(!team.isLeaderless()) + FightSystem.getMessage().send("INFO_LEADER", player, team.getColoredName(), team.getLeader().getPlayer().getName()); + + if(team.getSchematic() != 0) { + SchematicNode schematic = SchematicNode.getSchematicNode(team.getSchematic()); + FightSystem.getMessage().send("INFO_SCHEMATIC", player, team.getColoredName(), schematic.getName(), SteamwarUser.get(schematic.getOwner()).getUserName(), schematic.getRank()); + } + } + return false; + } +} diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java b/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java index 7816d08..e98b936 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/utils/FightStatistics.java @@ -53,6 +53,10 @@ public class FightStatistics { FightUI.addSubtitle("UI_UNRANKED"); } + public static boolean isUnranked() { + return unranked; + } + private Timestamp starttime = Timestamp.from(Instant.now()); public FightStatistics() { diff --git a/FightSystem_Core/src/plugin.yml b/FightSystem_Core/src/plugin.yml index abc32f9..0283fbb 100644 --- a/FightSystem_Core/src/plugin.yml +++ b/FightSystem_Core/src/plugin.yml @@ -14,6 +14,7 @@ commands: ak: request: requests: + info: leave: ready: kit: