diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java index 03cf556..2f6a0fd 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/commands/common/subcommands/InviteSubCommand.java @@ -46,14 +46,7 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, } String type = args[0]; Main skyblock = Main.getPlugin(Main.class); - if (type.equalsIgnoreCase("add")) { - if (args.length < 2) { - LanguageToml.sendMessage(player, LanguageToml.messageInviteAddCommandNotEnoughArgs); - return true; - } - String playerOrOwner = args[1]; - invitePlayer(skyblock, player, playerOrOwner); - } else if (type.equalsIgnoreCase("accept")) { + if (type.equalsIgnoreCase("accept")) { if (args.length < 2) { LanguageToml.sendMessage(player, LanguageToml.messageInviteAcceptCommandNotEnoughArgs); return true; @@ -74,6 +67,8 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, } String playerOrOwner = args[1]; deleteInvitePlayer(skyblock, player, playerOrOwner); + } else { + invitePlayer(skyblock, player, args[0]); } return true; } @@ -81,7 +76,7 @@ public boolean onCommand(@NotNull Plugin plugin, @NotNull CommandSender sender, @Override public @NotNull List onTabComplete(@NotNull Plugin plugin, @NotNull CommandSender sender, @NotNull String[] args) { if (args.length == 1) { - List possible = List.of("accept", "decline", "add", "delete"); + List possible = List.of("accept", "decline", "delete"); String partial = args[0].trim().toLowerCase(); return possible.stream() .filter(cmd -> cmd.toLowerCase().startsWith(partial)) diff --git a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java index 24a0493..18519bf 100644 --- a/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java +++ b/plugin/src/main/java/fr/euphyllia/skyllia/configuration/LanguageToml.java @@ -64,7 +64,7 @@ public class LanguageToml { public static String messageInviteAcceptCommandNotEnoughArgs = "You must specify which island you want to join: /skyllia invite accept "; public static String messageInviteRemoveCommandNotEnoughArgs = "The command is incomplete: /skyllia invite remove "; public static String messageInviteDeclineCommandNotEnoughArgs = "You must specify which island you want to decline: /skyllia invite decline "; - public static String messageInviteAddCommandNotEnoughArgs = "You must specify which island you want to decline: /skyllia invite add "; + public static String messageInviteAddCommandNotEnoughArgs = "You must specify which island you want to decline: /skyllia invite "; public static String messageInvitePlayerInvited = "The player %s has been invited. Awaiting a response..."; public static String messageInviteDeletePlayerInvited = "You have deleted %s's invitation."; public static String messageInvitePlayerNotification = "The player %player_invite% has invited you to their island. To accept: /skyllia invite accept %player_invite%. To decline: /skyllia invite decline %player_invite%";