From e93395f71e3bf9d7d41fd9ae8e3e1dfcc494cccc Mon Sep 17 00:00:00 2001 From: Simplicitee Date: Fri, 12 Aug 2016 19:17:49 -0400 Subject: [PATCH] Fix metalclips (#536) * Fix metalclips - Removed a check that was preventing metalclips from progressing past 1 clip on a target. * Fix metalclips - Fixed a bug limiting the metal clip count to one --- .../projectkorra/earthbending/MetalClips.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/com/projectkorra/projectkorra/earthbending/MetalClips.java b/src/com/projectkorra/projectkorra/earthbending/MetalClips.java index ed3c4401..dc3491f4 100644 --- a/src/com/projectkorra/projectkorra/earthbending/MetalClips.java +++ b/src/com/projectkorra/projectkorra/earthbending/MetalClips.java @@ -414,10 +414,19 @@ public class MetalClips extends MetalAbility { for (Entity e : GeneralMethods.getEntitiesAroundPoint(ii.getLocation(), 2)) { if (e instanceof LivingEntity && e.getEntityId() != player.getEntityId()) { - if ((e instanceof Player || e instanceof Zombie || e instanceof Skeleton) && targetEntity == null) { - targetEntity = (LivingEntity) e; - TARGET_TO_ABILITY.put(targetEntity, this); - formArmor(); + if ((e instanceof Player || e instanceof Zombie || e instanceof Skeleton)) { + if (targetEntity == null) { + targetEntity = (LivingEntity) e; + TARGET_TO_ABILITY.put(targetEntity, this); + formArmor(); + } else if (targetEntity == e) { + formArmor(); + } else { + TARGET_TO_ABILITY.get(targetEntity).remove(); + targetEntity = (LivingEntity) e; + TARGET_TO_ABILITY.put(targetEntity, this); + formArmor(); + } } else { DamageHandler.damageEntity(e, 5, this); ii.getWorld().dropItem(ii.getLocation(), ii.getItemStack()); @@ -425,6 +434,7 @@ public class MetalClips extends MetalAbility { } ii.remove(); + break; } } }