Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Fix DamageSource API

Open Machine-Maker opened this issue 1 year ago • 2 comments
trafficstars

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

Machine-Maker avatar Mar 09 '24 22:03 Machine-Maker

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...)

Doc94 avatar Mar 09 '24 22:03 Doc94

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.

Doc94 avatar Mar 10 '24 01:03 Doc94