13
0
geforkt von Mirrors/Paper

Fix damage bug - Fixes BUKKIT-5678

Dieser Commit ist enthalten in:
Aikar 2014-07-07 23:14:51 -05:00
Ursprung a21b45bf17
Commit f50d1233d4

Datei anzeigen

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java
@@ -0,0 +0,0 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
for (DamageModifier modifier : MODIFIERS) {
damage += getDamage(modifier);
}
- return damage;
+ return Math.max(damage, 0); // Spigot
}
/**
--