From 7e075fe2b7641d042eada921e1da1433f068989e Mon Sep 17 00:00:00 2001 From: StrangeOne101 Date: Tue, 7 Jun 2016 16:15:55 +1200 Subject: [PATCH] Bug fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Fixed WaterArms Spear not removing, even forcefully • Fixes FireBlast still loading when disabled • Fixes FireBlast still being able to be charged when on a different slot • Fixed NPE --- src/com/projectkorra/projectkorra/PKListener.java | 3 ++- .../projectkorra/projectkorra/firebending/FireBlast.java | 9 +++++++++ .../projectkorra/firebending/FireBlastCharged.java | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/com/projectkorra/projectkorra/PKListener.java b/src/com/projectkorra/projectkorra/PKListener.java index 088703a4..24964bf0 100644 --- a/src/com/projectkorra/projectkorra/PKListener.java +++ b/src/com/projectkorra/projectkorra/PKListener.java @@ -389,7 +389,8 @@ public class PKListener implements Listener { @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) public void onEntityDamageByBlock(EntityDamageByBlockEvent event) { Block block = event.getDamager(); - + if (block == null) return; + if (TempBlock.isTempBlock(block)) { if (EarthAbility.isEarthbendable(block.getType()) && GeneralMethods.isSolid(block)) { event.setCancelled(true); diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlast.java b/src/com/projectkorra/projectkorra/firebending/FireBlast.java index df6f34c8..c65f62ce 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlast.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlast.java @@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.firebending; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.AirAbility; +import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.WaterAbility; import com.projectkorra.projectkorra.avatar.AvatarState; @@ -164,6 +165,14 @@ public class FireBlast extends FireAbility { return; } + if (isFireBurst && !bPlayer.canBend(CoreAbility.getAbility("FireBurst"))) { + remove(); + return; + } else if (!isFireBurst && !bPlayer.canBend(CoreAbility.getAbility("FireBlast"))) { + remove(); + return; + } + speedFactor = speed * (ProjectKorra.time_step / 1000.0); ticks++; diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java index 8c9a9485..3cf9a581 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java @@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.firebending; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.AirAbility; +import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.util.DamageHandler; @@ -233,7 +234,11 @@ public class FireBlastCharged extends FireAbility { if (!bPlayer.canBendIgnoreBindsCooldowns(this) && !launched) { remove(); return; - } else if (!player.isSneaking() && !charged) { + } else if (!bPlayer.canBend(CoreAbility.getAbility("FireBlast")) && !launched) { + remove(); + return; + } + else if (!player.isSneaking() && !charged) { remove(); return; }