2012-10-25 05:53:23 +02:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
|
|
|
|
|
|
|
|
public class EntityLargeFireball extends EntityFireball {
|
|
|
|
|
2012-12-20 05:03:52 +01:00
|
|
|
public int e = 1;
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
public EntityLargeFireball(World world) {
|
|
|
|
super(world);
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntityLargeFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
|
|
|
super(world, entityliving, d0, d1, d2);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
|
|
|
if (!this.world.isStatic) {
|
|
|
|
if (movingobjectposition.entity != null) {
|
|
|
|
movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 6);
|
|
|
|
}
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this));
|
|
|
|
this.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
// give 'this' instead of (Entity) null so we know what causes the damage
|
|
|
|
this.world.createExplosion(this, this.locX, this.locY, this.locZ, event.getRadius(), event.getFire(), this.world.getGameRules().getBoolean("mobGriefing"));
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
}
|
2013-01-27 21:46:58 +01:00
|
|
|
|
|
|
|
public void b(NBTTagCompound nbttagcompound) {
|
|
|
|
super.b(nbttagcompound);
|
|
|
|
nbttagcompound.setInt("ExplosionPower", this.e);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void a(NBTTagCompound nbttagcompound) {
|
|
|
|
super.a(nbttagcompound);
|
|
|
|
if (nbttagcompound.hasKey("ExplosionPower")) {
|
|
|
|
// CraftBukkit - set yield when setting explosionpower
|
|
|
|
this.yield = this.e = nbttagcompound.getInt("ExplosionPower");
|
|
|
|
}
|
|
|
|
}
|
2012-10-25 05:53:23 +02:00
|
|
|
}
|