Advertisement
Lisenochek

Untitled

Sep 11th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. package com.realistic.timers;
  2.  
  3. import java.io.IOException;
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.entity.Player;
  7.  
  8. import com.realistic.list.MinecraftList;
  9. import com.realistic.otherAPI.ParticleEffect;
  10.  
  11. public class Blood_spawnParticles {
  12.  
  13. private static MinecraftList ml;
  14.  
  15. private static Thread thread;
  16. private static boolean run = false;
  17.  
  18. public Blood_spawnParticles(MinecraftList ml) {
  19. this.ml = ml;
  20. }
  21.  
  22. public static void init() throws IOException {
  23.  
  24. run = true;
  25.  
  26. thread = new Thread() {
  27.  
  28. @Override
  29. public void run() {
  30.  
  31. while (true && run) {
  32.  
  33. for (Player p : Bukkit.getOnlinePlayers()) {
  34.  
  35. if (ml.bloodingPlayers.containsKey(p.getPlayer().getName())) {
  36.  
  37. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.7, 0.3), 50);
  38. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0.3, 0.7, 0), 50);
  39. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.7, -0.3), 50);
  40. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(-0.3, 0.7, 0), 50);
  41.  
  42. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.4, 0.4), 50);
  43. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0.4, 0.4, 0), 50);
  44. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.4, -0.4), 50);
  45. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(-0.4, 0.4, 0), 50);
  46.  
  47. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.2, 0.5), 50);
  48. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0.5, 0.2, 0), 50);
  49. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(0, 0.2, -0.5), 50);
  50. ParticleEffect.REDSTONE.display(1, 15, 0, 0, 0, p.getLocation().add(-0.5, 0.2, 0), 50);
  51. }
  52. }
  53.  
  54. try {
  55. thread.sleep(5);
  56. } catch (InterruptedException | OutOfMemoryError e) {
  57. e.printStackTrace();
  58. }
  59. }
  60. }
  61. };
  62. thread.start();
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement