Guest User

Untitled

a guest
Nov 3rd, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. public boolean onCommand(final CommandSender c, final Command command, final String label, final String[] args) {
  2. if (command.getName().equalsIgnoreCase("cc")) {
  3. if (!c.hasPermission("gosvtools.chat.clear")) {
  4. c.sendMessage(Main.bu);
  5. return true;
  6. }
  7. for (int i = 0; i < 100; ++i) {
  8. Bukkit.broadcastMessage("");
  9. }
  10. for (final String wiadomosc : Main.config.getStringList("ClearChat")) {
  11. Bukkit.broadcastMessage(wiadomosc.replaceAll("&", "§").replaceAll("%czyszczacy%", c.getName()));
  12. }
  13. return false;
  14. }
  15. else {
  16. if (!command.getName().equalsIgnoreCase("zc")) {
  17. return false;
  18. }
  19. if (!c.hasPermission("gosvtools.chat.lock")) {
  20. c.sendMessage(Main.bu);
  21. return false;
  22. }
  23. if (!Main.wylaczony) {
  24. for (final String wiadomosc : Main.config.getStringList("ChatLock.Wylaczono")) {
  25. Bukkit.broadcastMessage(wiadomosc.replaceAll("&", "§").replaceAll("%gracz%", c.getName()));
  26. }
  27. Main.wylaczony = true;
  28. }
  29. else {
  30. for (final String wiadomosc : Main.config.getStringList("ChatLock.Wlaczono")) {
  31. Bukkit.broadcastMessage(wiadomosc.replaceAll("&", "§").replaceAll("%gracz%", c.getName()));
  32. }
  33. Main.wylaczony = false;
  34. }
  35. return false;
  36. }
  37. }
  38.  
  39. @EventHandler
  40. public void chat(final AsyncPlayerChatEvent event) {
  41. if (event.getPlayer().hasPermission("gosvtools.chat.lock.allow")) {
  42. return;
  43. }
  44. if (Main.wylaczony) {
  45. event.getPlayer().sendMessage(Main.msg("ChatLock.Wylaczony"));
  46. event.setCancelled(true);
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment