13
0
geforkt von Mirrors/Paper
Paper/paper-server/patches/sources/net/minecraft/world/entity
Bjarne Koll c7c3d8a9cb Fix incorrect invulnerability damage reduction
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.
2024-11-11 21:35:27 +01:00
..
ai Only erase allay memory on non-item targets 2023-08-04 15:53:36 +02:00
ambient Climbing should not bypass cramming gamerule 2020-08-23 20:59:00 +02:00
animal Revert to vanilla handling of LivingEntity#actuallyHurt 2024-04-27 09:44:53 -07:00
boss Add config for mobs immune to default effects 2020-12-02 21:03:02 -08:00
decoration Fix DamageSource API 2024-03-09 14:13:04 -08:00
item Remove wall-time / unused skip tick protection 2024-09-16 23:07:29 +02:00
monster Remove wall-time / unused skip tick protection 2024-09-16 23:07:29 +02:00
npc Add PlayerTradeEvent and PlayerPurchaseEvent 2020-07-02 16:12:10 -07:00
player check if itemstack is stackable first 2024-02-24 19:33:01 -08:00
projectile Allow using old ender pearl behavior 2024-10-27 12:36:53 -07:00
raid More Raid API 2022-03-04 09:46:33 -08:00
vehicle Fix InventoryOpenEvent cancellation 2024-08-19 18:05:26 +02:00
AgeableMob.java.patch Honor EntityAgeable.ageLock 2018-09-23 20:59:53 -05:00
AreaEffectCloud.java.patch Entity Activation Range 2024-11-02 18:16:11 +11:00
ConversionParams.java.patch Add EntityZapEvent 2016-10-16 23:19:30 -07:00
ConversionType.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Display.java.patch Fix text display error on spawn 2023-03-16 16:27:50 +01:00
Entity.java.patch Void damage configuration API 2024-09-29 14:20:42 -07:00
EntitySelector.java.patch Ability to control player's insomnia and phantoms 2022-01-22 17:56:19 +01:00
EntityType.java.patch Validate ResourceLocation in NBT reading 2024-01-04 13:49:14 +01:00
ExperienceOrb.java.patch Expand PlayerItemMendEvent 2022-01-20 18:11:20 -08:00
Interaction.java.patch Fix advancement triggers for entity damage 2023-03-16 10:04:17 +01:00
ItemBasedSteering.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Leashable.java.patch Validate ResourceLocation in NBT reading 2024-01-04 13:49:14 +01:00
LightningBolt.java.patch Fix strikeLightningEffect powers lightning rods and clears copper 2023-09-30 12:36:14 +02:00
LivingEntity.java.patch Fix incorrect invulnerability damage reduction 2024-11-11 21:35:27 +01:00
Mob.java.patch Validate ResourceLocation in NBT reading 2024-01-04 13:49:14 +01:00
NeutralMob.java.patch Prevent entity loading causing async lookups 2022-03-06 11:09:09 -05:00
OminousItemSpawner.java.patch Fixes and additions to the spawn reason API 2019-03-24 00:24:52 -04:00
PathfinderMob.java.patch Remap CraftBukkit to Mojang+Yarn Mappings 2024-12-11 22:26:55 +01:00
Shearable.java.patch Add Shearable API 2021-10-17 15:39:48 -04:00
TamableAnimal.java.patch Fix NPE on null loc for EntityTeleportEvent 2023-12-09 19:15:59 -08:00