Skip to content

Commit

Permalink
Don't use default error message as it is English-only
Browse files Browse the repository at this point in the history
  • Loading branch information
esotericenderman committed Aug 3, 2024
1 parent 98ce3f8 commit 5b566de
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentException;
import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentInfo;
import dev.jorel.commandapi.arguments.CustomArgument.CustomArgumentInfoParser;
import dev.jorel.commandapi.arguments.CustomArgument.MessageBuilder;
import dev.jorel.commandapi.arguments.GreedyStringArgument;

import java.util.Set;
Expand Down Expand Up @@ -39,12 +38,7 @@ public String apply(CustomArgumentInfo<String> info) throws CustomArgumentExcept
Bukkit.getLogger().info(selectedLanguage);

if (!languages.contains(selectedLanguage)) {
Component errorMessage = languageManager.getMessage(Message.UNKNOWN_LANGUAGE, info.sender(), false, new Object[] {selectedLanguage});

if (errorMessage == null) {
throw CustomArgumentException.fromMessageBuilder(new MessageBuilder(null));
}

Component errorMessage = languageManager.getMessage(Message.UNKNOWN_LANGUAGE, info.sender(), true, new Object[] {selectedLanguage});
throw CustomArgumentException.fromAdventureComponent(errorMessage);
}

Expand Down

0 comments on commit 5b566de

Please sign in to comment.