mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-04 18:01:17 +01:00
Fix damage bug - Fixes BUKKIT-5678
This commit is contained in:
parent
bba86b10b2
commit
2cac033679
24
Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch
Normal file
24
Bukkit-Patches/0002-Fix-damage-bug-Fixes-BUKKIT-5678.patch
Normal file
@ -0,0 +1,24 @@
|
||||
From 990816b6568d211f62cdd1b7538f52c1c096c1d4 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 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
|
||||
|
Loading…
Reference in New Issue
Block a user