From 79bcd76aa00ff9dc4ec4bffff003b92782b9315e Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 20 Feb 2013 08:42:25 -0500 Subject: [PATCH] Change ability particles due to confusion over glass-breaking sound. --- .../nossr50/skills/utilities/SkillTools.java | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java index 08245c1fb..2c0c532fb 100644 --- a/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java +++ b/src/main/java/com/gmail/nossr50/skills/utilities/SkillTools.java @@ -3,20 +3,24 @@ package com.gmail.nossr50.skills.utilities; import java.util.ArrayList; import java.util.List; -import org.bukkit.Effect; +import org.bukkit.Color; +import org.bukkit.FireworkEffect; +import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.FireworkEffect.Type; import org.bukkit.block.Block; import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.Firework; import org.bukkit.entity.Player; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.PlayerInventory; +import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.PluginManager; -import org.bukkit.potion.Potion; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; import org.getspout.spoutapi.SpoutManager; import org.getspout.spoutapi.player.SpoutPlayer; @@ -199,7 +203,18 @@ public class SkillTools { profile.setAbilityMode(ability, false); profile.setAbilityInformed(ability, false); - player.playEffect(player.getEyeLocation(), Effect.POTION_BREAK, new Potion(PotionType.STRENGTH)); + + Location location = player.getLocation(); + location.setY(location.getY() - 2.0); + location.setPitch(-90); + + Firework firework = (Firework) player.getWorld().spawnEntity(location, EntityType.FIREWORK); + FireworkMeta fireworkMeta = firework.getFireworkMeta(); + FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(Color.RED). with(Type.BALL_LARGE).trail(true).build(); + fireworkMeta.addEffect(effect); + fireworkMeta.addEffect(effect); + fireworkMeta.setPower(0); + firework.setFireworkMeta(fireworkMeta); if (profile.useChatNotifications()) { player.sendMessage(ability.getAbilityOff()); @@ -394,7 +409,17 @@ public class SkillTools { if (!profile.getAbilityMode(ability) && cooldownOver(profile.getSkillDATS(ability), ability.getCooldown(), player)) { int ticks = PerksUtils.handleActivationPerks(player, 2 + (profile.getSkillLevel(type) / abilityLengthIncreaseLevel), ability.getMaxTicks()); - player.playEffect(player.getEyeLocation(), Effect.POTION_BREAK, new Potion(PotionType.POISON)); + Location location = player.getLocation(); + location.setY(location.getY() - 2.0); + location.setPitch(-90); + + Firework firework = (Firework) player.getWorld().spawnEntity(location, EntityType.FIREWORK); + FireworkMeta fireworkMeta = firework.getFireworkMeta(); + FireworkEffect effect = FireworkEffect.builder().flicker(false).withColor(Color.GREEN). with(Type.BALL_LARGE).trail(true).build(); + fireworkMeta.addEffect(effect); + fireworkMeta.addEffect(effect); + fireworkMeta.setPower(0); + firework.setFireworkMeta(fireworkMeta); if (profile.useChatNotifications()) { player.sendMessage(ability.getAbilityOn());