Guest User

Untitled

a guest
Aug 11th, 2015
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. package com.bukiitParticleEffectsLobby;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.Location;
  5. import org.bukkit.entity.Player;
  6. import org.bukkit.event.EventHandler;
  7. import org.bukkit.event.Listener;
  8. import org.bukkit.event.player.PlayerInteractEvent;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11.  
  12. public class Main extends JavaPlugin implements Listener {
  13.  
  14. @Override
  15. public void onEnable() {
  16. Bukkit.getServer().getPluginManager().registerEvents(this, this);
  17. }
  18.  
  19. @EventHandler
  20.  
  21. public void onPlayerInteract(PlayerInteractEvent e) {
  22. if (e.getClickedBlock() == null) {
  23. return;
  24. } else {
  25. Player p = e.getPlayer();
  26.  
  27. int radius = 2;
  28. int radiusB = -2;
  29. for(double y = 0; y <= 5; y+=0.005) {
  30. Location playerLoc = p.getLocation();
  31. double x = radius * Math.cos(y);
  32. double z = radius * Math.sin(y);
  33. playerLoc.add(x, y, z);
  34. ParticleEffect.FIREWORKS_SPARK.display(0, 0, 0, 0, 1, playerLoc, 40);
  35. playerLoc.subtract(x, y, z);
  36.  
  37. Location playerLoc2 = p.getLocation();
  38. double x2 = radiusB * Math.cos(y);
  39. double z2 = radius * Math.sin(y);
  40. playerLoc2.add(x2, y, z2);
  41. ParticleEffect.FLAME.display(0, 0, 0, 0, 1, playerLoc2, 40);
  42. playerLoc2.subtract(x2, y, z2);
  43.  
  44.  
  45.  
  46. try {
  47. Thread.sleep(3);
  48. } catch (InterruptedException e1) {
  49. e1.printStackTrace();
  50. }
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment