2011-11-29 08:32:16 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2012-05-15 00:23:34 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
import org.bukkit.event.block.BlockIgniteEvent;
|
|
|
|
import org.bukkit.event.entity.EntityCombustByEntityEvent;
|
|
|
|
// CraftBukkit end
|
2011-11-29 11:26:55 +01:00
|
|
|
|
2011-11-29 08:32:16 +01:00
|
|
|
public class EntitySmallFireball extends EntityFireball {
|
|
|
|
|
|
|
|
public EntitySmallFireball(World world) {
|
|
|
|
super(world);
|
|
|
|
this.b(0.3125F, 0.3125F);
|
|
|
|
}
|
|
|
|
|
|
|
|
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
|
|
|
super(world, entityliving, d0, d1, d2);
|
|
|
|
this.b(0.3125F, 0.3125F);
|
|
|
|
}
|
|
|
|
|
2012-03-01 11:49:23 +01:00
|
|
|
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
|
|
|
super(world, d0, d1, d2, d3, d4, d5);
|
|
|
|
this.b(0.3125F, 0.3125F);
|
|
|
|
}
|
|
|
|
|
2011-11-29 08:32:16 +01:00
|
|
|
protected void a(MovingObjectPosition movingobjectposition) {
|
|
|
|
if (!this.world.isStatic) {
|
2012-03-12 23:55:02 +01:00
|
|
|
if (movingobjectposition.entity != null) {
|
|
|
|
if (!movingobjectposition.entity.isFireproof() && movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 5)) {
|
|
|
|
// CraftBukkit start - entity damage by entity event + combust event
|
|
|
|
EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), movingobjectposition.entity.getBukkitEntity(), 5);
|
|
|
|
movingobjectposition.entity.world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
movingobjectposition.entity.setOnFire(event.getDuration());
|
2011-11-29 11:26:55 +01:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2011-11-29 08:32:16 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
int i = movingobjectposition.b;
|
|
|
|
int j = movingobjectposition.c;
|
|
|
|
int k = movingobjectposition.d;
|
|
|
|
|
|
|
|
switch (movingobjectposition.face) {
|
|
|
|
case 0:
|
|
|
|
--j;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
++j;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
--k;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 3:
|
|
|
|
++k;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 4:
|
|
|
|
--i;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 5:
|
|
|
|
++i;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.world.isEmpty(i, j, k)) {
|
2012-05-15 00:23:34 +02:00
|
|
|
// CraftBukkit start
|
|
|
|
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
|
|
|
|
BlockIgniteEvent event = new BlockIgniteEvent(block, BlockIgniteEvent.IgniteCause.FIREBALL, null);
|
|
|
|
world.getServer().getPluginManager().callEvent(event);
|
|
|
|
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
this.world.setTypeId(i, j, k, Block.FIRE.id);
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2011-11-29 08:32:16 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this.die();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-01 11:49:23 +01:00
|
|
|
public boolean o_() {
|
2011-11-29 08:32:16 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean damageEntity(DamageSource damagesource, int i) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|