Paper
Paper copied to clipboard
Fix DamageSource API
Uses the correct entity in the EntityDamageByEntity event Returns the correct entity for API's DamageSource#getCausingEntity
Superceeds https://github.com/PaperMC/Paper/pull/10275
Download the paperclip jar for this pull request: paper-10307.zip
In a fast check i wanna ask.. this make the thing i mention in upstream about now DamageEvent#getDamager is not the same than DamageSource#getEntity? if that is the case this make a inconsistence beetween plugins running in Paper and Spigot not? (well that its not relevant...)
For explosions looks is working fine. For tests cases where now is used customCausingEntity the DamageSource has null direct/causing entity causing like i said this sounds inconsistent.. and make a user better handle in the event for damager rather than try to use DamageSource for that info
the change in how name the field sounds like a thing i mention in discord when discuss this topic (https://canary.discord.com/channels/289587909051416579/555462289851940864/1215314826469834823) but for lazy i dont try make that change.. not sure if sounds good backport that part of the change or just ignore.