From 3b28fc6798f9f696041c37c7dc12b784d567efb8 Mon Sep 17 00:00:00 2001 From: Eva <66324759+saxnbt@users.noreply.github.com> Date: Wed, 23 Mar 2022 19:23:35 +0000 Subject: [PATCH] maximum cope, fixed arguments --- .../commands/Command_myadmin.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_myadmin.java b/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_myadmin.java index 4d9890c..951aea8 100644 --- a/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_myadmin.java +++ b/src/main/java/me/StevenLawson/TotalFreedomMod/commands/Command_myadmin.java @@ -15,7 +15,19 @@ public class Command_myadmin extends FreedomCommand { @Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { final UUID uuid = sender_p.getUniqueId(); // Get the sender's uuid as a variable. - if (args.length >= 2) { + if(args.length == 1) { + if ("clearloginmsg".equalsIgnoreCase(args[0])) { + playerMsg(ChatColor.GRAY + "Cleared your custom login message."); // Notify player that the login message has been set. + + AdminList.getEntry(uuid).setCustomLoginMessage(""); // Set the custom login message to the value. + AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration. + + AdminList.updateIndexLists(); // Update and refresh configuration. + return true; + } else { + return false; + } + } else if (args.length >= 2) { if ("setlogin".equalsIgnoreCase(args[0])) { final String inputMessage = StringUtils.join(args, " ", 1, args.length); // Parse the input provided. @@ -26,15 +38,7 @@ public class Command_myadmin extends FreedomCommand { AdminList.updateIndexLists(); // Update and refresh configuration. return true; - } else if ("clearloginmsg".equalsIgnoreCase(args[0])) { - playerMsg(ChatColor.GRAY + "Cleared your custom login message."); // Notify player that the login message has been set. - - AdminList.getEntry(uuid).setCustomLoginMessage(""); // Set the custom login message to the value. - AdminList.save(AdminList.getEntry(uuid)); // Save the modified value to the super admin configuration. - - AdminList.updateIndexLists(); // Update and refresh configuration. - return true; - } else { + } else { return false; } } else {