mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-12 03:59:06 +00:00
commit
9fac9957f3
7 changed files with 36 additions and 6 deletions
|
@ -5,6 +5,7 @@ import java.util.Arrays;
|
|||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
|
@ -157,6 +158,7 @@ public class PKListener implements Listener {
|
|||
ProjectKorra plugin;
|
||||
|
||||
public static HashMap<Player, String> bendingDeathPlayer = new HashMap<Player, String>(); // Player killed by Bending
|
||||
public static List<UUID> interact = new ArrayList<UUID>(); // Player right click block
|
||||
|
||||
public PKListener(ProjectKorra plugin) {
|
||||
this.plugin = plugin;
|
||||
|
@ -652,8 +654,12 @@ public class PKListener implements Listener {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
if (event.getSubElement() != null) {
|
||||
sb.append(event.getSubElement().getChatColor());
|
||||
} else if (event.getElement() != null) {
|
||||
sb.append(event.getElement().getChatColor());
|
||||
} else {
|
||||
if (event.getElement() != null) {
|
||||
sb.append(event.getElement().getChatColor());
|
||||
} else {
|
||||
sb.append(GeneralMethods.getAvatarColor());
|
||||
}
|
||||
}
|
||||
sb.append(event.getAbility());
|
||||
bendingDeathPlayer.put(event.getVictim(), sb.toString());
|
||||
|
@ -963,6 +969,15 @@ public class PKListener implements Listener {
|
|||
Player player = event.getPlayer();
|
||||
|
||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
final UUID uuid = player.getUniqueId();
|
||||
interact.add(uuid);
|
||||
|
||||
new BukkitRunnable() {
|
||||
public void run() {
|
||||
interact.remove(uuid);
|
||||
}
|
||||
}.runTaskLater(plugin, 5);
|
||||
|
||||
String ability = GeneralMethods.getBoundAbility(player);
|
||||
ComboManager.addComboAbility(player, ClickType.RIGHT_CLICK);
|
||||
if (ability != null && ability.equalsIgnoreCase("EarthSmash"))
|
||||
|
@ -1287,6 +1302,9 @@ public class PKListener implements Listener {
|
|||
return;
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (interact.contains(player.getUniqueId())) return;
|
||||
|
||||
ComboManager.addComboAbility(player, ClickType.LEFT_CLICK);
|
||||
|
||||
if (Suffocate.isBreathbent(player)) {
|
||||
|
|
|
@ -130,6 +130,9 @@ public class AirBlast implements ConfigLoadable {
|
|||
if (!origins.containsKey(player))
|
||||
return;
|
||||
Location origin = origins.get(player);
|
||||
if (player.isDead() || !player.isOnline())
|
||||
return;
|
||||
|
||||
if (!origin.getWorld().equals(player.getWorld())) {
|
||||
origins.remove(player);
|
||||
return;
|
||||
|
|
|
@ -229,6 +229,11 @@ public class AirCombo implements ConfigLoadable {
|
|||
currentLoc.add(direction.clone().multiply(speed));
|
||||
if (!EarthMethods.isTransparentToEarthbending(player, currentLoc.getBlock()))
|
||||
currentLoc.subtract(direction.clone().multiply(speed));
|
||||
|
||||
if (player.getWorld() != currentLoc.getWorld()) {
|
||||
remove();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Math.abs(player.getLocation().distance(currentLoc)) > range) {
|
||||
remove();
|
||||
|
|
|
@ -94,10 +94,9 @@ public class AirSpout implements ConfigLoadable {
|
|||
}
|
||||
|
||||
public boolean progress() {
|
||||
if (!GeneralMethods.canBend(player.getName(), "AirSpout")
|
||||
if (player.isDead() || !player.isOnline() || !GeneralMethods.canBend(player.getName(), "AirSpout")
|
||||
// || !Methods.hasAbility(player, Abilities.AirSpout)
|
||||
|| player.getEyeLocation().getBlock().isLiquid() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|
||||
|| player.isDead() || !player.isOnline()) {
|
||||
|| player.getEyeLocation().getBlock().isLiquid() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())) {
|
||||
remove();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -103,6 +103,9 @@ public class AirSuction implements ConfigLoadable {
|
|||
if (!origins.containsKey(player))
|
||||
return;
|
||||
Location origin = origins.get(player);
|
||||
if (player.isDead() || !player.isOnline())
|
||||
return;
|
||||
|
||||
if (!origin.getWorld().equals(player.getWorld())) {
|
||||
origins.remove(player);
|
||||
return;
|
||||
|
|
|
@ -76,6 +76,9 @@ public class HorizontalVelocityChangeEvent extends Event implements Cancellable
|
|||
}
|
||||
|
||||
public double getDistanceTraveled() {
|
||||
if (start.getWorld() != end.getWorld()) {
|
||||
return 0;
|
||||
}
|
||||
return start.distance(end);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ public class Flight {
|
|||
if (instances.containsKey(player)) {
|
||||
Flight flight = instances.get(player);
|
||||
flight.refresh(source);
|
||||
instances.replace(player, flight);
|
||||
return;
|
||||
}
|
||||
this.couldFly = player.getAllowFlight();
|
||||
|
|
Loading…
Reference in a new issue