Skip to content

Commit

Permalink
update locale message
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Sep 28, 2024
1 parent 4614b14 commit ae80e89
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public enum Messages {
crate_cannot_teleport(CrateKeys.crate_cannot_teleport),
crate_prize_max_pulls(CrateKeys.crate_prize_max_pulls),
crate_prize_max_respins(CrateKeys.crate_prize_max_respins),
crate_prize_max_respins_left(CrateKeys.crate_prize_max_respins_left),
crate_prize_max_respins_none(CrateKeys.crate_prize_max_respins_none),

gave_a_player_keys(CommandKeys.gave_a_player_keys),
cannot_give_player_keys(CommandKeys.cannot_give_player_keys),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ public CrateButton(final Crate crate, final Prize prize, final ConfigurationSect

this.userManager.removeRespinPrize(uuid, this.crate.getFileName()); // remove just in case

final int cap = PrizeManager.getCap(crate, player);

Messages.crate_prize_max_respins.sendMessage(player, new HashMap<>() {{
put("{respins_left}", "0");
put("{respins_total}", String.valueOf(PrizeManager.getCap(crate, player)));
put("{status}", cap >= 1 ? Messages.crate_prize_max_respins_left.getMessage(player, new HashMap<>() {{
put("{respins_total}", String.valueOf(cap));
put("{respins_left}", "0");
}}) : Messages.crate_prize_max_respins_none.getMessage(player));
}});

return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,17 @@ public void registerComments(CommentsConfiguration conf) {
})
public static final Property<String> crate_prize_max_pulls = newProperty("crates.pulls.max", "{prefix}<red>This prize can no longer be obtained, {pulls}/{maxpulls}");

@Comment("A list of available placeholders: {respins_left}, {respins_total}")
public static final Property<String> crate_prize_max_respins = newProperty("crates.respins.max", "{prefix}<red>You can no longer respin, {respins_left}/{respins_total}");
@Comment("A list of available placeholders: {status}")
public static final Property<String> crate_prize_max_respins = newProperty("crates.respins.max", "{prefix}<red>You can no longer respin, Status: {status}");

@Comment({
"If the player has any permission for respins, this format will show above in place of {status}",
"",
"A list of available placeholders: {respins_left}/{respins_total}"
})
public static final Property<String> crate_prize_max_respins_left = newProperty("crates.respins.format", "{respins_left}/{respins_total}");

@Comment("A blank string to configure for {status}")
public static final Property<String> crate_prize_max_respins_none = newProperty("crates.respins.none", "N/A");

}
17 changes: 12 additions & 5 deletions paper/src/main/resources/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,25 @@ crates:
per-crate: "<dark_gray>[<blue>{id}<dark_gray>]: <red>{crate_name}<dark_gray>, <red>{world}<dark_gray>, <red>{x}<dark_gray>, <red>{y}<dark_gray>, <red>{z}"
teleport:
# A list of available placeholders: {name}
success: '{prefix}<red>You have been teleported to the location with the name: <gold>{name}.'
success: "{prefix}<red>You have been teleported to the location with the name: <gold>{name}."
# A list of available placeholders: {id}
failed: '{prefix}<red>There is no location with the name: <gold>{id}.'
failed: "{prefix}<red>There is no location with the name: <gold>{id}."
pulls:
# This will add a notice to a prize, if the prize has reached max pulls.
# If this message is empty, it will not add the lore to prizes.
#
# A list of available placeholders: {maxpulls}, {pulls}
max: '{prefix}<red>This prize can no longer be obtained, {pulls}/{maxpulls}'
max: "{prefix}<red>This prize can no longer be obtained, {pulls}/{maxpulls}"
respins:
# A list of available placeholders: {respins_left}, {respins_total}
max: '{prefix}<red>You can no longer respin, {respins_left}/{respins_total}'
max: "{prefix}<red>You can no longer respin, {respins_left}/{respins_total}"
# If the player has any permission for respins, this format will show above in place of {status}
#
# A list of available placeholders: {respins_left}/{respins_total}
format: "{respins_left}/{respins_total}"
# A blank string to configure for {status}
none: "N/A"

# All messages related to commands.
command:
open:
Expand Down Expand Up @@ -198,7 +205,7 @@ command:
no-virtual-keys: "{prefix}<bold><dark_gray>(<dark_red>!<dark_gray>)</bold> <gray>The player {player} does not have any keys."
# A list of available placeholders: {player}, {crates_opened}
virtual-keys-header:
- "<bold><dark_gray>(<gold>!<dark_gray>)</bold> <gray>List of {player}''s current number of keys."
- "<bold><dark_gray>(<gold>!<dark_gray>)</bold> <gray>List of {player}""s current number of keys."
- " <yellow> -> Total Crates Opened: <red>{crates_opened}"
- ""
# A list of available placeholders: {crate}, {keys}, {crate_opened}
Expand Down

0 comments on commit ae80e89

Please sign in to comment.