Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. Player p = (Player) sender;
  2. if(this.getConfig().getBoolean("main-chat.disabled") == false){
  3. if(label.equalsIgnoreCase("sc") || label.equalsIgnoreCase("staffchat")){
  4. if(!p.hasPermission("staffchat.mainchat.send")){
  5. p.sendMessage(ChatColor.RED + "Sorry, " + p.getName() + " but you're not allowed to use /" + label);
  6. }else{
  7. if(sender instanceof Player){
  8. if(args.length == 0){
  9. p.sendMessage(ChatColor.RED + "Invaild usage. do /" + label + " and then put the message you want to send.");
  10. }if(args.length > 0){
  11. StringBuilder str = new StringBuilder();
  12. for(int i = 0; i < args.length; i++){
  13. str.append(args[i] + " ");
  14.  
  15. for(Player staff : Bukkit.getOnlinePlayers()){
  16. if(staff.hasPermission("staffchat.main.see")){
  17. }
  18. if(this.getConfig().getBoolean("main-chat.use-displayname") == true){
  19. String prefixMain = this.getConfig().getString("main-chat.prefix");
  20. prefixMain = ChatColor.translateAlternateColorCodes('&', prefixMain);
  21.  
  22. String nameMain = this.getConfig().getString("main-chat.name-color");
  23. nameMain = ChatColor.translateAlternateColorCodes('&', nameMain);
  24.  
  25. String color = this.getConfig().getString("main-chat.chat-color");
  26. color = ChatColor.translateAlternateColorCodes('&', color);
  27.  
  28. String colon = this.getConfig().getString("main-chat.colon-symbol");
  29. colon = ChatColor.translateAlternateColorCodes('&', colon);
  30.  
  31. staff.sendMessage(prefixMain + " " + ChatColor.RESET + nameMain + p.getDisplayName() + colon + color + " "+ str.toString().trim());
  32. staff.sendMessage(str.toString().trim());
  33. }else if(this.getConfig().getBoolean("main-chat.use-displayname") == false){
  34.  
  35. if(this.getConfig().getBoolean("main-chat.use-displayname") == true){
  36. String prefixMain = this.getConfig().getString("main-chat.prefix");
  37. prefixMain = ChatColor.translateAlternateColorCodes('&', prefixMain);
  38.  
  39. String nameMain = this.getConfig().getString("main-chat.name-color");
  40. nameMain = ChatColor.translateAlternateColorCodes('&', nameMain);
  41.  
  42. String color = this.getConfig().getString("main-chat.chat-color");
  43. color = ChatColor.translateAlternateColorCodes('&', color);
  44.  
  45. String colon = this.getConfig().getString("main-chat.colon-symbol");
  46. colon = ChatColor.translateAlternateColorCodes('&', colon);
  47.  
  48. staff.sendMessage("" + prefixMain + " " + ChatColor.RESET + nameMain + p.getName() + colon + color + " "+ str.toString().trim());
  49. return true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement