Skip to content

Commit

Permalink
Add support for MVdWPlaceholderAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
heroslender committed Mar 25, 2019
1 parent 282d5b9 commit 4815cd7
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.heroslender</groupId>
<artifactId>HeroBolsa</artifactId>
<version>1.1.0</version>
<version>1.2.0</version>
<packaging>jar</packaging>

<name>HeroBolsa</name>
Expand Down Expand Up @@ -55,6 +55,11 @@
<id>heroslender-repo</id>
<url>https://nexus.heroslender.com/repository/maven-releases/</url>
</repository>
<repository>
<id>mvdw-software</id>
<name>MVdW Public Repositories</name>
<url>http://repo.mvdw-software.be/content/groups/public/</url>
</repository>
</repositories>

<dependencies>
Expand Down Expand Up @@ -87,5 +92,16 @@
<version>2.9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>be.maximvdw</groupId>
<artifactId>MVdWPlaceholderAPI</artifactId>
<version>2.1.1-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
4 changes: 4 additions & 0 deletions src/main/java/com/heroslender/herobolsa/HeroBolsa.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.heroslender.herobolsa;

import com.heroslender.herobolsa.command.BolsaCommand;
import com.heroslender.herobolsa.placeholders.MVdWPlaceholderApiHook;
import com.heroslender.herobolsa.placeholders.PlaceholderApiHook;
import com.heroslender.herovender.data.SellBonus;
import com.heroslender.herovender.event.PlayerSellEvent;
Expand Down Expand Up @@ -46,6 +47,9 @@ private void onPlayerSell(final PlayerSellEvent e) {
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")){
new PlaceholderApiHook().hook();
}
if (Bukkit.getPluginManager().isPluginEnabled("MVdWPlaceholderAPI")){
new MVdWPlaceholderApiHook().hook();
}

new Metrics(this);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.heroslender.herobolsa.placeholders;

import be.maximvdw.placeholderapi.PlaceholderAPI;
import com.heroslender.herobolsa.HeroBolsa;

public class MVdWPlaceholderApiHook {

public void hook() {
PlaceholderAPI.registerPlaceholder(HeroBolsa.getInstance(), "bolsa",
placeholderReplaceEvent -> Integer.toString(HeroBolsa.getInstance().getValue())
);
}
}

0 comments on commit 4815cd7

Please sign in to comment.