Skip to content

Commit

Permalink
Write Length, not Limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
NamiUni committed Sep 18, 2023
1 parent 654964d commit 963276b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ private void applyNickname(final Commander sender, final CarbonPlayer target, fi

// If the nickname is caught in the character limit, return without setting a nickname.
final int nickNameLength = PlainTextComponentSerializer.plainText().serialize(parsedNick.get()).length();
final int minLimit = this.config.primaryConfig().nicknameMinLimit();
final int maxLimit = this.config.primaryConfig().nicknameMaxLimit();
if (nickNameLength < minLimit || maxLimit < nickNameLength) {
this.carbonMessages.nicknameErrorCharacterLimit(sender, parsedNick.get(), minLimit, maxLimit);
final int minLength = this.config.primaryConfig().nicknameMinLength();
final int maxLength = this.config.primaryConfig().nicknameMaxLength();
if (nickNameLength < minLength || maxLength < nickNameLength) {
this.carbonMessages.nicknameErrorCharacterLimit(sender, parsedNick.get(), minLength, maxLength);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ public class PrimaryConfig {
private boolean useCarbonNicknames = true;

@Comment("Minimum number of characters in nickname.")
private int nicknameMinLimit = 3;
private int nicknameMinLength = 3;

@Comment("Maximum number of characters in nickname.")
private int nicknameMaxLimit = 16;
private int nicknameMaxLength = 16;

@Comment("Whether Carbon should check for updates using the GitHub API on startup.")
private boolean updateChecker = true;
Expand Down Expand Up @@ -182,12 +182,12 @@ public boolean useCarbonNicknames() {
return this.useCarbonNicknames;
}

public int nicknameMinLimit() {
return this.nicknameMinLimit;
public int nicknameMinLength() {
return this.nicknameMinLength;
}

public int nicknameMaxLimit() {
return this.nicknameMaxLimit;
public int nicknameMaxLength() {
return this.nicknameMaxLength;
}

public boolean updateChecker() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ void whisperTargetNotSet(
void nicknameErrorCharacterLimit(
final Audience audience,
final Component nickname,
@Placeholder("min_limit") final int minLimit,
@Placeholder("max_limit") final int maxLimit
final int minLength,
final int maxLength
);

@Message("nickname.show.others")
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/locale/messages-en_US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ nickname.show.others.unset=<target><red> does not have a nickname set
nickname.show.others=<target><green>'s nickname is </green><nickname>
nickname.show.unset=<red>You do not have a nickname set
nickname.show=<green>Your nickname is </green><nickname>
nickname.error.character_limit=<red>Nickname "<nickname>" has exceeded the character limit. Must be set to <min_limit>~<max_limit> characters.
nickname.error.character_limit=<red>Nickname "<nickname>" has exceeded the character limit. Must be set to <min_length>~<max_length> characters.
reply.target.missing=<red>You have no-one to reply to
reply.target.self=<red>You cannot whisper to yourself
whisper.console=<gold>[<green><sender_display_name></green>] -> [<green><recipient_display_name></green>] <message>
Expand Down

0 comments on commit 963276b

Please sign in to comment.