aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLulu13022002 <[email protected]>2023-12-08 20:47:27 +0100
committerLulu13022002 <[email protected]>2023-12-08 20:47:27 +0100
commit8d8eb3bdf6a7ac1b16416d02a87b56b73c27737f (patch)
tree89a60ee05eb4311972b601b3f1b4528f4cc77e3a
parent2f92d4e00ecc4be92089a1494097aaba0ce82fff (diff)
downloadPaper-8d8eb3bdf6a7ac1b16416d02a87b56b73c27737f.tar.gz
Paper-8d8eb3bdf6a7ac1b16416d02a87b56b73c27737f.zip
optimise explosion damage further
and use the right entity for the dragon part damage
-rw-r--r--patches/server/1014-Actually-optimise-explosions.patch17
1 files changed, 12 insertions, 5 deletions
diff --git a/patches/server/1014-Actually-optimise-explosions.patch b/patches/server/1014-Actually-optimise-explosions.patch
index c86140b4aa..879be2c332 100644
--- a/patches/server/1014-Actually-optimise-explosions.patch
+++ b/patches/server/1014-Actually-optimise-explosions.patch
@@ -34,7 +34,7 @@ The results indicate that this logic is 5 times faster than Vanilla
and 2.3 times faster than Lithium.
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
-index dbe679bb81a903668262cdf629469e971b49e088..c790418ff4584af20db006a3e8770f261bab271e 100644
+index dbe679bb81a903668262cdf629469e971b49e088..9442f58dff89ec843c321533965fbee2727d02f8 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -111,6 +111,271 @@ public class Explosion {
@@ -446,15 +446,20 @@ index dbe679bb81a903668262cdf629469e971b49e088..c790418ff4584af20db006a3e8770f26
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
-@@ -275,7 +591,7 @@ public class Explosion {
+@@ -275,11 +591,11 @@ public class Explosion {
for (EnderDragonPart entityComplexPart : ((EnderDragon) entity).subEntities) {
// 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;
@@ -289,7 +605,7 @@ public class Explosion {
// CraftBukkit end
}
@@ -493,12 +498,14 @@ index dbe679bb81a903668262cdf629469e971b49e088..c790418ff4584af20db006a3e8770f26
}
diff --git a/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java b/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java
-index 24dba1eb6f5dc71e5d1ce2d150930eaefc83f811..67625a34084792f6cbab34bf99e5571bb75e59d9 100644
+index 24dba1eb6f5dc71e5d1ce2d150930eaefc83f811..f529f5d0f28533ec89f3ee712e59745991d068ee 100644
--- a/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java
+++ b/src/main/java/net/minecraft/world/level/ExplosionDamageCalculator.java
-@@ -21,10 +21,15 @@ public class ExplosionDamageCalculator {
+@@ -20,11 +20,17 @@ 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));