1.5.1 update

This commit is contained in:
NotAlexNoyle committed 2024-10-07 15:46:38 +00:00
1 parent 5d524a13da
commit ce16002d36
4 files changed
+11 -9

No files matched your search

+4
View File
@@ -1,3 +1,7 @@
**1.5.1:**
- Improve API documentation.
- Fix trueogMessage().
**1.5:**
- Create audience, global, and relative MiniPlaceholders in one new, simple API.
- Expand and format MiniPlaceholders within MiniPlaceholders.
+3 -3
View File
@@ -164,7 +164,7 @@ UtilitiesOG.trueogMessage(playerUUID, expandedMessage);
**[void] registerGlobalPlaceholder(String placeholderName, {String})**
Registers a global MiniPlaceholder that can be used anywhere in your messages. The valueSupplier provides the placeholder's value at runtime.
Registers a global MiniPlaceholder that can be used anywhere in your messages. The valueSupplier provides the placeholder's value at runtime. Prefixes are the values before the first underscore. For example, the prefix of server_name is server.
Kotlin:
```kotlin
@@ -178,7 +178,7 @@ UtilitiesOG.registerGlobalPlaceholder("server_name", () -> "&aTrue&cOG &eNetwork
**[void] registerAudiencePlaceholder(String name, player -> {String})**
Registers an audience-specific MiniPlaceholder. The valueFunction uses the player's context to generate a dynamic value for the placeholder.
Registers an audience-specific MiniPlaceholder. The valueFunction uses the player's context to generate a dynamic value for the placeholder. Prefixes are the values before the first underscore. For example, the prefix of player_display_name is player.
Kotlin:
```kotlin
@@ -202,7 +202,7 @@ UtilitiesOG.registerAudiencePlaceholder("player_display_name", player -> {
**[void] registerRelationalPlaceholder(String name, player, target -> {String})**
Registers a relational MiniPlaceholder that depends on two players (e.g., viewer and target). The valueFunction provides a dynamic value based on both players' contexts.
Registers a relational MiniPlaceholder that depends on two players (e.g., viewer and target). The valueFunction provides a dynamic value based on both players' contexts. Prefixes are the values before the first underscore. For example, the prefix of distance_between is distance.
Kotlin:
```kotlin
@@ -258,9 +258,7 @@ public final class UtilitiesOG extends JavaPlugin {
// Unified method for sending a message to a player with placeholders processed.
public static void trueogMessage(Player player, String message) {
TextComponent finalMessage = TextUtils.expandTextWithPlaceholders(message, player);
player.sendMessage(finalMessage);
TextUtils.trueogMessage(player, message);
}
@@ -270,7 +268,7 @@ public final class UtilitiesOG extends JavaPlugin {
Player player = Bukkit.getPlayer(playerUUID);
if (player != null) {
trueogMessage(player, message);
TextUtils.trueogMessage(player, message);
}
else {
@@ -21,9 +21,9 @@ public class TextUtils {
private static final Pattern MINIMESSAGE_TAG_PATTERN = Pattern.compile("<[^>]*>");
// Sends a formatted message to the player, expanding placeholders and color codes.
public static void utilitiesOGMessage(Player player, String message) {
public static void trueogMessage(Player player, String message) {
TextUtils.utilitiesOGMessage(player, message);
player.sendMessage(expandTextWithPlaceholders(message, player));
}