Fixes SwiftKick

Fixes SwiftKick being able to be used when player hasn't / isn't jumping
This commit is contained in:
BuildTools 2016-05-01 08:13:53 +01:00
parent 8ee81c9c0e
commit 8b3b3c9739

View file

@ -5,6 +5,7 @@ import com.projectkorra.projectkorra.ability.ChiAbility;
import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.DamageHandler;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -33,6 +34,9 @@ public class SwiftKick extends ChiAbility {
remove(); remove();
return; return;
} }
if (player.getLocation().subtract(0, 0.5, 0).getBlock().getType() != Material.AIR) {
return;
}
DamageHandler.damageEntity(target, damage, this); DamageHandler.damageEntity(target, damage, this);
if (target instanceof Player && ChiPassive.willChiBlock(player, (Player) target)) { if (target instanceof Player && ChiPassive.willChiBlock(player, (Player) target)) {
ChiPassive.blockChi((Player) target); ChiPassive.blockChi((Player) target);