From 2cac033679135c3920d703ca6cefb280fa7cdb26 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 7 Jul 2014 23:14:51 -0500 Subject: [PATCH] Fix damage bug - Fixes BUKKIT-5678 --- ...002-Fix-damage-bug-Fixes-BUKKIT-5678.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch diff --git a/Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch b/Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch new file mode 100644 index 0000000000..8dc9d68680 --- /dev/null +++ b/Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch @@ -0,0 +1,24 @@ +From 990816b6568d211f62cdd1b7538f52c1c096c1d4 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 7 Jul 2014 23:26:59 -0400 +Subject: [PATCH] Fix damage bug - Fixes BUKKIT-5678 + +If a plugin lowers the damage in EntityDamageEvent while also having damage reduction modifiers, +the entity will in turn be able to receive absorption buff on every hit, making them invincible. + +diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +index 17d9548..a4b9eb2 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +@@ -135,7 +135,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { + for (DamageModifier modifier : MODIFIERS) { + damage += getDamage(modifier); + } +- return damage; ++ return Math.max(damage, 0); // Spigot + } + + /** +-- +1.9.1 +