mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
Players can now turn while in Suffocate
This commit is contained in:
parent
a11eb336e6
commit
1e6f96a4c6
3 changed files with 13 additions and 34 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue