Skip to content

Commit

Permalink
Add MVdWPlaceholders
Browse files Browse the repository at this point in the history
  • Loading branch information
Elikill58 committed Jun 15, 2024
1 parent bed3a87 commit 1107b7f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
<id>PaperMC</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>mvdw-software</id>
<url>http://repo.mvdw-software.be/content/groups/public/</url>
</repository>
</repositories>


Expand Down Expand Up @@ -176,6 +180,12 @@
<version>2.11.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>be.maximvdw</groupId>
<artifactId>MVdWPlaceholderAPI</artifactId>
<version>3.1.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/me/dadus33/chatitem/ChatItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import me.dadus33.chatitem.hook.ChatManagerSupport;
import me.dadus33.chatitem.hook.ecoenchants.EcoEnchantsSupport;
import me.dadus33.chatitem.hook.placeholders.IPlaceholders;
import me.dadus33.chatitem.hook.placeholders.MVdWPlaceholderAPIHook;
import me.dadus33.chatitem.hook.placeholders.PlaceholderAPIHook;
import me.dadus33.chatitem.invsee.InvShower;
import me.dadus33.chatitem.itemnamer.NamerManager;
Expand Down Expand Up @@ -206,6 +207,10 @@ public void onEnable() {
plugins.add("PlaceholderAPI");
PLACEHOLDERS.add(new PlaceholderAPIHook());
}
if (pm.isPluginEnabled("MVdWPlaceholderAPI")) {
plugins.add("MVdWPlaceholderAPI");
PLACEHOLDERS.add(new MVdWPlaceholderAPIHook());
}

if (plugins.length() > 0)
getLogger().info("Load " + plugins.toString() + " support.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package me.dadus33.chatitem.hook.placeholders;

import org.bukkit.entity.Player;

import be.maximvdw.placeholderapi.PlaceholderAPI;

public class MVdWPlaceholderAPIHook implements IPlaceholders {

@Override
public String replace(Player p, String text) {
return PlaceholderAPI.replacePlaceholders(p, text);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ChatItem
main: me.dadus33.chatitem.ChatItem
version: ${project.version}

softdepend: [ViaVersion, ProtocolSupport, ProtocolLib, LangUtils, HexNicks, EcoEnchants, DiscordSRV, ChatControl, ChatManager, PlaceholderAPI]
softdepend: [ViaVersion, ProtocolSupport, ProtocolLib, LangUtils, HexNicks, EcoEnchants, DiscordSRV, ChatControl, ChatManager, PlaceholderAPI, MVdWPlaceholderAPI]
authors: [dadus33, WOLFI3654, Elikill58]
api-version: 1.13
folia-supported: true
Expand Down

0 comments on commit 1107b7f

Please sign in to comment.