1919
2020package me .zetastormy .akropolis .util ;
2121
22+ import org .bukkit .Bukkit ;
23+ import org .bukkit .ChatColor ;
24+ import org .bukkit .Location ;
25+ import org .bukkit .entity .Player ;
26+
2227import io .github .miniplaceholders .api .MiniPlaceholders ;
2328import me .clip .placeholderapi .PlaceholderAPI ;
29+ import me .zetastormy .akropolis .AkropolisPlugin ;
2430import net .kyori .adventure .text .Component ;
2531import net .kyori .adventure .text .minimessage .tag .Tag ;
2632import net .kyori .adventure .text .minimessage .tag .resolver .TagResolver ;
2733import net .kyori .adventure .text .serializer .legacy .LegacyComponentSerializer ;
28- import org .bukkit .Bukkit ;
29- import org .bukkit .ChatColor ;
30- import org .bukkit .Location ;
31- import org .bukkit .entity .Player ;
3234
3335public class PlaceholderUtil {
3436 private static boolean papi = false ;
@@ -66,6 +68,13 @@ public static Component setPlaceholders(String rawText, Player player) {
6668 text = TextUtil .parseAndReplace (TextUtil .raw (text ), "world" , Component .text (player .getWorld ().getName ()));
6769 }
6870
71+ if (rawText .contains ("<current_song>" )) {
72+ text = TextUtil .parseAndReplace (
73+ TextUtil .raw (text ),
74+ "current_song" ,
75+ Component .text (AkropolisPlugin .getInstance ().getSongPlayerManager ().getCurrentSong ()));
76+ }
77+
6978 if (papi && player != null ) {
7079 text = TextUtil .parse (TextUtil .raw (text ), papiTag (player ));
7180 }
@@ -97,4 +106,4 @@ public static void setPapiState(boolean papiState) {
97106 public static void setMPState (boolean miniplaceholdersState ) {
98107 miniplaceholders = miniplaceholdersState ;
99108 }
100- }
109+ }
0 commit comments