mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-7184: ExplosionPrimeEvent not called for ExplosiveMinecart
By: md_5 <git@md-5.net>
This commit is contained in:
parent
0aece55e50
commit
fb99448954
1 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,30 @@
|
|||
--- a/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
||||
@@ -20,6 +20,10 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EntityMinecartTNT extends EntityMinecartAbstract {
|
||||
|
||||
private static final byte EVENT_PRIME = 10;
|
||||
@@ -106,7 +110,15 @@
|
||||
d1 = 5.0D;
|
||||
}
|
||||
|
||||
- this.level.explode(this, this.getX(), this.getY(), this.getZ(), (float) (4.0D + this.random.nextDouble() * 1.5D * d1), Explosion.Effect.BREAK);
|
||||
+ // CraftBukkit start
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) 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, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Explosion.Effect.BREAK);
|
||||
+ // CraftBukkit end
|
||||
this.discard();
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue