Fixed AirSwipe, MetalClips & WallOfFire (#557)

* Re-PR for Flight fix

Added check to prevent multiple instances of Flight being created.

* Fixed AirSwipe, MetalClips & WallOfFire
This commit is contained in:
Sobki 2016-08-24 05:54:50 +10:00 committed by OmniCypher
parent 6bd5669417
commit bd3a40fd43
3 changed files with 18 additions and 15 deletions

View file

@ -266,10 +266,16 @@ public class AirSwipe extends AirAbility {
} }
public void progress() { public void progress() {
if (!bPlayer.canBendIgnoreCooldowns(this)) {
remove();
return;
}
if (player.isDead() || !player.isOnline()) { if (player.isDead() || !player.isOnline()) {
remove(); remove();
return; return;
} }
if (!charging) { if (!charging) {
if (elements.isEmpty()) { if (elements.isEmpty()) {
remove(); remove();

View file

@ -1,10 +1,10 @@
package com.projectkorra.projectkorra.earthbending; package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods; import java.util.ArrayList;
import com.projectkorra.projectkorra.ability.CoreAbility; import java.util.Arrays;
import com.projectkorra.projectkorra.ability.MetalAbility; import java.util.List;
import com.projectkorra.projectkorra.avatar.AvatarState; import java.util.Map;
import com.projectkorra.projectkorra.util.DamageHandler; import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -17,11 +17,11 @@ import org.bukkit.entity.Zombie;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.util.Vector; import org.bukkit.util.Vector;
import java.util.ArrayList; import com.projectkorra.projectkorra.GeneralMethods;
import java.util.Arrays; import com.projectkorra.projectkorra.ability.CoreAbility;
import java.util.List; import com.projectkorra.projectkorra.ability.MetalAbility;
import java.util.Map; import com.projectkorra.projectkorra.avatar.AvatarState;
import java.util.concurrent.ConcurrentHashMap; import com.projectkorra.projectkorra.util.DamageHandler;
public class MetalClips extends MetalAbility { public class MetalClips extends MetalAbility {
@ -221,6 +221,7 @@ public class MetalClips extends MetalAbility {
player.getWorld().dropItem(targetEntity.getLocation(), new ItemStack(Material.IRON_INGOT, metalClipsCount)); player.getWorld().dropItem(targetEntity.getLocation(), new ItemStack(Material.IRON_INGOT, metalClipsCount));
isBeingWorn = false; isBeingWorn = false;
bPlayer.addCooldown(this);
} }
public void launch() { public void launch() {
@ -468,10 +469,6 @@ public class MetalClips extends MetalAbility {
ENTITY_CLIPS_COUNT.remove(targetEntity); ENTITY_CLIPS_COUNT.remove(targetEntity);
TARGET_TO_ABILITY.remove(targetEntity); TARGET_TO_ABILITY.remove(targetEntity);
} }
if (player != null && player.isOnline()) {
bPlayer.addCooldown(this);
}
} }
public static boolean isControlled(LivingEntity player) { public static boolean isControlled(LivingEntity player) {

View file

@ -89,6 +89,7 @@ public class WallOfFire extends FireAbility {
} }
private void affect(Entity entity) { private void affect(Entity entity) {
GeneralMethods.setVelocity(entity, new Vector(0, 0, 0));
if (entity instanceof LivingEntity) { if (entity instanceof LivingEntity) {
Block block = ((LivingEntity) entity).getEyeLocation().getBlock(); Block block = ((LivingEntity) entity).getEyeLocation().getBlock();
if (TempBlock.isTempBlock(block) && isIce(block)) { if (TempBlock.isTempBlock(block) && isIce(block)) {
@ -98,7 +99,6 @@ public class WallOfFire extends FireAbility {
AirAbility.breakBreathbendingHold(entity); AirAbility.breakBreathbendingHold(entity);
} }
entity.setFireTicks((int) (fireTicks * 20)); entity.setFireTicks((int) (fireTicks * 20));
entity.setVelocity(player.getLocation().getDirection().multiply(1.4));
new FireDamageTimer(entity, player); new FireDamageTimer(entity, player);
} }