Prevent disarming, bleed, and axe passives when dealing thorns damage

This commit is contained in:
TheComputerGeek2 2017-03-06 18:03:15 -08:00
parent 69151f0855
commit d6a00eaf00

View File

@ -55,6 +55,10 @@ public final class CombatUtils {
private CombatUtils() {}
private static void processSwordCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
if (event.getCause() == DamageCause.THORNS) {
return;
}
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
double initialDamage = event.getDamage();
@ -76,6 +80,10 @@ public final class CombatUtils {
}
private static void processAxeCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
if (event.getCause() == DamageCause.THORNS) {
return;
}
double initialDamage = event.getDamage();
double finalDamage = initialDamage;
Map<DamageModifier, Double> modifiers = getModifiers(event);
@ -111,6 +119,10 @@ public final class CombatUtils {
}
private static void processUnarmedCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
if (event.getCause() == DamageCause.THORNS) {
return;
}
double initialDamage = event.getDamage();
double finalDamage = initialDamage;