Advertisement
Guest User

Untitled

a guest
Aug 8th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. private String TABLIST_FILE = "TabList.castlegod";
  2. private String FILE_PLUGIN = "plugins/" + main.getName() + "/";
  3.  
  4. public String getHeaderMessage(Player p) {
  5. String s = "";
  6. Properties prop = new Properties();
  7. InputStream input = null;
  8. try {
  9. input = new FileInputStream(FILE_PLUGIN + TABLIST_FILE);
  10. prop.load(input);
  11. s = prop.getProperty("Header").replace("&", "§").replace("%player%", p.getName())
  12. .replace("%prefix%", Main.getPlugin(Main.class).getPrefix(p).replace("&", "§"))
  13. .replace("%suffix%", Main.getPlugin(Main.class).getSuffix(p).replace("&", "§"));
  14. } catch (IOException e) {
  15. e.printStackTrace();
  16. } finally {
  17. if (input != null) {
  18. try {
  19. input.close();
  20. } catch (IOException e) {
  21. e.printStackTrace();
  22. }
  23. }
  24. }
  25. return s;
  26. }
  27.  
  28. public String getFooterMessage(Player p) {
  29. String s = "";
  30. Properties prop = new Properties();
  31. InputStream input = null;
  32. try {
  33. input = new FileInputStream(FILE_PLUGIN + TABLIST_FILE);
  34. prop.load(input);
  35. s = prop.getProperty("Footer").replace("&", "§").replace("%player%", p.getName())
  36. .replace("%prefix%", Main.getPlugin(Main.class).getPrefix(p).replace("&", "§"))
  37. .replace("%suffix%", Main.getPlugin(Main.class).getSuffix(p).replace("&", "§"));
  38. } catch (IOException e) {
  39. e.printStackTrace();
  40. } finally {
  41. if (input != null) {
  42. try {
  43. input.close();
  44. } catch (IOException e) {
  45. e.printStackTrace();
  46. }
  47. }
  48. }
  49. return s;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement