@@ -11,16 +11,16 @@
|
||||
@@ -8,6 +9,8 @@
|
||||
@Nullable
|
||||
private EntityLiving source;
|
||||
private int c;
|
||||
private int fuseTicks;
|
||||
+ public float yield = 4; // CraftBukkit - add field
|
||||
+ public boolean isIncendiary = false; // CraftBukkit - add field
|
||||
|
||||
public EntityTNTPrimed(World world) {
|
||||
super(EntityTypes.TNT, world);
|
||||
@@ -64,10 +67,13 @@
|
||||
public EntityTNTPrimed(EntityTypes<? extends EntityTNTPrimed> entitytypes, World world) {
|
||||
super(entitytypes, world);
|
||||
@@ -60,10 +63,13 @@
|
||||
|
||||
--this.c;
|
||||
if (this.c <= 0) {
|
||||
--this.fuseTicks;
|
||||
if (this.fuseTicks <= 0) {
|
||||
- this.die();
|
||||
+ // CraftBukkit start - Need to reverse the order of the explosion and the entity death so we have a location for the event
|
||||
+ // this.die();
|
||||
@@ -30,9 +30,9 @@
|
||||
+ this.die();
|
||||
+ // CraftBukkit end
|
||||
} else {
|
||||
this.at();
|
||||
this.world.addParticle(Particles.M, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||
@@ -76,9 +82,16 @@
|
||||
this.ax();
|
||||
this.world.addParticle(Particles.SMOKE, this.locX, this.locY + 0.5D, this.locZ, 0.0D, 0.0D, 0.0D);
|
||||
@@ -72,9 +78,16 @@
|
||||
}
|
||||
|
||||
private void explode() {
|
||||
@@ -40,14 +40,14 @@
|
||||
+ // CraftBukkit start
|
||||
+ // float f = 4.0F;
|
||||
|
||||
- this.world.explode(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, 4.0F, true);
|
||||
- this.world.explode(this, this.locX, this.locY + (double) (this.getHeight() / 16.0F), this.locZ, 4.0F, Explosion.Effect.BREAK);
|
||||
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) this.getBukkitEntity());
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ this.world.createExplosion(this, this.locX, this.locY + (double) (this.length / 16.0F), this.locZ, event.getRadius(), event.getFire(), true);
|
||||
+ this.world.createExplosion(this, this.locX, this.locY + (double) (this.getHeight() / 16.0F), this.locZ, event.getRadius(), event.getFire(), Explosion.Effect.BREAK);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
protected void b(NBTTagCompound nbttagcompound) {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user