mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
65bc2541a3
By: md_5 <git@md-5.net>
33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
--- a/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
|
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
|
@@ -23,6 +23,11 @@
|
|
import net.minecraft.world.level.block.state.IBlockData;
|
|
import net.minecraft.world.level.material.Fluid;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityRemoveEvent;
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class EntityMinecartTNT extends EntityMinecartAbstract {
|
|
|
|
private static final byte EVENT_PRIME = 10;
|
|
@@ -113,8 +118,16 @@
|
|
d1 = 5.0D;
|
|
}
|
|
|
|
- this.level().explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), false, World.a.TNT);
|
|
- this.discard();
|
|
+ // 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(), World.a.TNT);
|
|
+ // CraftBukkit end
|
|
+ this.discard(EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
|
|
}
|
|
|
|
}
|