From 4fc499dde842be711c7ac601d84ab42bf4e50e25 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Fri, 8 Dec 2023 20:47:27 +0100 Subject: [PATCH] optimise explosion damage further and use the right entity for the dragon part damage --- patches/server/Actually-optimise-explosions.patch | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/patches/server/Actually-optimise-explosions.patch b/patches/server/Actually-optimise-explosions.patch index 45da1a1bc2..be9c9b93fa 100644 --- a/patches/server/Actually-optimise-explosions.patch +++ b/patches/server/Actually-optimise-explosions.patch @@ -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));