From a55bd5636413ce585c5c3407ec21c670b34652d2 Mon Sep 17 00:00:00 2001
From: AlexDev_ <56083016+alexdev03@users.noreply.github.com>
Date: Tue, 3 Dec 2024 22:19:38 +0100
Subject: [PATCH] Fixed typo
---
docs/Config-File.md | 6 +++---
...rs-Replaments.md => Placeholders-Replacements.md} | 12 ++++++------
docs/_Sidebar.md | 1 +
.../java/net/william278/velocitab/config/Group.java | 2 +-
.../net/william278/velocitab/config/Placeholder.java | 2 +-
.../net/william278/velocitab/config/TabGroups.java | 6 +++---
6 files changed, 15 insertions(+), 14 deletions(-)
rename docs/{Placeholders-Replaments.md => Placeholders-Replacements.md} (94%)
diff --git a/docs/Config-File.md b/docs/Config-File.md
index 737ea34..22798b7 100644
--- a/docs/Config-File.md
+++ b/docs/Config-File.md
@@ -97,7 +97,7 @@ groups:
sorting_placeholders:
- '%role_weight%'
- '%username_lower%'
- placeholder_replaments:
+ placeholder_replacements:
'%current_date_weekday_en-US%':
- placeholder: Monday
replacement: Monday
@@ -132,5 +132,5 @@ You can use various placeholders that will be replaced with values (for example,
### 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.
-### Placeholder Replaments
-Velocitab supports replacing values of placeholders with other values. See [[Placeholders Replaments]] for more information.
\ No newline at end of file
+### Placeholder Replacements
+Velocitab supports replacing values of placeholders with other values. See [[Placeholders Replacements]] for more information.
\ No newline at end of file
diff --git a/docs/Placeholders-Replaments.md b/docs/Placeholders-Replacements.md
similarity index 94%
rename from docs/Placeholders-Replaments.md
rename to docs/Placeholders-Replacements.md
index f1e0bd5..21bc395 100644
--- a/docs/Placeholders-Replaments.md
+++ b/docs/Placeholders-Replacements.md
@@ -4,7 +4,7 @@ Velocitab supports placeholder replacements, which allow you to replace a placeh
## 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.
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
```yaml
-placeholder_replaments:
+placeholder_replacements:
'%current_date_weekday_en-US%':
- placeholder: Monday
replacement: Monday
@@ -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:
```yaml
-placeholder_replaments:
+placeholder_replacements:
'%advancedvanish_is_vanished%':
- placeholder: Yes
replacement: Vanished
@@ -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:
```yaml
-placeholder_replaments:
+placeholder_replacements:
'%current_date_weekday_en-US%':
- placeholder: Monday
replacement: Monday
@@ -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 `%%` as a placeholder it will handle the case where the placeholder is not present in the server.
```yaml
-placeholder_replaments:
+placeholder_replacements:
'%huskhomes_homes_count%':
- placeholder: '%huskhomes_homes_count%'
replacement: No homes in this server
@@ -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.
```yaml
-placeholder_replaments:
+placeholder_replacements:
'%huskhomes_homes_count%':
- placeholder: '%huskhomes_homes_count%'
replacement: ''
diff --git a/docs/_Sidebar.md b/docs/_Sidebar.md
index 5fa6af1..14751fa 100644
--- a/docs/_Sidebar.md
+++ b/docs/_Sidebar.md
@@ -11,6 +11,7 @@
* ✍️ [[Placeholders]]
* 🔗 [[Relational Placeholders]]
* 🔀 [[Conditional Placeholders]]
+* 📝 [[Placeholders Replacements]]
* ✨ [[Animations]]
* 🖼️ [[Custom Logos]]
* 🔗 [[Server Links]]
diff --git a/src/main/java/net/william278/velocitab/config/Group.java b/src/main/java/net/william278/velocitab/config/Group.java
index 439b575..f38dfcb 100644
--- a/src/main/java/net/william278/velocitab/config/Group.java
+++ b/src/main/java/net/william278/velocitab/config/Group.java
@@ -47,7 +47,7 @@ public record Group(
Nametag nametag,
Set servers,
List sortingPlaceholders,
- Map> placeholderReplaments,
+ Map> placeholderReplacements,
boolean collisions,
int headerFooterUpdateRate,
int placeholderUpdateRate,
diff --git a/src/main/java/net/william278/velocitab/config/Placeholder.java b/src/main/java/net/william278/velocitab/config/Placeholder.java
index 598f2d2..e53fca2 100644
--- a/src/main/java/net/william278/velocitab/config/Placeholder.java
+++ b/src/main/java/net/william278/velocitab/config/Placeholder.java
@@ -252,7 +252,7 @@ public enum Placeholder {
@NotNull
private static String applyPlaceholderReplacements(@NotNull String text, @NotNull TabPlayer player,
@NotNull Map parsed) {
- for (final Map.Entry> entry : player.getGroup().placeholderReplaments().entrySet()) {
+ for (final Map.Entry> entry : player.getGroup().placeholderReplacements().entrySet()) {
if (!parsed.containsKey(entry.getKey())) {
continue;
}
diff --git a/src/main/java/net/william278/velocitab/config/TabGroups.java b/src/main/java/net/william278/velocitab/config/TabGroups.java
index a7adf99..92fefb3 100644
--- a/src/main/java/net/william278/velocitab/config/TabGroups.java
+++ b/src/main/java/net/william278/velocitab/config/TabGroups.java
@@ -148,8 +148,8 @@ public class TabGroups implements ConfigValidator {
missingKeys.put(group, "sortingPlaceholders");
}
- if (group.placeholderReplaments() == null) {
- missingKeys.put(group, "placeholderReplaments");
+ if (group.placeholderReplacements() == null) {
+ missingKeys.put(group, "placeholderReplacements");
}
}
@@ -171,7 +171,7 @@ public class TabGroups implements ConfigValidator {
group.nametag() == null ? DEFAULT_GROUP.nametag() : group.nametag(),
group.servers() == null ? DEFAULT_GROUP.servers() : group.servers(),
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.headerFooterUpdateRate(),
group.placeholderUpdateRate(),