From 529f8ecc8f70d6c16dc740ec2bf323aa6b60b550 Mon Sep 17 00:00:00 2001 From: Sefiraat Date: Sat, 18 Jun 2022 21:47:15 +0100 Subject: [PATCH] Feedback --- .../commands/NetheoCommands.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/main/java/dev/sefiraat/netheopoiesis/implementation/commands/NetheoCommands.java b/src/main/java/dev/sefiraat/netheopoiesis/implementation/commands/NetheoCommands.java index ca1e5bf..4ce9017 100644 --- a/src/main/java/dev/sefiraat/netheopoiesis/implementation/commands/NetheoCommands.java +++ b/src/main/java/dev/sefiraat/netheopoiesis/implementation/commands/NetheoCommands.java @@ -21,29 +21,26 @@ public class NetheoCommands extends BaseCommand { @Default public void onDefault(CommandSender sender) { - if (sender instanceof Player) { - sender.sendMessage(Theme.ERROR + "Please provide a valid subcommand."); - } + sender.sendMessage(Theme.ERROR + "Please provide a valid subcommand."); } @Subcommand("MobCaps") @Description("Displays information about the various MobCaps") @CommandPermission("netheopoiesis.admin.mobcaps") public void viewMobCaps(CommandSender sender) { - final String[] messages = new String[MobCapType.values().length]; + final MobCapType[] mobCapTypes = MobCapType.values(); + final String[] messages = new String[mobCapTypes.length]; - for (int i = 0; i < MobCapType.values().length; i++) { - final MobCapType type = MobCapType.values()[i]; + for (int i = 0; i < mobCapTypes.length; i++) { + final MobCapType type = mobCapTypes[i]; final MobCap mobCap = MobManager.getInstance().getMobCap(type); messages[i] = TextUtils.toTitleCase(type.name()) + ": " + mobCap.count() + "/" + mobCap.getMaxAmount(); } - if (sender instanceof Player player) { - for (String message : messages) { + for (String message : messages) { + if (sender instanceof Player player) { player.sendMessage(Theme.CLICK_INFO.apply(message)); - } - } else { - for (String message : messages) { + } else { Netheopoiesis.logInfo(message); } }