Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. ##### HELPOP ######
  2.  
  3. package xyz.wda1234.core.commands.core;
  4.  
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import xyz.wda1234.core.commands.CustomCommand;
  9. import xyz.wda1234.core.enums.GroupType;
  10. import xyz.wda1234.core.manager.UserManager;
  11. import xyz.wda1234.core.utils.ChatUtil;
  12.  
  13. /**
  14. * Created by Dawid_2 on 2015-11-10.
  15. */
  16. public class HelpOpCommand extends CustomCommand {
  17.  
  18.  
  19. public HelpOpCommand(String command, GroupType type) {
  20. super(command, type);
  21. }
  22.  
  23. @Override
  24. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  25. if (UserManager.getUser((Player) sender).getChat().isMuted()){
  26. sender.sendMessage(ChatUtil.fixColors("&cJestes wyciszony !"));
  27. return true;
  28. }
  29. if (args.length > 0) {
  30. String message = "";
  31. for (int i = 0; i < args.length; i++) {
  32. message = message + args[i] + " ";
  33. }
  34. ChatUtil.sendMessageToAllOP(ChatUtil.fixColors("&cHelpOP "+sender.getName()+" &7"+message));
  35. } else {
  36. sender.sendMessage(ChatUtil.fixColors("&cPoprawne uzycie komendy /helpop TEKST"));
  37. }
  38. return true;
  39. }
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. #### CHATUTIL ZMIENNA OD OPA ####
  47.  
  48.  
  49. public static void sendMessageToAllOP(String mess) {
  50. for (Player player : Bukkit.getServer().getOnlinePlayers()) {
  51. if (UserManager.getUser(player).getGroup().can(GroupType.HELPER)) {
  52. player.sendMessage(mess);
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement