From f532630d1b7c2de90e79eeaa3a96397110724e0d Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 14 Aug 2012 14:21:07 -0700 Subject: [PATCH] Another fix to make us more compatible with other plugins --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/util/Combat.java | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 054ffdcfb..b381f7efc 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -9,6 +9,7 @@ Key: Version 1.3.11 + Added compatibility with bow-wielding NPCs from Citizens/NPC mods + + Added compatibility for pvp-prevention plugins for Serrated Strikes = Fixed bug where mcMMO could throw NPE errors if trees cut down were from a custom mod and had an id of 17 = Fixed bug where mcMMO would ignore other block-protection plugins for various abilities diff --git a/src/main/java/com/gmail/nossr50/util/Combat.java b/src/main/java/com/gmail/nossr50/util/Combat.java index 24df2fba2..7d1618da6 100644 --- a/src/main/java/com/gmail/nossr50/util/Combat.java +++ b/src/main/java/com/gmail/nossr50/util/Combat.java @@ -504,7 +504,15 @@ public class Combat { if (Users.getProfile(defender).getGodMode()) { return false; } - } + + //It may seem a bit redundant but we need a check here to prevent bleed from being applied in applyAbilityAoE() + EntityDamageEvent ede = new FakeEntityDamageByEntityEvent(player, entity, EntityDamageEvent.DamageCause.ENTITY_ATTACK, 1); + mcMMO.p.getServer().getPluginManager().callEvent(ede); + + if (ede.isCancelled()) { + return false; + } + } else if (entity instanceof Tameable) { Tameable pet = (Tameable) entity;