Change ability particles due to confusion over glass-breaking sound.

This commit is contained in:
GJ 2013-02-20 08:42:25 -05:00
parent 8833ceb3b5
commit 79bcd76aa0

View File

@ -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());