Flight, Chi Stance & Chris' life (#628)

* Fixed sprint with Flight. Fixed Acrobat & Warrior stance issues.

* Fixed Chris' Derp
This commit is contained in:
Sobki 2016-10-20 17:27:04 +10:00 committed by Christopher Martin
parent 2fdc59c0a5
commit 5f0dace64e
4 changed files with 28 additions and 14 deletions

View file

@ -1081,7 +1081,7 @@ public class PKListener implements Listener {
else if (AirFlight.isFlying(event.getPlayer())) {
if (AirFlight.isHovering(event.getPlayer())) {
Location loc = event.getFrom();
Location toLoc = player.getLocation();
Location toLoc = event.getTo();
if (loc.getX() != toLoc.getX() || loc.getY() != toLoc.getY() || loc.getZ() != toLoc.getZ()) {
event.setCancelled(true);

View file

@ -1,15 +1,15 @@
package com.projectkorra.projectkorra.chiblocking;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ChiAbility;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.ChiAbility;
public class AcrobatStance extends ChiAbility {
private int speed;
@ -30,11 +30,8 @@ public class AcrobatStance extends ChiAbility {
ChiAbility stance = bPlayer.getStance();
if (stance != null) {
stance.remove();
if (stance instanceof AcrobatStance) {
bPlayer.setStance(null);
GeneralMethods.displayMovePreview(player, this);
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_SHOOT, 0.5F, 2F);
remove();
return;
}
}
@ -59,6 +56,16 @@ public class AcrobatStance extends ChiAbility {
}
}
@Override
public void remove() {
super.remove();
bPlayer.setStance(null);
GeneralMethods.displayMovePreview(player, this);
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_SHOOT, 0.5F, 2F);
player.removePotionEffect(PotionEffectType.SPEED);
player.removePotionEffect(PotionEffectType.JUMP);
}
@Override
public String getName() {
return "AcrobatStance";

View file

@ -25,11 +25,8 @@ public class WarriorStance extends ChiAbility {
ChiAbility stance = bPlayer.getStance();
if (stance != null) {
stance.remove();
if (stance instanceof WarriorStance) {
bPlayer.setStance(null);
GeneralMethods.displayMovePreview(player, this);
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_SHOOT, 0.5F, 2F);
remove();
return;
}
}
@ -54,6 +51,16 @@ public class WarriorStance extends ChiAbility {
}
}
@Override
public void remove() {
super.remove();
bPlayer.setStance(null);
GeneralMethods.displayMovePreview(player, this);
player.playSound(player.getLocation(), Sound.ENTITY_ENDERDRAGON_SHOOT, 0.5F, 2F);
player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
}
@Override
public String getName() {
return "WarriorStance";

View file

@ -59,7 +59,7 @@ public class LogFilter implements Filter {
return false;
}
if(Bukkit.getServer().getPluginManager().isPluginEnabled(ProjectKorra.plugin.getName())) {
if (!Bukkit.getServer().getPluginManager().isPluginEnabled(ProjectKorra.plugin.getName())) {
return false;
}