aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch')
-rw-r--r--patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch
new file mode 100644
index 0000000000..ddd764dafa
--- /dev/null
+++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/vehicle/MinecartTNT.java.patch
@@ -0,0 +1,40 @@
+--- a/net/minecraft/world/entity/vehicle/MinecartTNT.java
++++ b/net/minecraft/world/entity/vehicle/MinecartTNT.java
+@@ -19,6 +22,9 @@
+ import net.minecraft.world.level.block.Blocks;
+ import net.minecraft.world.level.block.state.BlockState;
+ import net.minecraft.world.level.material.FluidState;
++// CraftBukkit start
++import org.bukkit.event.entity.ExplosionPrimeEvent;
++// CraftBukkit end
+
+ public class MinecartTNT extends AbstractMinecart {
+ private static final byte EVENT_PRIME = 10;
+@@ -99,18 +118,15 @@
+ squareRoot = 5.0;
+ }
+
+- this.level()
+- .explode(
+- this,
+- damageSource,
+- null,
+- this.getX(),
+- this.getY(),
+- this.getZ(),
+- (float)(4.0 + this.random.nextDouble() * 1.5 * squareRoot),
+- false,
+- Level.ExplosionInteraction.TNT
+- );
++ // CraftBukkit start
++ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), false);
++ this.level().getCraftServer().getPluginManager().callEvent(event);
++ if (event.isCancelled()) {
++ fuse = -1;
++ return;
++ }
++ this.level().explode(this, damageSource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.a.TNT);
++ // CraftBukkit end
+ this.discard();
+ }
+ }