forked from EssentialsX/Essentials
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lets start the papi expansion update
This will supports the dev. version of PlaceholderAPI, not tested
- Loading branch information
1 parent
eace433
commit 2147c27
Showing
3 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/com/gamingmesh/jobs/Placeholders/NewPlaceholderAPIHook.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.gamingmesh.jobs.Placeholders; | ||
|
||
import org.bukkit.OfflinePlayer; | ||
|
||
import com.gamingmesh.jobs.Jobs; | ||
import com.gamingmesh.jobs.Placeholders.Placeholder.JobsPlaceHolders; | ||
|
||
import me.clip.placeholderapi.expansion.PlaceholderExpansion; | ||
|
||
public class NewPlaceholderAPIHook extends PlaceholderExpansion { | ||
|
||
private Jobs plugin; | ||
|
||
public NewPlaceholderAPIHook(Jobs plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@Override | ||
public String onRequest(OfflinePlayer player, String identifier) { | ||
JobsPlaceHolders placeHolder = JobsPlaceHolders.getByName(identifier); | ||
if (placeHolder == null) | ||
return null; | ||
|
||
return plugin.getPlaceholderAPIManager().getValue(player, placeHolder, "%" + Placeholder.pref + "_" + identifier + "%"); | ||
} | ||
|
||
@Override | ||
public String getAuthor() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getIdentifier() { | ||
return Placeholder.pref; | ||
} | ||
|
||
@Override | ||
public String getVersion() { | ||
return plugin.getDescription().getVersion(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters