1
0
forked from xjboss/KCauldronX
KCauldronX/patches/net/minecraft/entity/projectile/EntitySmallFireball.java.patch

57 lines
2.1 KiB
Diff
Raw Permalink 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
}
}
2015-06-05 13:41:54 +00:00
@@ -85,4 +102,11 @@
{
return false;
}
+
+ // Cauldron start
+ @Override
+ public boolean entityProjectileHook() {
2015-06-08 16:18:24 +00:00
+ return true;
2015-06-05 13:41:54 +00:00
+ }
+ // Cauldron end
}