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
|
@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server
|
|||
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 110a5d92d6154bc39c1916006a5cb74798092445..a1912eb5fd26898d7e9848ffb2052fce2fa10868 100644
|
||||
index ba011d3b56ed0e5019da61ccfec687042d863beb..20a954c8637c2cf9cc6c0c823e33a44f668cc4f6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1393,7 +1393,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1395,7 +1395,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Preconditions.checkArgument(material != null, "Material cannot be null");
|
||||
Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material);
|
||||
|
||||
|
@ -28,7 +28,7 @@ index 110a5d92d6154bc39c1916006a5cb74798092445..a1912eb5fd26898d7e9848ffb2052fce
|
|||
return (FallingBlock) entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
@@ -1402,7 +1407,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1404,7 +1409,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Preconditions.checkArgument(location != null, "Location cannot be null");
|
||||
Preconditions.checkArgument(data != null, "BlockData cannot be null");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue