Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. int fireworks = 60;
  2. int amount = 0;
  3.  
  4. private BumbleHub plugin;
  5.  
  6. public PartyMode(BumbleHub plugin) {
  7. this.plugin = plugin;
  8. }
  9.  
  10. @Override
  11. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  12. if (sender instanceof Player) {
  13. Player player = (Player) sender;
  14. if (RankAPI.isAdmin(player) || RankAPI.isOwner(player)) {
  15. player.sendMessage("§e[HiveHub] §aParty mode!");
  16. Bukkit.getWorld("world").setTime(12500);
  17. fireworks = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
  18. @Override
  19. public void run() {
  20. amount++;
  21. if (amount == 1) {
  22. fireworkParty();
  23. }
  24. if (amount == 2) {
  25. fireworkParty();
  26. }
  27. if (amount == 3) {
  28. fireworkParty();
  29. }
  30. if (amount == 4) {
  31. fireworkParty();
  32. }
  33. if (amount == 5) {
  34. fireworkParty();
  35. }
  36. if (amount == 6) {
  37. fireworkParty();
  38. }
  39. if (amount == 7) {
  40. fireworkParty();
  41. Bukkit.getWorld("world").setTime(0);
  42. }
  43. }
  44. }, 0L, 60L);
  45.  
  46. } else {
  47. player.sendMessage("");
  48. }
  49. }
  50.  
  51. return true;
  52. }
  53.  
  54. public static void firework(Location location) {
  55. Firework fw = (Firework) Bukkit.getWorld("world").spawnEntity(location, EntityType.FIREWORK);
  56. FireworkMeta fwmeta = fw.getFireworkMeta();
  57. FireworkEffect.Builder builder = FireworkEffect.builder();
  58. builder.withTrail().withFlicker().withFade(Color.GREEN).withColor(Color.FUCHSIA)
  59. .withColor(Color.PURPLE).withColor(Color.MAROON).withColor(Color.LIME)
  60. .withColor(Color.ORANGE).with(FireworkEffect.Type.BURST).flicker(true).trail(true);
  61. fwmeta.addEffect(builder.build());
  62. fwmeta.setPower(1);
  63. fw.setFireworkMeta(fwmeta);
  64. }
  65.  
  66. public static void fireworkParty() {
  67. //Corner squares
  68. firework(new Location(Bukkit.getWorld("world"), -6.50254, 90.500, 7.65892));
  69. firework(new Location(Bukkit.getWorld("world"), -6.46003, 90.500, -6.37424));
  70. firework(new Location(Bukkit.getWorld("world"), 7.69939, 90.500, -6.39616));
  71. firework(new Location(Bukkit.getWorld("world"), 7.35803, 90.500, 7.59564));
  72.  
  73. //Signs, posts etc
  74. firework(new Location(Bukkit.getWorld("world"), 12.51139, 89.500, -11.62696));
  75. firework(new Location(Bukkit.getWorld("world"), 12.28544, 89.500, 12.28686));
  76. firework(new Location(Bukkit.getWorld("world"), -12.02095, 89.500, 12.77890));
  77. firework(new Location(Bukkit.getWorld("world"), -11.44638, 89.500, -11.54964));
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement