Skip to content

Commit

Permalink
add non player placeholder support for all messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ProdPreva1l committed Jul 25, 2024
1 parent 83d12ad commit bd6287f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Bukkit/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
repositories {
maven { url "https://repo.auxilor.io/repository/maven-public/" }
maven { url 'https://repo.auxilor.io/repository/maven-public/' }
maven { url 'https://oss.sonatype.org/content/groups/public/' }
maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
maven { url 'https://jitpack.io' }
maven { url 'https://repo.codemc.io/repository/maven-snapshots/' }
maven { url "https://repo.clojars.org/" }
maven { url 'https://repo.clojars.org/' }
maven { url 'https://repo.william278.net/snapshots' }
maven { url 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
}

dependencies {
implementation project(":API")
compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'

// Support mini message format
implementation "net.kyori:adventure-text-minimessage:4.17.0"
implementation "net.kyori:adventure-api:4.17.0"
implementation "net.kyori:adventure-platform-bukkit:4.3.3"
compileOnly 'net.kyori:adventure-text-minimessage:4.17.0'
compileOnly 'net.kyori:adventure-api:4.17.0'
compileOnly 'net.kyori:adventure-platform-bukkit:4.3.3'

implementation "com.github.puregero:multilib:1.2.3" // Folia & ShreddedPaper Support

Expand All @@ -25,6 +26,8 @@ dependencies {
compileOnly 'redis.clients:jedis:5.1.0'
compileOnly 'org.apache.commons:commons-pool2:2.12.0'

compileOnly 'me.clip:placeholderapi:2.11.6' // Placeholder support

// Database
implementation 'com.zaxxer:HikariCP:5.1.0'
compileOnly 'org.xerial:sqlite-jdbc:3.45.2.0'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package info.preva1l.fadah.utils;

import lombok.experimental.UtilityClass;
import me.clip.placeholderapi.PlaceholderAPI;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -84,6 +86,9 @@ public String miniMessageToLegacy(String message) {
*/
public String colorize(String text) {
text = miniMessageToLegacy(text);
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
text = PlaceholderAPI.setPlaceholders(null, text);
}
Matcher matcher = HEX_PATTERN.matcher(text);
StringBuilder buffer = new StringBuilder();

Expand Down
5 changes: 4 additions & 1 deletion Bukkit/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ website: https://discord.gg/4KcF7S94HF
version: '${version}'

depend: [Vault]
softdepend: [EcoItems, zAuctionHouseV3, AuctionHouse]
softdepend: [PlaceholderAPI, EcoItems, zAuctionHouseV3, AuctionHouse]

folia-supported: true

Expand All @@ -18,6 +18,9 @@ libraries:
- org.xerial:sqlite-jdbc:3.45.2.0
- com.mysql:mysql-connector-j:8.3.0
- org.mariadb.jdbc:mariadb-java-client:3.3.3
- net.kyori:adventure-text-minimessage:4.17.0
- 'net.kyori:adventure-api:4.17.0'
- 'net.kyori:adventure-platform-bukkit:4.3.3'

permissions:
fadah.max-listings.<amount>:
Expand Down

0 comments on commit bd6287f

Please sign in to comment.