@@ -12,22 +12,22 @@
|
||||
public class EntityMinecartTNT extends EntityMinecartAbstract {
|
||||
|
||||
private static final byte EVENT_PRIME = 10;
|
||||
@@ -33,6 +38,7 @@
|
||||
private static final float DEFAULT_EXPLOSION_POWER_BASE = 4.0F;
|
||||
@@ -37,6 +42,7 @@
|
||||
public int fuse = -1;
|
||||
public float explosionPowerBase = 4.0F;
|
||||
public float explosionSpeedFactor = 1.0F;
|
||||
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
||||
|
||||
public EntityMinecartTNT(EntityTypes<? extends EntityMinecartTNT> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -113,8 +119,16 @@
|
||||
@@ -117,8 +123,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);
|
||||
- worldserver.explode(this, damagesource, (ExplosionDamageCalculator) null, this.getX(), this.getY(), this.getZ(), (float) ((double) this.explosionPowerBase + (double) this.explosionSpeedFactor * this.random.nextDouble() * 1.5D * d1), false, World.a.TNT);
|
||||
- this.discard();
|
||||
+ // CraftBukkit start
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) ((double) this.explosionPowerBase + this.random.nextDouble() * 1.5D * d1), this.isIncendiary);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), (float) ((double) this.explosionPowerBase + (double) this.explosionSpeedFactor * this.random.nextDouble() * 1.5D * d1), this.isIncendiary);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ fuse = -1;
|
||||
|
||||
Reference in New Issue
Block a user