use of com.projectkorra.projectkorra.Element in project Spirits by xNuminousx.
the class Methods method playSpiritParticles.
public static void playSpiritParticles(BendingPlayer bPlayer, Location loc, float X, float Y, float Z, float speed, int amount) {
Element ls = Element.getElement("LightSpirit");
Element ds = Element.getElement("DarkSpirit");
Element s = Element.getElement("Spirit");
if (bPlayer.hasElement(ls) && bPlayer.hasElement(ds)) {
ParticleEffect.MAGIC_CRIT.display(loc, X, Y, Z, speed, amount);
} else if (bPlayer.hasElement(ds)) {
ParticleEffect.WITCH_MAGIC.display(loc, X, Y, Z, speed, amount);
} else if (bPlayer.hasElement(ls)) {
ParticleEffect.INSTANT_SPELL.display(loc, X, Y, Z, speed, amount);
} else if (!bPlayer.hasElement(ls) && !bPlayer.hasElement(ds) && bPlayer.hasElement(s)) {
ParticleEffect.MAGIC_CRIT.display(loc, X, Y, Z, speed, amount);
}
}
use of com.projectkorra.projectkorra.Element in project Spirits by xNuminousx.
the class PassiveListener method onFallDamage.
@EventHandler
public void onFallDamage(EntityDamageEvent event) {
if (event.getEntity() instanceof Player) {
Element spirit = Element.getElement("Spirit");
Player player = (Player) event.getEntity();
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (event.isCancelled() || bPlayer == null || bPlayer.hasElement(Element.AIR) || bPlayer.hasElement(Element.EARTH)) {
return;
} else if (bPlayer.hasElement(spirit) && event.getCause() == DamageCause.FALL) {
event.setDamage(0D);
event.setCancelled(true);
}
}
}
Aggregations