Fix DamageSource API

Uses the correct entity in the EntityDamageByEntity event
Returns the correct entity for API's DamageSource#getCausingEntity
This commit is contained in:
Jake Potrebic
2024-03-09 14:13:04 -08:00
parent a87a5e10d9
commit d42ef390ea
12 changed files with 36 additions and 50 deletions

View File

@@ -15,7 +15,7 @@
@Override
public void thunderHit(ServerLevel world, LightningBolt lightning) {
- this.hurtServer(world, this.damageSources().lightningBolt(), Float.MAX_VALUE);
+ this.hurtServer(world, this.damageSources().lightningBolt().customEntityDamager(lightning), Float.MAX_VALUE); // CraftBukkit
+ this.hurtServer(world, this.damageSources().lightningBolt().customEventDamager(lightning), Float.MAX_VALUE); // CraftBukkit // Paper - fix DamageSource API
}
@Override