Guest User

Untitled

a guest
Aug 28th, 2021
16
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package Methoden;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.scoreboard.DisplaySlot;
  6. import org.bukkit.scoreboard.Objective;
  7. import org.bukkit.scoreboard.Scoreboard;
  8. import org.bukkit.scoreboard.ScoreboardManager;
  9.  
  10. import de.minelag.main.Main;
  11.  
  12. public class Methoden {
  13.  
  14. public static void setScoreboard(Player player) {
  15. ScoreboardManager sm = Bukkit.getScoreboardManager();
  16. Scoreboard board = sm.getNewScoreboard();
  17. Objective obj = board.registerNewObjective("test", "dummy");
  18.  
  19. obj.setDisplaySlot(DisplaySlot.SIDEBAR);
  20. obj.setDisplayName("§1>§5MineLagDE§1<");
  21. obj.getScore("§b§lRang").setScore(10);
  22.  
  23. if(player.hasPermission("prefix.owner")) {
  24. obj.getScore("§4§lOwner").setScore(9);
  25. }else if(player.hasPermission("prefix.admin")) {
  26. obj.getScore("§cAdmin").setScore(9);
  27. }else if(player.hasPermission("prefix.entwickler")) {
  28. obj.getScore("§bEntwickler").setScore(9);
  29. }else if(player.hasPermission("prefix.mod")) {
  30. obj.getScore("§3Moderator").setScore(9);
  31. }else if(player.hasPermission("prefix.supporter")) {
  32. obj.getScore("§5Supporter").setScore(9);
  33. }else if(player.hasPermission("prefix.tsupporter")) {
  34. obj.getScore("§dT-Supporter").setScore(9);
  35. }else if(player.hasPermission("prefix.builder")) {
  36. obj.getScore("§aBuilder").setScore(9);
  37. }else if(player.hasPermission("prefix.gold")) {
  38. obj.getScore("§6VIP-Gold").setScore(9);
  39. }else if(player.hasPermission("prefix.ultra")) {
  40. obj.getScore("§bVIP-Ultra").setScore(9);
  41. }else if(player.hasPermission("prefix.vip")) {
  42. obj.getScore("§eVIP").setScore(9);
  43. }else
  44. obj.getScore("§7Zivilist").setScore(8);
  45.  
  46. obj.getScore("§b§lName:").setScore(7);
  47. obj.getScore("§a"+ player.getName()).setScore(6);
  48. obj.getScore("§b§lKontostand").setScore(5);
  49. obj.getScore("§bOnline").setScore(3);
  50. obj.getScore("§l"+ Bukkit.getOnlinePlayers().size() +"§b/§l"+ Bukkit.getMaxPlayers()).setScore(2);
  51. obj.getScore("§b§lCommands").setScore(1);
  52. obj.getScore("§7/Commands").setScore(0);
  53.  
  54. player.setScoreboard(board);
  55.  
  56. if(cfg.contains("Money."+ player.getName())) {
  57. int Money = cfg.getInt("Money."+ player.getName());
  58. obj.getScore("§d"+ Money +"§").setScore(4);;
  59. Main.getPlugin().saveConfig();
  60. }else
  61. obj.getScore("1000").setScore(4);
  62. cfg.set("Money."+ player.getName(), 1000);
  63. Main.getPlugin().saveConfig();
  64. }
  65. }
  66.  
  67. public static boolean isInteger(String string) {
  68. try {
  69. Integer.parseInt(string);
  70. return true;
  71. } catch (NumberFormatException e) {
  72. return false;
  73.  
  74. }
  75. }
  76.  
RAW Paste Data