diff --git a/src/com/projectkorra/ProjectKorra/PKListener.java b/src/com/projectkorra/ProjectKorra/PKListener.java index 06a121d3..d19d3cd9 100644 --- a/src/com/projectkorra/ProjectKorra/PKListener.java +++ b/src/com/projectkorra/ProjectKorra/PKListener.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Location; @@ -485,6 +486,16 @@ public class PKListener implements Listener { event.setCancelled(true); return; } + + if (Suffocate.isBreathbent(player)) { + Location loc = event.getFrom(); + Location toLoc = player.getLocation(); + + if (loc.getX() != toLoc.getX() || loc.getY() != toLoc.getY() || loc.getZ() != toLoc.getZ()) { + event.setCancelled(true); + return; + } + } if (WaterSpout.instances.containsKey(event.getPlayer()) || AirSpout.getPlayers().contains(event.getPlayer())) { Vector vel = new Vector(); @@ -514,10 +525,6 @@ public class PKListener implements Listener { player.setVelocity(new Vector(0, 0, 0)); } } - - if(Suffocate.isBreathbent(player)) { - player.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 1, 100)); - } } @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) diff --git a/src/com/projectkorra/ProjectKorra/airbending/Suffocate.java b/src/com/projectkorra/ProjectKorra/airbending/Suffocate.java index 8002d93f..c8260d98 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/Suffocate.java +++ b/src/com/projectkorra/ProjectKorra/airbending/Suffocate.java @@ -142,7 +142,7 @@ public class Suffocate { new TempPotionEffect((LivingEntity) entity, nausea); if (System.currentTimeMillis() >= time + warmup) { Methods.damageEntity(player, entity, damage); - entity.teleport(entity); +// entity.teleport(entity); } } } catch (ConcurrentModificationException e) { diff --git a/src/com/projectkorra/ProjectKorra/firebending/Combustion.java b/src/com/projectkorra/ProjectKorra/firebending/Combustion.java index 3fad0e90..4c47264f 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/Combustion.java +++ b/src/com/projectkorra/ProjectKorra/firebending/Combustion.java @@ -7,6 +7,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.configuration.file.FileConfiguration; +import org.bukkit.entity.Creeper; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -140,35 +141,6 @@ public class Combustion { advanceLocation(); - - // long warmup = chargeTime; - // if (AvatarState.isAvatarState(player)) { - // warmup = 0; - // } - // - // if (System.currentTimeMillis() > starttime + warmup) { - // charged = true; - // } - // - // if (charged) { - // if (player.isSneaking()) { - // player.getWorld().playEffect(player.getEyeLocation(), Effect.SMOKE, 4, 3); - // } else { - // launchFireball(); - // cooldowns.put(player.getName(), System.currentTimeMillis()); - // instances.remove(player); - // } - // } else { - // if (!player.isSneaking()) { - // instances.remove(player); - // } - // } - // - // for (Entity entity: player.getWorld().getEntities()) { - // if (fireballs.contains(entity.getEntityId())) { - // ParticleEffect.CLOUD.display(entity.getLocation(), 1.0F, 1.0F, 1.0F, 1.0F, 30); - // } - // } } private void createExplosion(Location block, float power, boolean breakblocks) {