Guest User

Untitled

a guest
Jul 14th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. package me.Champanye.Stats;
  2.  
  3. import java.util.UUID;
  4. import org.bukkit.configuration.file.FileConfiguration;
  5. import org.bukkit.entity.Player;
  6.  
  7. import me.clip.placeholderapi.expansion.PlaceholderExpansion;
  8.  
  9. class Holder extends PlaceholderExpansion {
  10. private Main plugin;
  11.  
  12. public Holder(Main plugin)
  13. {
  14. this.plugin = plugin;
  15. }
  16. public boolean persist() {
  17. return true;
  18. }
  19. public boolean canRegister() {
  20. return true;
  21. }
  22. public String getAuthor(){
  23. return plugin.getDescription().getAuthors().toString();
  24. }
  25. public String getIdentifier(){
  26. return "main";
  27. }
  28. public String getVersion(){
  29. return plugin.getDescription().getVersion();
  30. }
  31.  
  32. public String onPlaceholderRequest(Player p, String identifier)
  33. {
  34. if (identifier.equals("deaths")) {
  35. return Integer.toString(this.plugin.getConfig().getInt(p.getUniqueId().toString() + ".deaths"));
  36. }
  37. if (identifier.equals("kills")) {
  38. return Integer.toString(this.plugin.getConfig().getInt(p.getUniqueId().toString() + ".kills"));
  39. }
  40. return null;
  41. }
  42. }
Add Comment
Please, Sign In to add comment