Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int fireworks = 60;
- int amount = 0;
- private BumbleHub plugin;
- public PartyMode(BumbleHub plugin) {
- this.plugin = plugin;
- }
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- if (sender instanceof Player) {
- Player player = (Player) sender;
- if (RankAPI.isAdmin(player) || RankAPI.isOwner(player)) {
- player.sendMessage("§e[HiveHub] §aParty mode!");
- Bukkit.getWorld("world").setTime(12500);
- fireworks = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
- @Override
- public void run() {
- amount++;
- if (amount == 1) {
- fireworkParty();
- }
- if (amount == 2) {
- fireworkParty();
- }
- if (amount == 3) {
- fireworkParty();
- }
- if (amount == 4) {
- fireworkParty();
- }
- if (amount == 5) {
- fireworkParty();
- }
- if (amount == 6) {
- fireworkParty();
- }
- if (amount == 7) {
- fireworkParty();
- Bukkit.getWorld("world").setTime(0);
- }
- }
- }, 0L, 60L);
- } else {
- player.sendMessage("");
- }
- }
- return true;
- }
- public static void firework(Location location) {
- Firework fw = (Firework) Bukkit.getWorld("world").spawnEntity(location, EntityType.FIREWORK);
- FireworkMeta fwmeta = fw.getFireworkMeta();
- FireworkEffect.Builder builder = FireworkEffect.builder();
- builder.withTrail().withFlicker().withFade(Color.GREEN).withColor(Color.FUCHSIA)
- .withColor(Color.PURPLE).withColor(Color.MAROON).withColor(Color.LIME)
- .withColor(Color.ORANGE).with(FireworkEffect.Type.BURST).flicker(true).trail(true);
- fwmeta.addEffect(builder.build());
- fwmeta.setPower(1);
- fw.setFireworkMeta(fwmeta);
- }
- public static void fireworkParty() {
- //Corner squares
- firework(new Location(Bukkit.getWorld("world"), -6.50254, 90.500, 7.65892));
- firework(new Location(Bukkit.getWorld("world"), -6.46003, 90.500, -6.37424));
- firework(new Location(Bukkit.getWorld("world"), 7.69939, 90.500, -6.39616));
- firework(new Location(Bukkit.getWorld("world"), 7.35803, 90.500, 7.59564));
- //Signs, posts etc
- firework(new Location(Bukkit.getWorld("world"), 12.51139, 89.500, -11.62696));
- firework(new Location(Bukkit.getWorld("world"), 12.28544, 89.500, 12.28686));
- firework(new Location(Bukkit.getWorld("world"), -12.02095, 89.500, 12.77890));
- firework(new Location(Bukkit.getWorld("world"), -11.44638, 89.500, -11.54964));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement