Advertisement
Toppe5

Untitled

Sep 29th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. public void stop() {
  2. PvPEventEndEvent event = new PvPEventEndEvent(this, null);
  3. Bukkit.getPluginManager().callEvent(event);
  4. totalPlayers = 0;
  5. started = false;
  6. new BukkitRunnable() {
  7.  
  8. @Override
  9. public void run() {
  10. for(String s : players.keySet()) {
  11. Player pl = Bukkit.getPlayer(s);
  12. if(pl != null) {
  13. pl.sendMessage(plugin.translateMessage(pl, "event-stopped"));
  14. if(plugin.getSpectatorHandler().isSpectator(pl)) {
  15. plugin.getSpectatorHandler().removeSpectator(pl, true);
  16. }
  17. plugin.clear(pl, true, true);
  18. new BukkitRunnable() {
  19.  
  20. @Override
  21. public void run() {
  22. if(pl != null) {
  23. plugin.clear(pl, true, true);
  24. }
  25. }
  26. }.runTaskLater(plugin, 40);
  27. }
  28. }
  29. players.clear();
  30. }
  31. }.runTaskLater(plugin, 20*plugin.getConfig().getInt("wait-before-teleport"));
  32. p1 = null;
  33. p2 = null;
  34. for(UUID uuid : spectators) {
  35. Player pl = Bukkit.getPlayer(uuid);
  36. if(pl != null) {
  37. pl.sendMessage(plugin.translateMessage(pl, "event-stopped"));
  38. if(StrikePractice.disabling) {
  39. if(plugin.getSpectatorHandler().isSpectator(pl)) {
  40. plugin.getSpectatorHandler().removeSpectator(pl, true);
  41. }
  42. plugin.clear(pl, true, true);
  43. }
  44. else {
  45. new BukkitRunnable() {
  46.  
  47. @Override
  48. public void run() {
  49. if(pl != null) {
  50. plugin.clear(pl, true, true);
  51. new BukkitRunnable() {
  52.  
  53. @Override
  54. public void run() {
  55. if(pl != null) {
  56. if(plugin.getSpectatorHandler().isSpectator(pl)) {
  57. plugin.getSpectatorHandler().removeSpectator(pl, true);
  58. }
  59. plugin.clear(pl, true, true);
  60. }
  61. }
  62. }.runTaskLater(plugin, 40);
  63. }
  64. }
  65. }.runTaskLater(plugin, 20*plugin.getConfig().getInt("wait-before-teleport"));
  66. }
  67. }
  68. }
  69. BracketsCommand.brackets = null;
  70. BracketsCommand.starting = false;
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement