Guest User

Untitled

a guest
Jun 22nd, 2020
41
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class ScoreAPI {
  2.  
  3. public static Scoreboard sb;
  4. public static Team Admin;
  5. public static Team Dev;
  6. public static Team Mod;
  7. public static Team Sup;
  8. public static Team Builder;
  9. public static Team YouTuber;
  10. public static Team Streamer;
  11. public static Team vip;
  12. public static Team Spieler;
  13.  
  14.  
  15. public static boolean isPlayerInGroup(Player player, String group) {
  16. return player.hasPermission("group." + group);
  17. }
  18.  
  19. @SuppressWarnings("deprecation")
  20. public static void setScoreboard(Player p) {
  21. sb = Bukkit.getScoreboardManager().getNewScoreboard();
  22. Objective score = sb.getObjective("teams");
  23. if(score == null) {
  24. score = sb.registerNewObjective("teams", "dummy");
  25. }
  26. score.setDisplayName("§cCavePvP §8• §eLobby");
  27. score.setDisplaySlot(DisplaySlot.SIDEBAR);
  28. score.getScore("§8").setScore(11);
  29. score.getScore("§8● §7Dein Profil").setScore(10);
  30. score.getScore("§8» §a"+p.getName()).setScore(9);
  31. score.getScore("§a ").setScore(8);
  32. score.getScore("§8● §7Rank").setScore(7);
  33.  
  34. if (p.hasPermission("rank.admin")) {
  35. score.getScore("§8» §4Admin").setScore(6);
  36. } else if (p.hasPermission("rank.dev")) {
  37. score.getScore("§8» §bDeveloper").setScore(6);
  38. }else if (p.hasPermission("rank.mod")) {
  39. score.getScore("§8» §cModerator").setScore(6);
  40. }else if (p.hasPermission("rank.Sup")) {
  41. score.getScore("§8» §aSupporter").setScore(6);
  42. }else if (p.hasPermission("rank.builder")) {
  43. score.getScore("§8» §2Builder").setScore(6);
  44. }else if (p.hasPermission("rank.yt")) {
  45. score.getScore("§8» §5Youtube+").setScore(6);
  46. }else if (p.hasPermission("rank.jryt")) {
  47. score.getScore("§8» §5Youtube").setScore(6);
  48. }else if (p.hasPermission("rank.vip")) {
  49. score.getScore("§8» §6VIP").setScore(6);
  50. }else {
  51. score.getScore("§8» §eCaver").setScore(6);
  52. }
  53.  
  54. score.getScore("§b ").setScore(5);
  55. score.getScore("§8● §7Forum").setScore(4);
  56. score.getScore("§8» §aCavepvp.eu").setScore(3);
  57. score.getScore("§c ").setScore(2);
  58. score.getScore("§8● §7TeamSpeak").setScore(1);
  59. score.getScore("§8» §ats.Cavepvp.EU").setScore(0);
  60.  
  61. Admin = sb.registerNewTeam("0001Admin");
  62. Admin.setPrefix("§4Admin §8• §4");
  63. Admin.setCanSeeFriendlyInvisibles(false);
  64. Admin.setAllowFriendlyFire(true);
  65.  
  66. Dev = sb.registerNewTeam("0002Dev");
  67. Dev.setPrefix("§bDev §8• §b");
  68. Dev.setCanSeeFriendlyInvisibles(false);
  69. Dev.setAllowFriendlyFire(true);
  70.  
  71. Mod = sb.registerNewTeam("0005Mod");
  72. Mod.setPrefix("§cMod §8• §c");
  73. Mod.setCanSeeFriendlyInvisibles(false);
  74. Mod.setAllowFriendlyFire(true);
  75.  
  76. Sup = sb.registerNewTeam("0006Sup");
  77. Sup.setPrefix("§aSup §8• §a");
  78. Sup.setCanSeeFriendlyInvisibles(false);
  79. Sup.setAllowFriendlyFire(true);
  80.  
  81. Builder = sb.registerNewTeam("0007Builder");
  82. Builder.setPrefix("§2Builder §8• §2");
  83. Builder.setCanSeeFriendlyInvisibles(false);
  84. Builder.setAllowFriendlyFire(true);
  85.  
  86. YouTuber = sb.registerNewTeam("0008YouTuber");
  87. YouTuber.setPrefix("§5YT+ §8• §5");
  88. YouTuber.setCanSeeFriendlyInvisibles(false);
  89. YouTuber.setAllowFriendlyFire(true);
  90.  
  91. Streamer = sb.registerNewTeam("0009Streamer");
  92. Streamer.setPrefix("§5YT §8• §5");
  93. Streamer.setCanSeeFriendlyInvisibles(false);
  94. Streamer.setAllowFriendlyFire(true);
  95.  
  96. vip = sb.registerNewTeam("0010VIP");
  97. vip.setPrefix("§6VIP §8• §6");
  98. vip.setCanSeeFriendlyInvisibles(false);
  99. vip.setAllowFriendlyFire(true);
  100.  
  101. Spieler = sb.registerNewTeam("0012Spieler");
  102. Spieler.setPrefix("§eCaver §8• §e");
  103. Spieler.setCanSeeFriendlyInvisibles(false);
  104. Spieler.setAllowFriendlyFire(true);
  105.  
  106. for(Player player : Bukkit.getOnlinePlayers()) {
  107. if(player.hasPermission("rank.admin")) {
  108. Admin.addPlayer(player);
  109. player.setDisplayName(Admin.getDisplayName());
  110. } else if(player.hasPermission("rank.dev")) {
  111. Dev.addPlayer(player);
  112. player.setDisplayName(Dev.getDisplayName());
  113. } else if(player.hasPermission("rank.mod")) {
  114. Mod.addPlayer(player);
  115. player.setDisplayName(Mod.getDisplayName());
  116. } else if(player.hasPermission("rank.sup")) {
  117. Sup.addPlayer(player);
  118. player.setDisplayName(Sup.getDisplayName());
  119. } else if(player.hasPermission("rank.builder")) {
  120. Builder.addPlayer(player);
  121. player.setDisplayName(Builder.getDisplayName());
  122. } else if(player.hasPermission("rank.yt")) {
  123. YouTuber.addPlayer(player);
  124. player.setDisplayName(YouTuber.getDisplayName());
  125. } else if(player.hasPermission("rank.jryt")) {
  126. Streamer.addPlayer(player);
  127. player.setDisplayName(Streamer.getDisplayName());
  128. } else if(player.hasPermission("rank.vip")) {
  129. vip.addPlayer(player);
  130. player.setDisplayName(vip.getDisplayName());
  131. } else {
  132. Spieler.addPlayer(player);
  133. player.setDisplayName(Spieler.getDisplayName());
  134. }
  135. }
  136.  
  137. p.setScoreboard(sb);
  138. }
  139. }
RAW Paste Data