aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-11-19 11:54:58 +0100
committerGitHub <[email protected]>2024-11-19 11:54:58 +0100
commitd0dcd7d2511e60f08ba7de6a5b67124febfe84d0 (patch)
tree9cf6c44653b13a0b5081338944181ee5b48ba2db /patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch
parent57eab3e3122fbbb4ce6d31880a35cb64ef4281f5 (diff)
downloadPaper-d0dcd7d2511e60f08ba7de6a5b67124febfe84d0.tar.gz
Paper-d0dcd7d2511e60f08ba7de6a5b67124febfe84d0.zip
Fix incorrect invulnerability damage reduction (#11599)
Fixes incorrect spigot handling of the invulnerability damage reduction applied when an already invulnerable entity is damaged with a larger damage amount than the initial damage. Vanilla still damages entities even if invulnerable if the damage to be applied is larger than the previous damage taken. In that case, vanilla applies the difference between the previous damage taken and the proposed damage. Spigot's damage modifier API takes over the computation of damage reducing effects, however spigot invokes this handling with the initial damage before computing the difference to the previous damage amount. This leads to the reduction values to generally be larger than expected, as they are computed on the not-yet-reduced value. Spigot applies these reductions after calling the EntityDamageEvent and *then* subtracts the previous damage point, leading to the final damage amount being smaller than expected. This patch cannot simply call the EntityDamageEvent with the reduced damage, as that would lead to EntityDamageEvent#getDamage() returning the already reduced damage, which breaks its method contract. Instead, this patch makes use of the DamageModifier API, implementing the last-damage-reduction as a DamageModifier.
Diffstat (limited to 'patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch')
-rw-r--r--patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch2
1 files changed, 1 insertions, 1 deletions
diff --git a/patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch b/patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch
index b26cfd040b..581af491b6 100644
--- a/patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch
+++ b/patches/server/0835-Only-erase-allay-memory-on-non-item-targets.patch
@@ -1,5 +1,5 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Bjarne Koll <[email protected]>
+From: Bjarne Koll <[email protected]>
Date: Fri, 4 Aug 2023 15:53:36 +0200
Subject: [PATCH] Only erase allay memory on non-item targets