3
0
KCauldronX/patches/net/minecraft/entity/projectile/EntityLargeFireball.java.patch

41 lines
1.8 KiB
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntityLargeFireball.java
@@ -9,6 +9,8 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
+
public class EntityLargeFireball extends EntityFireball
{
public int field_92057_e = 1;
@@ -39,7 +41,17 @@
p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F);
}
- this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ // CraftBukkit start
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.worldObj.getServer(), this));
+ this.worldObj.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled())
+ {
+ // give 'this' instead of (Entity) null so we know what causes the damage
+ this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, event.getRadius(), event.getFire(), this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"));
+ }
+
+ // CraftBukkit end
this.setDead();
}
}
@@ -56,7 +68,8 @@
if (p_70037_1_.hasKey("ExplosionPower", 99))
{
- this.field_92057_e = p_70037_1_.getInteger("ExplosionPower");
+ // CraftBukkit - set bukkitYield when setting explosionpower
+ this.bukkitYield = this.field_92057_e = p_70037_1_.getInteger("ExplosionPower");
}
}
}