NamePlaceholder.java 1001 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package de.Linus122.TimeIsMoney;
  2. import org.bukkit.OfflinePlayer;
  3. import me.clip.placeholderapi.expansion.PlaceholderExpansion;
  4. public class NamePlaceholder extends PlaceholderExpansion {
  5. Main timeIsMoney;
  6. public NamePlaceholder(Main plugin) {
  7. this.timeIsMoney = plugin;
  8. }
  9. // This tells PlaceholderAPI to not unregister your expansion on reloads since it is provided by the dependency
  10. // Introduced in PlaceholderAPI 2.8.5
  11. @Override
  12. public boolean persist() {
  13. return true;
  14. }
  15. // Our placeholders will be %tim <params>%
  16. @Override
  17. public String getIdentifier() {
  18. return "tim";
  19. }
  20. // the author
  21. @Override
  22. public String getAuthor() {
  23. return "Linus122";
  24. }
  25. // This is the version
  26. @Override
  27. public String getVersion() {
  28. return timeIsMoney.getDescription().getVersion();
  29. }
  30. @Override
  31. public String onRequest(OfflinePlayer player, String label) {
  32. switch(label) {
  33. case "atm":
  34. return Main.economy.format(ATM.getBankBalance(player, null));
  35. }
  36. return null;
  37. }
  38. }