From d6a00eaf001e4a66693e422a5635757e86562c23 Mon Sep 17 00:00:00 2001 From: TheComputerGeek2 Date: Mon, 6 Mar 2017 18:03:15 -0800 Subject: [PATCH] Prevent disarming, bleed, and axe passives when dealing thorns damage --- .../com/gmail/nossr50/util/skills/CombatUtils.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 94f7237bc..7933adad1 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -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 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;