@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
||||
+++ b/net/minecraft/world/entity/vehicle/EntityMinecartTNT.java
|
||||
@@ -23,6 +23,11 @@
|
||||
@@ -26,6 +26,11 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
@@ -12,20 +12,28 @@
|
||||
public class EntityMinecartTNT extends EntityMinecartAbstract {
|
||||
|
||||
private static final byte EVENT_PRIME = 10;
|
||||
@@ -113,8 +118,16 @@
|
||||
d1 = 5.0D;
|
||||
}
|
||||
@@ -33,6 +38,7 @@
|
||||
private static final float DEFAULT_EXPLOSION_POWER_BASE = 4.0F;
|
||||
public int fuse = -1;
|
||||
public float explosionPowerBase = 4.0F;
|
||||
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
||||
|
||||
- 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);
|
||||
public EntityMinecartTNT(EntityTypes<? extends EntityMinecartTNT> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -113,8 +119,16 @@
|
||||
if (world instanceof WorldServer worldserver) {
|
||||
double d1 = Math.min(Math.sqrt(d0), 5.0D);
|
||||
|
||||
- worldserver.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) ((double) this.explosionPowerBase + 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);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) ((double) this.explosionPowerBase + this.random.nextDouble() * 1.5D * d1), this.isIncendiary);
|
||||
+ worldserver.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);
|
||||
+ worldserver.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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user