SHARE
TWEET

Untitled

a guest Jul 15th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package net.maschinenmc.citybuild.utils;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.scoreboard.Scoreboard;
  7.  
  8. public class Tablist {
  9.  
  10.     private static Scoreboard sb;
  11.    
  12.     public static void setScoreboard() {
  13.        
  14.         sb = Bukkit.getScoreboardManager().getNewScoreboard();
  15.        
  16.         sb.registerNewTeam("000Owner");
  17.         sb.registerNewTeam("001Admin");
  18.         sb.registerNewTeam("002T-Admin");
  19.         sb.registerNewTeam("003Dev");
  20.         sb.registerNewTeam("004T-Dev");
  21.         sb.registerNewTeam("005Builder");
  22.         sb.registerNewTeam("006T-Builder");
  23.         sb.registerNewTeam("007Mod");
  24.         sb.registerNewTeam("008T-Mod");
  25.         sb.registerNewTeam("009Sup");
  26.         sb.registerNewTeam("010T-Sup");
  27.         sb.registerNewTeam("011Freund");
  28.         sb.registerNewTeam("012Spieler");
  29.                
  30.         //Owner
  31.         sb.getTeam("000Owner").setPrefix("§4§lOwner§r §4● §4§l");
  32.         sb.getTeam("000Owner").setColor(ChatColor.BOLD);
  33.         sb.getTeam("000Owner").setColor(ChatColor.DARK_RED);
  34.  
  35.         sb.getTeam("001Admin").setPrefix("§cAdmin §7● ");
  36.         sb.getTeam("002T-Admin").setPrefix("§l§4Own1er §r§7● §l§4");
  37.         sb.getTeam("003Dev").setPrefix("§l§4Own1er §r§7● §l§4");
  38.         sb.getTeam("004T-Dev").setPrefix("§l§4Own1er §r§7● §l§4");
  39.         sb.getTeam("005Builder").setPrefix("§l§4Ow1ner §r§7● §l§4");
  40.         sb.getTeam("006T-Builder").setPrefix("§l§4Own1er §r§7● §l§4");
  41.         sb.getTeam("007Mod").setPrefix("§l§4Own1er §r§7● §l§4");
  42.         sb.getTeam("008T-Mod").setPrefix("§l§4Ow1ner1 §r§7● §l§4");
  43.         sb.getTeam("009Sup").setPrefix("§l§4Owne1r §r§7● §l§4");
  44.         sb.getTeam("010T-Sup").setPrefix("§l§4O1wner §r§7● §l§4");
  45.         sb.getTeam("011Freund").setPrefix("§l§4Own1er §r§7● §l§4");
  46.         sb.getTeam("012Spieler").setPrefix("§7Spieler ● ");
  47.  
  48.        
  49.         for(Player all:  Bukkit.getOnlinePlayers()) {
  50.             setTeams(all);
  51.         }
  52.        
  53.     }
  54.    
  55.     @SuppressWarnings("deprecation")
  56.     private static void setTeams(Player p) {
  57.         String team = "";
  58.        
  59.         if(p.hasPermission("maschinenmc.owner")) {
  60.             team= "000Owner";
  61.         }else if(p.hasPermission("maschinenmc.admin")) {
  62.             team= "001Admin";
  63.         }else if(p.hasPermission("maschinenmc.testadmin")) {
  64.             team= "002T-Admin";
  65.         }else if(p.hasPermission("maschinenmc.dev")) {
  66.             team= "003Dev";
  67.         }else if(p.hasPermission("maschinenmc.testdev")) {
  68.             team= "004T-Dev";
  69.         }else if(p.hasPermission("maschinenmc.builder")) {
  70.             team= "005Builder";
  71.         }else if(p.hasPermission("maschinenmc.testbuilder")) {
  72.             team= "006T-Builder";
  73.         }else if(p.hasPermission("maschinenmc.mod")) {
  74.             team= "007Mod";
  75.         }else if(p.hasPermission("maschinenmc.testmod")) {
  76.             team= "008T-Mod";
  77.         }else if(p.hasPermission("maschinenmc.sup")) {
  78.             team= "009Sup";
  79.         }else if(p.hasPermission("maschinenmc.testsup")) {
  80.             team= "010T-Sup";
  81.         }else if(p.hasPermission("maschinenmc.friend")) {
  82.             team= "011Freund";
  83.         } else {
  84.             team= "012Spieler";
  85.         }
  86.        
  87.         sb.getTeam(team).addPlayer(p);
  88.         p.setScoreboard(sb);
  89.     }
  90.    
  91. }
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
 
Top