Fixed FireBlast and Combustion not respecting "canFireGrief" (#522)

* Fixed torrent temp flooding.

* Fixed IceWave cooldown.

* Fixed fireblast and combustion not respecting "canFireGrief"
This commit is contained in:
Jay Stannon 2016-07-27 16:07:48 +10:00 committed by OmniCypher
parent db61b0d979
commit 5eed58d9d4
2 changed files with 9 additions and 7 deletions

View file

@ -98,12 +98,14 @@ public class Combustion extends CombustionAbility {
} }
private void createExplosion(Location block, float power, boolean canBreakBlocks) { private void createExplosion(Location block, float power, boolean canBreakBlocks) {
block.getWorld().createExplosion(block.getX(), block.getY(), block.getZ(), power, true, canBreakBlocks); if(canFireGrief()) {
for (Entity entity : block.getWorld().getEntities()) { block.getWorld().createExplosion(block.getX(), block.getY(), block.getZ(), power, true, canBreakBlocks);
if (entity instanceof LivingEntity) { }
if (entity.getLocation().distanceSquared(block) < radius * radius) { // They are close enough to the explosion. for (Entity entity : block.getWorld().getEntities()) {
DamageHandler.damageEntity((LivingEntity) entity, damage, this); if (entity instanceof LivingEntity) {
AirAbility.breakBreathbendingHold(entity); if (entity.getLocation().distanceSquared(block) < radius * radius) { // They are close enough to the explosion.
DamageHandler.damageEntity((LivingEntity) entity, damage, this);
AirAbility.breakBreathbendingHold(entity);
} }
} }
} }

View file

@ -149,7 +149,7 @@ public class FireBlastCharged extends FireAbility {
public void explode() { public void explode() {
boolean explode = true; boolean explode = true;
for (Block block : GeneralMethods.getBlocksAroundPoint(location, 3)) { for (Block block : GeneralMethods.getBlocksAroundPoint(location, 3)) {
if (GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation())) { if (GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation()) || !canFireGrief()) {
explode = false; explode = false;
break; break;
} }