Fixed typo

This commit is contained in:
AlexDev_ 2024-12-03 22:19:38 +01:00
parent 7b8d55ba77
commit a55bd56364
6 changed files with 15 additions and 14 deletions

View File

@ -97,7 +97,7 @@ groups:
sorting_placeholders: sorting_placeholders:
- '%role_weight%' - '%role_weight%'
- '%username_lower%' - '%username_lower%'
placeholder_replaments: placeholder_replacements:
'%current_date_weekday_en-US%': '%current_date_weekday_en-US%':
- placeholder: Monday - placeholder: Monday
replacement: <red>Monday</red> replacement: <red>Monday</red>
@ -132,5 +132,5 @@ You can use various placeholders that will be replaced with values (for example,
### Server Links ### Server Links
For Minecraft 1.21+ clients, Velocitab supports specifying a list of URLs that will be sent to display in the player pause menu. See [[Server Links]] for more information. For Minecraft 1.21+ clients, Velocitab supports specifying a list of URLs that will be sent to display in the player pause menu. See [[Server Links]] for more information.
### Placeholder Replaments ### Placeholder Replacements
Velocitab supports replacing values of placeholders with other values. See [[Placeholders Replaments]] for more information. Velocitab supports replacing values of placeholders with other values. See [[Placeholders Replacements]] for more information.

View File

@ -4,7 +4,7 @@ Velocitab supports placeholder replacements, which allow you to replace a placeh
## Configuring ## Configuring
Placeholder replacements are configured in the `placeholder_replaments` section of the every Tab Group. Placeholder replacements are configured in the `placeholder_replacements` section of the every Tab Group.
You can specify a list of replacements for a placeholder, and the replacements will be applied in the order they are listed. You can specify a list of replacements for a placeholder, and the replacements will be applied in the order they are listed.
The replacements are specified as a list of objects with two properties: `placeholder` and `replacement`. The replacements are specified as a list of objects with two properties: `placeholder` and `replacement`.
@ -12,7 +12,7 @@ The replacements are specified as a list of objects with two properties: `placeh
### Example section ### Example section
```yaml ```yaml
placeholder_replaments: placeholder_replacements:
'%current_date_weekday_en-US%': '%current_date_weekday_en-US%':
- placeholder: Monday - placeholder: Monday
replacement: <red>Monday</red> replacement: <red>Monday</red>
@ -44,7 +44,7 @@ This placeholder returns a boolean value, so you can use it to show a player's v
For example, if you wanted to show a player's vanish status as a color, you could use the following replacements: For example, if you wanted to show a player's vanish status as a color, you could use the following replacements:
```yaml ```yaml
placeholder_replaments: placeholder_replacements:
'%advancedvanish_is_vanished%': '%advancedvanish_is_vanished%':
- placeholder: Yes - placeholder: Yes
replacement: <red>Vanished</red> replacement: <red>Vanished</red>
@ -58,7 +58,7 @@ This placeholder will be replaced with the replacement text of the first replace
For example, if you wanted to show the current date as a color, you could use the following replacements: For example, if you wanted to show the current date as a color, you could use the following replacements:
```yaml ```yaml
placeholder_replaments: placeholder_replacements:
'%current_date_weekday_en-US%': '%current_date_weekday_en-US%':
- placeholder: Monday - placeholder: Monday
replacement: <red>Monday</red> replacement: <red>Monday</red>
@ -72,7 +72,7 @@ placeholder_replaments:
If you have a group with multiple servers, and you have a placeholder that is not present in one of the servers, you can use the `%<placeholder>%` as a placeholder it will handle the case where the placeholder is not present in the server. If you have a group with multiple servers, and you have a placeholder that is not present in one of the servers, you can use the `%<placeholder>%` as a placeholder it will handle the case where the placeholder is not present in the server.
```yaml ```yaml
placeholder_replaments: placeholder_replacements:
'%huskhomes_homes_count%': '%huskhomes_homes_count%':
- placeholder: '%huskhomes_homes_count%' - placeholder: '%huskhomes_homes_count%'
replacement: <red>No homes in this server</red> replacement: <red>No homes in this server</red>
@ -81,7 +81,7 @@ placeholder_replaments:
If you want you can also set the replacement as an empty string, which will be replaced with the empty string. If you want you can also set the replacement as an empty string, which will be replaced with the empty string.
```yaml ```yaml
placeholder_replaments: placeholder_replacements:
'%huskhomes_homes_count%': '%huskhomes_homes_count%':
- placeholder: '%huskhomes_homes_count%' - placeholder: '%huskhomes_homes_count%'
replacement: '' replacement: ''

View File

@ -11,6 +11,7 @@
* ✍️ [[Placeholders]] * ✍️ [[Placeholders]]
* 🔗 [[Relational Placeholders]] * 🔗 [[Relational Placeholders]]
* 🔀 [[Conditional Placeholders]] * 🔀 [[Conditional Placeholders]]
* 📝 [[Placeholders Replacements]]
* ✨ [[Animations]] * ✨ [[Animations]]
* 🖼️ [[Custom Logos]] * 🖼️ [[Custom Logos]]
* 🔗 [[Server Links]] * 🔗 [[Server Links]]

View File

@ -47,7 +47,7 @@ public record Group(
Nametag nametag, Nametag nametag,
Set<String> servers, Set<String> servers,
List<String> sortingPlaceholders, List<String> sortingPlaceholders,
Map<String, List<PlaceholderReplacement>> placeholderReplaments, Map<String, List<PlaceholderReplacement>> placeholderReplacements,
boolean collisions, boolean collisions,
int headerFooterUpdateRate, int headerFooterUpdateRate,
int placeholderUpdateRate, int placeholderUpdateRate,

View File

@ -252,7 +252,7 @@ public enum Placeholder {
@NotNull @NotNull
private static String applyPlaceholderReplacements(@NotNull String text, @NotNull TabPlayer player, private static String applyPlaceholderReplacements(@NotNull String text, @NotNull TabPlayer player,
@NotNull Map<String, String> parsed) { @NotNull Map<String, String> parsed) {
for (final Map.Entry<String, List<PlaceholderReplacement>> entry : player.getGroup().placeholderReplaments().entrySet()) { for (final Map.Entry<String, List<PlaceholderReplacement>> entry : player.getGroup().placeholderReplacements().entrySet()) {
if (!parsed.containsKey(entry.getKey())) { if (!parsed.containsKey(entry.getKey())) {
continue; continue;
} }

View File

@ -148,8 +148,8 @@ public class TabGroups implements ConfigValidator {
missingKeys.put(group, "sortingPlaceholders"); missingKeys.put(group, "sortingPlaceholders");
} }
if (group.placeholderReplaments() == null) { if (group.placeholderReplacements() == null) {
missingKeys.put(group, "placeholderReplaments"); missingKeys.put(group, "placeholderReplacements");
} }
} }
@ -171,7 +171,7 @@ public class TabGroups implements ConfigValidator {
group.nametag() == null ? DEFAULT_GROUP.nametag() : group.nametag(), group.nametag() == null ? DEFAULT_GROUP.nametag() : group.nametag(),
group.servers() == null ? DEFAULT_GROUP.servers() : group.servers(), group.servers() == null ? DEFAULT_GROUP.servers() : group.servers(),
group.sortingPlaceholders() == null ? DEFAULT_GROUP.sortingPlaceholders() : group.sortingPlaceholders(), group.sortingPlaceholders() == null ? DEFAULT_GROUP.sortingPlaceholders() : group.sortingPlaceholders(),
group.placeholderReplaments() == null ? DEFAULT_GROUP.placeholderReplaments() : group.placeholderReplaments(), group.placeholderReplacements() == null ? DEFAULT_GROUP.placeholderReplacements() : group.placeholderReplacements(),
group.collisions(), group.collisions(),
group.headerFooterUpdateRate(), group.headerFooterUpdateRate(),
group.placeholderUpdateRate(), group.placeholderUpdateRate(),