mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
optimise explosion damage further
and use the right entity for the dragon part damage
This commit is contained in:
parent
40d0f2da71
commit
4fc499dde8
1 changed files with 8 additions and 1 deletions
|
@ -451,10 +451,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
// Calculate damage separately for each EntityComplexPart
|
||||
if (list.contains(entityComplexPart)) {
|
||||
- entityComplexPart.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity));
|
||||
+ entityComplexPart.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity, getSeenFraction(vec3d, entityComplexPart, blockCache, blockPos))); // Paper - actually optimise explosions
|
||||
+ entityComplexPart.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entityComplexPart, getSeenFraction(vec3d, entityComplexPart, blockCache, blockPos))); // Paper - actually optimise explosions and use the right entity to calculate the damage
|
||||
}
|
||||
}
|
||||
} else {
|
||||
- entity.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity));
|
||||
+ entity.hurt(this.damageSource, this.damageCalculator.getEntityDamageAmount(this, entity, getSeenFraction(vec3d, entity, blockCache, blockPos))); // Paper - actually optimise explosions
|
||||
}
|
||||
|
||||
CraftEventFactory.entityDamage = null;
|
||||
@@ -0,0 +0,0 @@ public class Explosion {
|
||||
// CraftBukkit end
|
||||
}
|
||||
|
@ -497,8 +502,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java
|
||||
@@ -0,0 +0,0 @@ public class ExplosionDamageCalculator {
|
||||
return true;
|
||||
}
|
||||
|
||||
+ @io.papermc.paper.annotation.DoNotUse @Deprecated // Paper
|
||||
public float getEntityDamageAmount(Explosion explosion, Entity entity) {
|
||||
+ // Paper start - actually optimise explosions
|
||||
+ return this.getEntityDamageAmount(explosion, entity, Explosion.getSeenPercent(explosion.center(), entity));
|
||||
|
|
Loading…
Reference in a new issue