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 <lynxplay101@gmail.com>
This commit is contained in:
parent
7b03141498
commit
355b1cbaf6
37 changed files with 233 additions and 122 deletions
|
@ -47,10 +47,10 @@ index c978f3b2d42f512e982f289e76c2422e41b7eec6..bb8e962e63c7a2d931f9bd7f7c002aa3
|
|||
Vec3 vec3d = raytrace1.getFrom().subtract(raytrace1.getTo());
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 28458a499702989d640d88de8fa7e8861be95189..166458785b507208caa7ecf8ee8b60650ca3523a 100644
|
||||
index cb50fca4867688d2572e8ab5b7fef7243c5b8ba9..7ada46aa24e1bc15207a34c15b056e4e76238757 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1104,9 +1104,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1106,9 +1106,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) {
|
||||
|
@ -68,7 +68,7 @@ index 28458a499702989d640d88de8fa7e8861be95189..166458785b507208caa7ecf8ee8b6065
|
|||
|
||||
Preconditions.checkArgument(direction != null, "Vector direction cannot be null");
|
||||
direction.checkFinite();
|
||||
@@ -1156,9 +1162,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1158,9 +1164,16 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
|
||||
@Override
|
||||
public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) {
|
||||
|
@ -87,7 +87,7 @@ index 28458a499702989d640d88de8fa7e8861be95189..166458785b507208caa7ecf8ee8b6065
|
|||
|
||||
Preconditions.checkArgument(direction != null, "Vector direction cannot be null");
|
||||
direction.checkFinite();
|
||||
@@ -1171,16 +1184,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1173,16 +1186,23 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
}
|
||||
|
||||
Vector dir = direction.clone().normalize().multiply(maxDistance);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue