mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Merge pull request #3131 from TheComputerGeek2/master
Prevent disarming, bleed, and axe passives when dealing thorns damage
This commit is contained in:
commit
133281faaa
@ -55,6 +55,10 @@ public final class CombatUtils {
|
|||||||
private CombatUtils() {}
|
private CombatUtils() {}
|
||||||
|
|
||||||
private static void processSwordCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
private static void processSwordCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
||||||
|
if (event.getCause() == DamageCause.THORNS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
McMMOPlayer mcMMOPlayer = UserManager.getPlayer(player);
|
||||||
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
|
SwordsManager swordsManager = mcMMOPlayer.getSwordsManager();
|
||||||
double initialDamage = event.getDamage();
|
double initialDamage = event.getDamage();
|
||||||
@ -76,6 +80,10 @@ public final class CombatUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void processAxeCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
private static void processAxeCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
||||||
|
if (event.getCause() == DamageCause.THORNS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double initialDamage = event.getDamage();
|
double initialDamage = event.getDamage();
|
||||||
double finalDamage = initialDamage;
|
double finalDamage = initialDamage;
|
||||||
Map<DamageModifier, Double> modifiers = getModifiers(event);
|
Map<DamageModifier, Double> modifiers = getModifiers(event);
|
||||||
@ -111,6 +119,10 @@ public final class CombatUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void processUnarmedCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
private static void processUnarmedCombat(LivingEntity target, Player player, EntityDamageByEntityEvent event) {
|
||||||
|
if (event.getCause() == DamageCause.THORNS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double initialDamage = event.getDamage();
|
double initialDamage = event.getDamage();
|
||||||
double finalDamage = initialDamage;
|
double finalDamage = initialDamage;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user