Add API for explosions to damage the explosion cause (#11180)

This intends to give plugin developers more control over explosions created using the World#createExplosion method, specifically by adding the option for explosions to damage the explosion cause (not the default behavior, and previously impossible to do, as far as I know). This is done by overloading existing methods with an extra `excludeSourceFromDamage` parameter.

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
This commit is contained in:
Esoteric Enderman
2024-09-28 20:32:56 +01:00
parent afe5fc14c8
commit 96dde2d730
3 changed files with 115 additions and 4 deletions

View File

@@ -27719,8 +27719,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -0,0 +0,0 @@ public class Explosion {
public float yield;
// CraftBukkit end
public boolean excludeSourceFromDamage = true; // Paper - Allow explosions to damage source
+ // Paper start - optimise collisions
+ private static final double[] CACHED_RAYS;