Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. package com.bizarrealex.azazel.tab;
  2.  
  3. import net.veilmc.hcf.HCF;
  4. import net.veilmc.hcf.faction.type.Faction;
  5. import net.veilmc.hcf.faction.type.PlayerFaction;
  6. import org.bukkit.entity.Player;
  7.  
  8. public class TabExecutor implements TabAdapter {
  9. public TabTemplate getTemplate(Player player) {
  10. TabTemplate template = new TabTemplate();
  11. PlayerFaction playerFaction = HCF.getPlugin().getFactionManager().getPlayerFaction(player);
  12. Faction faction = HCF.getPlugin().getFactionManager().getPlayerFaction(player);
  13. double rotation = (player.getLocation().getYaw() - 90) % 360;
  14. String out;
  15. if (rotation < 0) {
  16. rotation += 360.0;
  17. }
  18. if (0 <= rotation && rotation < 22.5) {
  19. out = "N";
  20. } else if (22.5 <= rotation && rotation < 67.5) {
  21. out = "NE";
  22. } else if (67.5 <= rotation && rotation < 112.5) {
  23. out = "E";
  24. } else if (112.5 <= rotation && rotation < 157.5) {
  25. out = "SE";
  26. } else if (157.5 <= rotation && rotation < 202.5) {
  27. out = "S";
  28. } else if (202.5 <= rotation && rotation < 247.5) {
  29. out = "SW";
  30. } else if (247.5 <= rotation && rotation < 292.5) {
  31. out = "W";
  32. } else if (292.5 <= rotation && rotation < 337.5) {
  33. out = "NW";
  34. } else if (337.5 <= rotation && rotation < 360.0) {
  35. out = "N";
  36. } else {
  37. out = null;
  38. }
  39.  
  40. // Left
  41. template.left(0, "§6Home");
  42. /*if (playerFaction.getHome() == null || HCF.getInstance().getFactionManager().getPlayerFaction(player) == null){
  43. template.left(1, "§cNot Set");
  44. } else {
  45. template.left(1, "§7" + playerFaction.getHome().getBlockX() + "§7, " + playerFaction.getHome().getBlockZ());
  46. }
  47. template.left(3, "§6Faction Info");
  48. template.left(4, "§7DTR: " + playerFaction.getDtrColour() + JavaUtil.format(playerFaction.getDeathsUntilRaidable()));
  49. template.left(5, "§7Online: " + playerFaction.getOnlineMembers().size() + "§7/" + playerFaction.getMembers().size());
  50. template.left(6, " ");
  51. template.left(7, "§6Player Info");
  52. template.left(8, "§7Kills: &a" + player.getStatistic(Statistic.PLAYER_KILLS));
  53. template.left(9, "§7Deaths: §c" + player.getStatistic(Statistic.DEATHS));
  54. template.left(11, "§6Your Location");
  55. if (HCF.getInstance().getFactionManager().getFactionAt(player.getLocation()) != null) {
  56. template.left(12, ChatColor.translateAlternateColorCodes('&', HCF.getInstance().getFactionManager().getFactionAt(player.getLocation()).getName()));
  57. }
  58. template.left(13, "§7(" + player.getLocation().getBlockX() + ", " + player.getLocation().getBlockZ() + ")" + " [" + out + "]");
  59.  
  60. // Middle
  61. template.middle(0, "&f&lMine&6Honey.net");
  62. if (HCF.getInstance().getFactionManager().getPlayerFaction(player) != null){
  63. if (playerFaction.getLeader().getName() == null) {
  64. template.middle(2, "&cYou are not in a faction");
  65. } else {
  66.  
  67. }
  68. }
  69. template.middle(2, "Leader: " + playerFaction.getLeader().getName());
  70.  
  71. template.middle(3, "");*/
  72.  
  73.  
  74. return template;
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement