From c6459884a04485f9c23800a956e53a97802f80c6 Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 23 Nov 2019 20:50:21 +0100 Subject: [PATCH] code cleanup; bugfix --- .../commands/LockschemCommand.java | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java b/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java index b63b6d2..a28d0c9 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java @@ -27,18 +27,24 @@ public class LockschemCommand implements CommandExecutor { userGroup != UserGroup.Supporter) return false; - switch (args.length) { - case 1: - String teamName = args[1]; - FightTeam fightTeam = Fight.getTeamByName(teamName); - if(fightTeam == null) { - player.sendMessage(FightSystem.PREFIX + "§cDieses Team existiert nicht!"); - return false; - } - fightTeam.getSchematic().setSchemType(SchematicType.Normal); - player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + "§cgepserrt!"); + if(args.length == 1) { + String teamName = args[0]; + FightTeam fightTeam = Fight.getTeamByName(teamName); + + if(fightTeam == null) { + player.sendMessage(FightSystem.PREFIX + "§cDieses Team existiert nicht!"); + return false; + } + fightTeam.getSchematic().setSchemType(SchematicType.Normal); + player.sendMessage(FightSystem.PREFIX + "Schematic von " + fightTeam.getColoredName() + " §cgesperrt!"); + return false; } + sendHelp(player); return false; } + + private void sendHelp(Player player) { + player.sendMessage(FightSystem.PREFIX + "/lockschem [TEAM]"); + } }