diff --git a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java index 7a847ddd7..0f87d5e4c 100755 --- a/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java +++ b/AnarchyExploitFixesFolia/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java @@ -2,8 +2,7 @@ import me.moomoo.anarchyexploitfixes.AnarchyExploitFixes; -import java.util.ArrayList; -import java.util.List; +import java.util.Set; public interface AnarchyExploitFixesCommand { @@ -12,15 +11,15 @@ public interface AnarchyExploitFixesCommand { static void registerCommands() { try { CommandManager commandManager = new CommandManager(); - - List allCommands = new ArrayList<>(4); - allCommands.add(new AEFCommand()); - allCommands.add(new HelpCommand()); - allCommands.add(new SayCommand()); - allCommands.add(new ToggleConnectionMsgsCommand()); - - allCommands.forEach(toParse -> { - if (toParse.shouldRegister()) commandManager.parser().parse(toParse); + Set.of( + new AEFCommand(), + new HelpCommand(), + new SayCommand(), + new ToggleConnectionMsgsCommand() + ).forEach(toParse -> { + if (toParse.shouldRegister()) { + commandManager.parser().parse(toParse); + } }); } catch (Exception e) { AnarchyExploitFixes.getLog().severe("Failed to create command manager! - " + e.getLocalizedMessage()); diff --git a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java index 7a847ddd7..51d06d6a5 100755 --- a/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java +++ b/AnarchyExploitFixesLegacy/src/main/java/me/moomoo/anarchyexploitfixes/commands/AnarchyExploitFixesCommand.java @@ -2,8 +2,7 @@ import me.moomoo.anarchyexploitfixes.AnarchyExploitFixes; -import java.util.ArrayList; -import java.util.List; +import java.util.Arrays; public interface AnarchyExploitFixesCommand { @@ -12,15 +11,15 @@ public interface AnarchyExploitFixesCommand { static void registerCommands() { try { CommandManager commandManager = new CommandManager(); - - List allCommands = new ArrayList<>(4); - allCommands.add(new AEFCommand()); - allCommands.add(new HelpCommand()); - allCommands.add(new SayCommand()); - allCommands.add(new ToggleConnectionMsgsCommand()); - - allCommands.forEach(toParse -> { - if (toParse.shouldRegister()) commandManager.parser().parse(toParse); + Arrays.asList( + new AEFCommand(), + new HelpCommand(), + new SayCommand(), + new ToggleConnectionMsgsCommand() + ).forEach(toParse -> { + if (toParse.shouldRegister()) { + commandManager.parser().parse(toParse); + } }); } catch (Exception e) { AnarchyExploitFixes.getLog().severe("Failed to create command manager! - " + e.getLocalizedMessage());