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

45 lines
1.9 KiB
Diff
Raw Normal View History

2015-03-22 17:38:04 +00:00
--- ../src-base/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java
+++ ../src-work/minecraft/net/minecraft/entity/projectile/EntitySmallFireball.java
@@ -6,6 +6,8 @@
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
+
public class EntitySmallFireball extends EntityFireball
{
private static final String __OBFID = "CL_00001721";
@@ -36,7 +38,16 @@
{
if (!p_70227_1_.entityHit.isImmuneToFire() && p_70227_1_.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F))
{
- p_70227_1_.entityHit.setFire(5);
+ // CraftBukkit start - Entity damage by entity event + combust event
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), p_70227_1_.entityHit.getBukkitEntity(), 5);
+ p_70227_1_.entityHit.worldObj.getServer().getPluginManager().callEvent(event);
+
+ if (!event.isCancelled())
+ {
+ p_70227_1_.entityHit.setFire(event.getDuration());
+ }
+
+ // CraftBukkit end
}
}
else
@@ -68,7 +79,13 @@
if (this.worldObj.isAirBlock(i, j, k))
{
- this.worldObj.setBlock(i, j, k, Blocks.fire);
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(worldObj, i, j, k, this).isCancelled())
+ {
+ this.worldObj.setBlock(i, j, k, Blocks.fire);
+ }
+
+ // CraftBukkit end
}
}