Damage with any cause#7980
Closed
TetraTheta wants to merge 2 commits into
Closed
Conversation
TetraTheta
commented
Jun 14, 2022
Comment on lines
+417
to
+432
| + /* | ||
| + EntityDamageEvent event = new EntityDamageByBlockEvent(blockDamager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions); // Paper | ||
| event.setCancelled(cancelled); | ||
|
|
||
| CraftEventFactory.blockDamage = null; // SPIGOT-6639: Clear blockDamage to allow other entity damage during event call | ||
| CraftEventFactory.callEvent(event); | ||
| - CraftEventFactory.blockDamage = damager; // SPIGOT-6639: Re-set blockDamage so that other entities which are also getting damaged have the right cause | ||
| + CraftEventFactory.blockDamage = blockDamager; // SPIGOT-6639: Re-set blockDamage so that other entities which are also getting damaged have the right cause // Paper | ||
|
|
||
| if (!event.isCancelled()) { | ||
| event.getEntity().setLastDamageCause(event); | ||
| @@ -1078,6 +1087,8 @@ public class CraftEventFactory { | ||
| throw new IllegalStateException(String.format("Unhandled damage of %s by %s from %s", entity, damager.getHandle(), source.msgId)); | ||
| } | ||
| EntityDamageEvent event = new EntityDamageByEntityEvent(damager, entity.getBukkitEntity(), cause, modifiers, modifierFunctions, source.isCritical()); // Paper - add critical damage API | ||
| + */ |
Contributor
Author
There was a problem hiding this comment.
These lines were undeleted by purpose. I wasn't sure if I can safely delete these lines. If it is ok to delete this lines, I will.
Contributor
Author
|
Closing mine because #8058 is much more 'beautiful' I think no one would think this PR should be 'revived', but if anyone thinks so, feel free to re-open this. (Don't know if it is possible though) |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation of #7423.
Since this is almost direct port of original(#5191) PR, I don't think I fully understood the original code. I will leave some comment on the code.
Any comments will be welcomed, so please, feel free to give me any feedback.