@@ -5,13 +5,13 @@
|
||||
|
||||
+import org.bukkit.event.entity.EntityCombustByEntityEvent; // CraftBukkit
|
||||
+
|
||||
public class EntitySmallFireball extends EntityFireball {
|
||||
public class EntitySmallFireball extends EntityFireballFireball {
|
||||
|
||||
public EntitySmallFireball(World world) {
|
||||
public EntitySmallFireball(EntityTypes<? extends EntitySmallFireball> entitytypes, World world) {
|
||||
@@ -8,6 +10,11 @@
|
||||
|
||||
public EntitySmallFireball(World world, EntityLiving entityliving, double d0, double d1, double d2) {
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world, 0.3125F, 0.3125F);
|
||||
super(EntityTypes.SMALL_FIREBALL, entityliving, d0, d1, d2, world);
|
||||
+ // CraftBukkit start
|
||||
+ if (this.shooter != null && this.shooter instanceof EntityInsentient) {
|
||||
+ isIncendiary = this.world.getGameRules().getBoolean("mobGriefing");
|
||||
@@ -20,39 +20,34 @@
|
||||
}
|
||||
|
||||
public EntitySmallFireball(World world, double d0, double d1, double d2, double d3, double d4, double d5) {
|
||||
@@ -20,7 +27,16 @@
|
||||
@@ -21,18 +28,27 @@
|
||||
Entity entity = ((MovingObjectPositionEntity) movingobjectposition).getEntity();
|
||||
|
||||
if (movingobjectposition.entity != null) {
|
||||
if (!movingobjectposition.entity.isFireProof()) {
|
||||
- movingobjectposition.entity.setOnFire(5);
|
||||
if (!entity.isFireProof()) {
|
||||
- entity.setOnFire(5);
|
||||
+ // CraftBukkit start - Entity damage by entity event + combust event
|
||||
+ if (isIncendiary) {
|
||||
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), movingobjectposition.entity.getBukkitEntity(), 5);
|
||||
+ movingobjectposition.entity.world.getServer().getPluginManager().callEvent(event);
|
||||
+ EntityCombustByEntityEvent event = new EntityCombustByEntityEvent((org.bukkit.entity.Projectile) this.getBukkitEntity(), entity.getBukkitEntity(), 5);
|
||||
+ entity.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled()) {
|
||||
+ movingobjectposition.entity.setOnFire(event.getDuration(), false);
|
||||
+ entity.setOnFire(event.getDuration(), false);
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
flag = movingobjectposition.entity.damageEntity(DamageSource.fireball(this, this.shooter), 5.0F);
|
||||
boolean flag = entity.damageEntity(DamageSource.fireball(this, this.shooter), 5.0F);
|
||||
|
||||
if (flag) {
|
||||
this.a(this.shooter, movingobjectposition.entity);
|
||||
@@ -32,11 +48,15 @@
|
||||
flag = this.world.getGameRules().getBoolean("mobGriefing");
|
||||
}
|
||||
|
||||
- if (flag) {
|
||||
+ // CraftBukkit start
|
||||
+ if (isIncendiary) {
|
||||
BlockPosition blockposition = movingobjectposition.getBlockPosition().shift(movingobjectposition.direction);
|
||||
|
||||
if (this.world.isEmpty(blockposition)) {
|
||||
- this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, this).isCancelled()) {
|
||||
+ this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
this.a(this.shooter, entity);
|
||||
}
|
||||
}
|
||||
- } else if (this.shooter == null || !(this.shooter instanceof EntityInsentient) || this.world.getGameRules().getBoolean("mobGriefing")) {
|
||||
+ } else if (isIncendiary) { // CraftBukkit
|
||||
MovingObjectPositionBlock movingobjectpositionblock = (MovingObjectPositionBlock) movingobjectposition;
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition().shift(movingobjectpositionblock.getDirection());
|
||||
|
||||
- if (this.world.isEmpty(blockposition)) {
|
||||
+ if (this.world.isEmpty(blockposition) && !org.bukkit.craftbukkit.event.CraftEventFactory.callBlockIgniteEvent(world, blockposition, this).isCancelled()) { // CraftBukkit
|
||||
this.world.setTypeUpdate(blockposition, Blocks.FIRE.getBlockData());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user