Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies {
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("com.arcaniax:HeadDatabase-API:1.3.2")
compileOnly("com.github.cryptomorin:XSeries:13.3.3")
compileOnly("io.github.miniplaceholders:miniplaceholders-api:2.3.0")
compileOnly("io.github.miniplaceholders:miniplaceholders-api:3.1.0")
compileOnly("com.github.koca2000:NoteBlockAPI:1.6.2")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ public static Component setPlaceholders(String rawText, Player player) {
.replace("<world>", player.getWorld().getName())
.replace("<location>", formatLocation(player.getLocation()));

if (papi) return TextUtil.parse(text, papiTag(player));
if (miniplaceholders) return TextUtil.parse(text, MiniPlaceholders.getAudienceGlobalPlaceholders(player));
return TextUtil.parse(
text,
player,
(papi) ? papiTag(player) : TagResolver.empty(),
(miniplaceholders) ? MiniPlaceholders.audienceGlobalPlaceholders() : TagResolver.empty()
);
}

return TextUtil.parse(text);
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/me/zetastormy/akropolis/util/text/TextUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package me.zetastormy.akropolis.util.text;

import net.kyori.adventure.pointer.Pointered;
import org.bukkit.Color;

import net.kyori.adventure.text.Component;
Expand All @@ -41,6 +42,10 @@ public static Component parse(String message, TagResolver resolver) {
return MINI_MESSAGE.deserialize(message, resolver);
}

public static Component parse(String message, Pointered target, TagResolver... resolver) {
return MINI_MESSAGE.deserialize(message, target, resolver);
}

public static String raw(Component message) {
return MINI_MESSAGE.serialize(message).replaceAll("\\\\<", "<");
}
Expand Down