SHARE
TWEET

Untitled

a guest Dec 5th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package de.Tommunity.utils;
  2.  
  3. import java.util.HashMap;
  4. import java.util.UUID;
  5.  
  6. import org.bukkit.Bukkit;
  7. import org.bukkit.entity.Player;
  8.  
  9. import ru.tehkode.permissions.bukkit.PermissionsEx;
  10.  
  11. public class ScoreboardManager {
  12.  
  13.     public static HashMap<UUID, Scoreboard> scoreboardhashmap = new HashMap<>();
  14.    
  15.     public static void checkTablistPrefix(Player a, org.bukkit.scoreboard.Scoreboard sb) {
  16.         if(PermissionsEx.getUser(a.getName()).inGroup("Owner")) {
  17.             sb.getTeam("001Owner").addEntry(a.getName());
  18.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Admin")) {
  19.             sb.getTeam("002Admin").addEntry(a.getName());
  20.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Developer")) {
  21.             sb.getTeam("003Dev").addEntry(a.getName());
  22.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Moderator")) {
  23.             sb.getTeam("004Mod").addEntry(a.getName());
  24.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Supporter")) {
  25.             sb.getTeam("005Sup").addEntry(a.getName());
  26.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Builder")) {
  27.             sb.getTeam("006Builder").addEntry(a.getName());
  28.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Youtuber")) {
  29.             sb.getTeam("007YT").addEntry(a.getName());
  30.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Hero")) {
  31.             sb.getTeam("008Hero").addEntry(a.getName());
  32.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Master")) {
  33.             sb.getTeam("009Master").addEntry(a.getName());
  34.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Business")) {
  35.             sb.getTeam("010Business").addEntry(a.getName());
  36.         }else if(PermissionsEx.getUser(a.getName()).inGroup("Spieler")) {
  37.             sb.getTeam("011Spieler").addEntry(a.getName());
  38.         }
  39.     }
  40.    
  41.  
  42.     public static void sendTabAndScoreboard(Player p) {
  43.        
  44.         new de.Tommunity.utils.Scoreboard(p).sendToPlayer(p);
  45.    
  46.         if(PermissionsEx.getUser(p).inGroup("Owner")) {
  47.             for(Player a : Bukkit.getOnlinePlayers()) {
  48.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("001Owner").addEntry(p.getName());
  49.             }
  50.        
  51.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Admin")) {
  52.             for(Player a : Bukkit.getOnlinePlayers()) {
  53.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("002Admin").addEntry(p.getName());
  54.             }
  55.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Developer")) {
  56.             for(Player a : Bukkit.getOnlinePlayers()) {
  57.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("003Developer").addEntry(p.getName());
  58.             }
  59.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Moderator")) {
  60.             for(Player a : Bukkit.getOnlinePlayers()) {
  61.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("004Moderator").addEntry(p.getName());
  62.             }
  63.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Supporter")) {
  64.             for(Player a : Bukkit.getOnlinePlayers()) {
  65.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("005Supporter").addEntry(p.getName());
  66.             }
  67.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Builder")) {
  68.             for(Player a : Bukkit.getOnlinePlayers()) {
  69.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("006Builder").addEntry(p.getName());
  70.             }
  71.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Youtuber")) {
  72.             for(Player a : Bukkit.getOnlinePlayers()) {
  73.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("007YT").addEntry(p.getName());
  74.             }
  75.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Hero")) {
  76.             for(Player a : Bukkit.getOnlinePlayers()) {
  77.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("008Hero").addEntry(p.getName());
  78.             }
  79.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Master")) {
  80.             for(Player a : Bukkit.getOnlinePlayers()) {
  81.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("009Master").addEntry(p.getName());
  82.             }
  83.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Business")) {
  84.             for(Player a : Bukkit.getOnlinePlayers()) {
  85.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("010Business").addEntry(p.getName());
  86.             }
  87.         }else if(PermissionsEx.getUser(p.getName()).inGroup("Spieler")) {
  88.             for(Player a : Bukkit.getOnlinePlayers()) {
  89.                 scoreboardhashmap.get(a.getUniqueId()).sb.getTeam("011Spieler").addEntry(p.getName());
  90.             }
  91.         }
  92.     }
  93. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top