From feb7939ee74763723347a70417171e91e63efa5c Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 23 Nov 2019 22:08:04 +0100 Subject: [PATCH] code cleanup --- .../commands/LockschemCommand.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java b/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java index ed08e02..99fa2e3 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/commands/LockschemCommand.java @@ -14,9 +14,8 @@ import org.bukkit.entity.Player; public class LockschemCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { - if(!(sender instanceof Player)) { + if(!(sender instanceof Player)) return false; - } Player player = (Player) sender; SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId()); @@ -29,19 +28,20 @@ public class LockschemCommand implements CommandExecutor { return false; - 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!"); + if(args.length != 1) { + sendHelp(player); return false; } - sendHelp(player); + + 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; }