WaterSpout

This commit is contained in:
MistPhizzle 2014-06-24 21:36:27 -04:00
parent 44bf1c361f
commit 142b4b34eb
6 changed files with 296 additions and 33 deletions

View file

@ -26,6 +26,7 @@ import com.projectkorra.ProjectKorra.firebending.FireStream;
import com.projectkorra.ProjectKorra.waterbending.Bloodbending; import com.projectkorra.ProjectKorra.waterbending.Bloodbending;
import com.projectkorra.ProjectKorra.waterbending.Plantbending; import com.projectkorra.ProjectKorra.waterbending.Plantbending;
import com.projectkorra.ProjectKorra.waterbending.WaterPassive; import com.projectkorra.ProjectKorra.waterbending.WaterPassive;
import com.projectkorra.ProjectKorra.waterbending.WaterSpout;
public class BendingManager implements Runnable { public class BendingManager implements Runnable {
@ -69,7 +70,7 @@ public class BendingManager implements Runnable {
FireJet.progressAll(); FireJet.progressAll();
AirScooter.progressAll(); AirScooter.progressAll();
AirSpout.spoutAll(); AirSpout.spoutAll();
WaterSpout.handleSpouts(Bukkit.getServer());
for (int ID: Tornado.instances.keySet()) { for (int ID: Tornado.instances.keySet()) {
Tornado.progress(ID); Tornado.progress(ID);
} }

View file

@ -8,16 +8,16 @@ import org.bukkit.entity.Player;
public class ConfigManager { public class ConfigManager {
static ProjectKorra plugin; static ProjectKorra plugin;
public ConfigManager(ProjectKorra plugin) { public ConfigManager(ProjectKorra plugin) {
ConfigManager.plugin = plugin; ConfigManager.plugin = plugin;
configCheck(); configCheck();
} }
public static void configCheck() { public static void configCheck() {
FileConfiguration config = ProjectKorra.plugin.getConfig(); FileConfiguration config = ProjectKorra.plugin.getConfig();
ArrayList<String> earthbendable = new ArrayList<String>(); ArrayList<String> earthbendable = new ArrayList<String>();
earthbendable.add("STONE"); earthbendable.add("STONE");
earthbendable.add("COAL_ORE"); earthbendable.add("COAL_ORE");
@ -32,35 +32,35 @@ public class ConfigManager {
earthbendable.add("REDSTONE_ORE"); earthbendable.add("REDSTONE_ORE");
earthbendable.add("SAND"); earthbendable.add("SAND");
earthbendable.add("SANDSTONE"); earthbendable.add("SANDSTONE");
plugin.getConfig().addDefault("Properties.GlobalCooldown", 500); plugin.getConfig().addDefault("Properties.GlobalCooldown", 500);
plugin.getConfig().addDefault("Properties.SeaLevel", 62); plugin.getConfig().addDefault("Properties.SeaLevel", 62);
plugin.getConfig().addDefault("Properties.Air.CanBendWithWeapons", false); plugin.getConfig().addDefault("Properties.Air.CanBendWithWeapons", false);
plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true); plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Water.NightFactor", 1.5); plugin.getConfig().addDefault("Properties.Water.NightFactor", 1.5);
plugin.getConfig().addDefault("Properties.Earth.CanBendWithWeapons", true); plugin.getConfig().addDefault("Properties.Earth.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Earth.EarthbendableBlocks", earthbendable); plugin.getConfig().addDefault("Properties.Earth.EarthbendableBlocks", earthbendable);
plugin.getConfig().addDefault("Properties.Fire.CanBendWithWeapons", true); plugin.getConfig().addDefault("Properties.Fire.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Fire.DayFactor", 1.5); plugin.getConfig().addDefault("Properties.Fire.DayFactor", 1.5);
plugin.getConfig().addDefault("Properties.Chi.CanBendWithWeapons", true); plugin.getConfig().addDefault("Properties.Chi.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Abilities.AvatarState.Enabled", true); plugin.getConfig().addDefault("Abilities.AvatarState.Enabled", true);
plugin.getConfig().addDefault("Abilities.AvatarState.Description", "The signature ability of the Avatar, this is a toggle. Click to activate to become " plugin.getConfig().addDefault("Abilities.AvatarState.Description", "The signature ability of the Avatar, this is a toggle. Click to activate to become "
+ "nearly unstoppable. While in the Avatar State, the user takes severely reduced damage from " + "nearly unstoppable. While in the Avatar State, the user takes severely reduced damage from "
+ "all sources, regenerates health rapidly, and is granted extreme speed. Nearly all abilities " + "all sources, regenerates health rapidly, and is granted extreme speed. Nearly all abilities "
+ "are incredibly amplified in this state. Additionally, AirShield and FireJet become toggle-able " + "are incredibly amplified in this state. Additionally, AirShield and FireJet become toggle-able "
+ "abilities and last until you deactivate them or the Avatar State. Click again with the Avatar " + "abilities and last until you deactivate them or the Avatar State. Click again with the Avatar "
+ "State selected to deactivate it."); + "State selected to deactivate it.");
plugin.getConfig().addDefault("Abilities.Air.Passive.Factor", 0.3); plugin.getConfig().addDefault("Abilities.Air.Passive.Factor", 0.3);
plugin.getConfig().addDefault("Abilities.Air.Passive.Speed", 2); plugin.getConfig().addDefault("Abilities.Air.Passive.Speed", 2);
plugin.getConfig().addDefault("Abilities.Air.Passive.Jump", 3); plugin.getConfig().addDefault("Abilities.Air.Passive.Jump", 3);
config.addDefault("Abilities.Air.AirBlast.Enabled", true); config.addDefault("Abilities.Air.AirBlast.Enabled", true);
config.addDefault("Abilities.Air.AirBlast.Description", "AirBlast is the most fundamental bending technique of an airbender." config.addDefault("Abilities.Air.AirBlast.Description", "AirBlast is the most fundamental bending technique of an airbender."
+ " To use, simply left-click in a direction. A gust of wind will be" + " To use, simply left-click in a direction. A gust of wind will be"
@ -72,7 +72,7 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirBlast.Range", 20); config.addDefault("Abilities.Air.AirBlast.Range", 20);
config.addDefault("Abilities.Air.AirBlast.Radius", 2); config.addDefault("Abilities.Air.AirBlast.Radius", 2);
config.addDefault("Abilities.Air.AirBlast.Push", 3.5); config.addDefault("Abilities.Air.AirBlast.Push", 3.5);
config.addDefault("Abilities.Air.AirBurst.Enabled", true); config.addDefault("Abilities.Air.AirBurst.Enabled", true);
config.addDefault("Abilities.Air.AirBurst.Description", "AirBurst is one of the most powerful abilities in the airbender's arsenal. " config.addDefault("Abilities.Air.AirBurst.Description", "AirBurst is one of the most powerful abilities in the airbender's arsenal. "
+ "To use, press and hold sneak to charge your burst. " + "To use, press and hold sneak to charge your burst. "
@ -80,7 +80,7 @@ public class ConfigManager {
+ "of air in front of you, or click to release the burst in a sphere around you. " + "of air in front of you, or click to release the burst in a sphere around you. "
+ "Additionally, having this ability selected when you land on the ground from a " + "Additionally, having this ability selected when you land on the ground from a "
+ "large enough fall will create a burst of air around you."); + "large enough fall will create a burst of air around you.");
config.addDefault("Abilities.Air.AirScooter.Enabled", true); config.addDefault("Abilities.Air.AirScooter.Enabled", true);
config.addDefault("Abilities.Air.AirScooter.Description", "AirScooter is a fast means of transportation. To use, sprint, jump then click with " config.addDefault("Abilities.Air.AirScooter.Description", "AirScooter is a fast means of transportation. To use, sprint, jump then click with "
+ "this ability selected. You will hop on a scooter of air and be propelled forward " + "this ability selected. You will hop on a scooter of air and be propelled forward "
@ -88,7 +88,7 @@ public class ConfigManager {
+ "This ability can be used to levitate above liquids, but it cannot go up steep slopes. " + "This ability can be used to levitate above liquids, but it cannot go up steep slopes. "
+ "Any other actions will deactivate this ability."); + "Any other actions will deactivate this ability.");
config.addDefault("Abilities.Air.AirScooter.Speed", .675); config.addDefault("Abilities.Air.AirScooter.Speed", .675);
plugin.getConfig().addDefault("Abilities.Air.Tornado.Enabled", true); plugin.getConfig().addDefault("Abilities.Air.Tornado.Enabled", true);
plugin.getConfig().addDefault("Abilities.Air.Tornado.Description", "To use, simply sneak (default: shift). " plugin.getConfig().addDefault("Abilities.Air.Tornado.Description", "To use, simply sneak (default: shift). "
+ "This will create a swirling vortex at the targeted location. " + "This will create a swirling vortex at the targeted location. "
@ -100,22 +100,22 @@ public class ConfigManager {
+ "fall out of the vortex, it will take him to a maximum height and move him in " + "fall out of the vortex, it will take him to a maximum height and move him in "
+ "the general direction he's looking. Skilled airbenders can scale anything " + "the general direction he's looking. Skilled airbenders can scale anything "
+ "with this ability."); + "with this ability.");
config.addDefault("Abilities.Air.AirSpout.Enabled", true); config.addDefault("Abilities.Air.AirSpout.Enabled", true);
config.addDefault("Abilities.Air.AirSpout.Description", "This ability gives the airbender limited sustained levitation. It is a " config.addDefault("Abilities.Air.AirSpout.Description", "This ability gives the airbender limited sustained levitation. It is a "
+ "toggle - click to activate and form a whirling spout of air " + "toggle - click to activate and form a whirling spout of air "
+ "beneath you, lifting you up. You can bend other abilities while using AirSpout. " + "beneath you, lifting you up. You can bend other abilities while using AirSpout. "
+ "Click again to deactivate this ability."); + "Click again to deactivate this ability.");
config.addDefault("Abilities.Air.AirSpout.Height", 20); config.addDefault("Abilities.Air.AirSpout.Height", 20);
config.addDefault("Abilities.Air.Tornado.Radius", 10); config.addDefault("Abilities.Air.Tornado.Radius", 10);
config.addDefault("Abilities.Air.Tornado.Height", 25); config.addDefault("Abilities.Air.Tornado.Height", 25);
config.addDefault("Abilities.Air.Tornado.Range", 25); config.addDefault("Abilities.Air.Tornado.Range", 25);
config.addDefault("Abilities.Air.Tornado.MobPushFactor", 1); config.addDefault("Abilities.Air.Tornado.MobPushFactor", 1);
config.addDefault("Abilities.Air.Tornado.PlayerPushFactor", 1); config.addDefault("Abilities.Air.Tornado.PlayerPushFactor", 1);
plugin.getConfig().addDefault("Abilities.Water.Passive.SwimSpeedFactor", 0.7); plugin.getConfig().addDefault("Abilities.Water.Passive.SwimSpeedFactor", 0.7);
config.addDefault("Abilities.Water.Bloodbending.Enabled", true); config.addDefault("Abilities.Water.Bloodbending.Enabled", true);
config.addDefault("Abilities.Water.Bloodbending.Description", "This ability was made illegal for a reason. With this ability selected, sneak while " config.addDefault("Abilities.Water.Bloodbending.Description", "This ability was made illegal for a reason. With this ability selected, sneak while "
+ "targetting something and you will bloodbend that target. Bloodbent targets cannot move, " + "targetting something and you will bloodbend that target. Bloodbent targets cannot move, "
@ -125,12 +125,19 @@ public class ConfigManager {
+ "People who are capable of bloodbending are immune to your technique, and you are immune to theirs."); + "People who are capable of bloodbending are immune to your technique, and you are immune to theirs.");
config.addDefault("Abilities.Water.Bloodbending.ThrowFactor", 2); config.addDefault("Abilities.Water.Bloodbending.ThrowFactor", 2);
config.addDefault("Abilities.Water.Bloodbending.Range", 10); config.addDefault("Abilities.Water.Bloodbending.Range", 10);
plugin.getConfig().addDefault("Abilities.Water.Plantbending.RegrowTime", 180000); plugin.getConfig().addDefault("Abilities.Water.Plantbending.RegrowTime", 180000);
config.addDefault("Abilities.Water.WaterSpout.Enabled", true);
config.addDefault("Abilities.Water.WaterSpout.Description", "To use this ability, click while over or in water. "
+ "You will spout water up from beneath you to experience controlled levitation. "
+ "This ability is a toggle, so you can activate it then use other abilities and it "
+ "will remain on. If you try to spout over an area with no water, snow or ice, "
+ "the spout will dissipate and you will fall. Click again with this ability selected to deactivate it.");
config.addDefault("Abilities.Water.WaterSpout.Height", 20);
plugin.getConfig().addDefault("Abilities.Earth.Passive.Duration", 2500); plugin.getConfig().addDefault("Abilities.Earth.Passive.Duration", 2500);
config.addDefault("Abilities.Fire.FireJet.Enabled", true); config.addDefault("Abilities.Fire.FireJet.Enabled", true);
config.addDefault("Abilities.Fire.FireJet.Description", "This ability is used for a limited burst of flight for firebenders. Clicking with this " config.addDefault("Abilities.Fire.FireJet.Description", "This ability is used for a limited burst of flight for firebenders. Clicking with this "
+ "ability selected will launch you in the direction you're looking, granting you " + "ability selected will launch you in the direction you're looking, granting you "
@ -140,25 +147,25 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireJet.Speed", 0.7); config.addDefault("Abilities.Fire.FireJet.Speed", 0.7);
config.addDefault("Abilities.Fire.FireJet.Duration", 1500); config.addDefault("Abilities.Fire.FireJet.Duration", 1500);
config.addDefault("Abilities.Fire.FireJet.Cooldown", 6000); config.addDefault("Abilities.Fire.FireJet.Cooldown", 6000);
plugin.getConfig().addDefault("Abilities.Chi.Passive.FallReductionFactor", 0.5); plugin.getConfig().addDefault("Abilities.Chi.Passive.FallReductionFactor", 0.5);
plugin.getConfig().addDefault("Abilities.Chi.Passive.Speed", 1); plugin.getConfig().addDefault("Abilities.Chi.Passive.Speed", 1);
plugin.getConfig().addDefault("Abilities.Chi.Passive.Jump", 2); plugin.getConfig().addDefault("Abilities.Chi.Passive.Jump", 2);
config.addDefault("Abilities.Chi.Paralyze.Enabled", true); config.addDefault("Abilities.Chi.Paralyze.Enabled", true);
config.addDefault("Abilities.Chi.Paralyze.Description", "Paralyzes the target, making them unable to do anything for a short " config.addDefault("Abilities.Chi.Paralyze.Description", "Paralyzes the target, making them unable to do anything for a short "
+ "period of time. This ability has a long cooldown."); + "period of time. This ability has a long cooldown.");
config.addDefault("Abilities.Chi.Paralyze.Cooldown", 15000); config.addDefault("Abilities.Chi.Paralyze.Cooldown", 15000);
config.addDefault("Abilities.Chi.Paralyze.Duration", 2000); config.addDefault("Abilities.Chi.Paralyze.Duration", 2000);
plugin.getConfig().addDefault("Storage.engine", "sqlite"); plugin.getConfig().addDefault("Storage.engine", "sqlite");
plugin.getConfig().addDefault("Storage.MySQL.host", "localhost"); plugin.getConfig().addDefault("Storage.MySQL.host", "localhost");
plugin.getConfig().addDefault("Storage.MySQL.port", 3306); plugin.getConfig().addDefault("Storage.MySQL.port", 3306);
plugin.getConfig().addDefault("Storage.MySQL.pass", ""); plugin.getConfig().addDefault("Storage.MySQL.pass", "");
plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft"); plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft");
plugin.getConfig().addDefault("Storage.MySQL.user", "root"); plugin.getConfig().addDefault("Storage.MySQL.user", "root");
plugin.getConfig().options().copyDefaults(true); plugin.getConfig().options().copyDefaults(true);
plugin.saveConfig(); plugin.saveConfig();
} }

View file

@ -12,6 +12,7 @@ import com.projectkorra.ProjectKorra.airbending.AirSpout;
import com.projectkorra.ProjectKorra.airbending.Tornado; import com.projectkorra.ProjectKorra.airbending.Tornado;
import com.projectkorra.ProjectKorra.firebending.FireJet; import com.projectkorra.ProjectKorra.firebending.FireJet;
import com.projectkorra.ProjectKorra.waterbending.Bloodbending; import com.projectkorra.ProjectKorra.waterbending.Bloodbending;
import com.projectkorra.ProjectKorra.waterbending.WaterSpout;
public class Flight { public class Flight {

View file

@ -56,6 +56,7 @@ import com.projectkorra.ProjectKorra.firebending.FireStream;
import com.projectkorra.ProjectKorra.waterbending.Bloodbending; import com.projectkorra.ProjectKorra.waterbending.Bloodbending;
import com.projectkorra.ProjectKorra.waterbending.WaterCore; import com.projectkorra.ProjectKorra.waterbending.WaterCore;
import com.projectkorra.ProjectKorra.waterbending.WaterPassive; import com.projectkorra.ProjectKorra.waterbending.WaterPassive;
import com.projectkorra.ProjectKorra.waterbending.WaterSpout;
public class PKListener implements Listener { public class PKListener implements Listener {
@ -160,6 +161,9 @@ public class PKListener implements Listener {
if (abil.equalsIgnoreCase("Bloodbending")) { if (abil.equalsIgnoreCase("Bloodbending")) {
new Bloodbending(player); new Bloodbending(player);
} }
if (abil.equalsIgnoreCase("WaterSpout")) {
new WaterSpout(player);
}
} }
} }
} }

View file

@ -0,0 +1,246 @@
package com.projectkorra.ProjectKorra.waterbending;
import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffectType;
import com.projectkorra.ProjectKorra.Flight;
import com.projectkorra.ProjectKorra.Methods;
import com.projectkorra.ProjectKorra.ProjectKorra;
import com.projectkorra.ProjectKorra.TempBlock;
public class WaterSpout {
public static ConcurrentHashMap<Player, WaterSpout> instances = new ConcurrentHashMap<Player, WaterSpout>();
public static ConcurrentHashMap<Block, Block> affectedblocks = new ConcurrentHashMap<Block, Block>();
public static ConcurrentHashMap<Block, Block> newaffectedblocks = new ConcurrentHashMap<Block, Block>();
public static ConcurrentHashMap<Block, Block> baseblocks = new ConcurrentHashMap<Block, Block>();
private static final int defaultheight = ProjectKorra.plugin.getConfig().getInt("Abilities.Water.WaterSpout.Height");
// private static final double threshold = .05;
// private static final byte half = 0x4;
private static final byte full = 0x0;
private Player player;
private Block base;
private TempBlock baseblock;
public WaterSpout(Player player) {
// if (BendingPlayer.getBendingPlayer(player).isOnCooldown(
// Abilities.WaterSpout))
// return;
if (instances.containsKey(player)) {
instances.get(player).remove();
return;
}
this.player = player;
new Flight(player);
player.setAllowFlight(true);
instances.put(player, this);
spout(player);
}
private void remove() {
revertBaseBlock(player);
instances.remove(player);
}
public static void handleSpouts(Server server) {
// affectedblocks.clear();
newaffectedblocks.clear();
for (Player player : instances.keySet()) {
if (!player.isOnline() || player.isDead()) {
instances.get(player).remove();
} else if (Methods.canBend(player.getName(), "WaterSpout")) {
spout(player);
} else {
instances.get(player).remove();
}
}
for (Block block : affectedblocks.keySet()) {
if (!newaffectedblocks.containsKey(block)) {
remove(block);
}
}
// for (Block block : affectedblocks.keySet()) {
// boolean remove = true;
// for (Player player : instances.keySet()) {
// if (Methods.hasAbility(player, Abilities.WaterSpout)
// && Methods.canBend(player, Abilities.WaterSpout)
// && player.getWorld() == block.getWorld()) {
// Location loc1 = player.getLocation().clone();
// loc1.setY(0);
// Location loc2 = block.getLocation().clone();
// loc2.setY(0);
// if (loc1.distance(loc2) < 1)
// remove = false;
// }
// }
// if (remove)
// remove(block);
// }
}
private static void remove(Block block) {
affectedblocks.remove(block);
TempBlock.revertBlock(block, Material.AIR);
// block.setType(Material.AIR);
// block.setData(half);
}
public static void spout(Player player) {
WaterSpout spout = instances.get(player);
player.setFallDistance(0);
player.setSprinting(false);
// if (player.getVelocity().length() > threshold) {
// // Methods.verbose("Too fast!");
// player.setVelocity(player.getVelocity().clone().normalize()
// .multiply(threshold * .5));
// }
player.removePotionEffect(PotionEffectType.SPEED);
Location location = player.getLocation().clone().add(0, .2, 0);
Block block = location.clone().getBlock();
int height = spoutableWaterHeight(location, player);
// Methods.verbose(height + " " + WaterSpout.height + " "
// + affectedblocks.size());
if (height != -1) {
location = spout.base.getLocation();
for (int i = 1; i <= height; i++) {
block = location.clone().add(0, i, 0).getBlock();
if (!TempBlock.isTempBlock(block)) {
new TempBlock(block, Material.WATER, full);
}
// block.setType(Material.WATER);
// block.setData(full);
if (!affectedblocks.containsKey(block)) {
affectedblocks.put(block, block);
}
newaffectedblocks.put(block, block);
}
if (player.getLocation().getBlockY() > block.getY()) {
player.setFlying(false);
} else {
new Flight(player);
player.setAllowFlight(true);
player.setFlying(true);
}
} else {
instances.get(player).remove();
}
}
private static int spoutableWaterHeight(Location location, Player player) {
WaterSpout spout = instances.get(player);
int height = defaultheight;
if (Methods.isNight(player.getWorld()))
height = (int) Methods.waterbendingNightAugment((double) height,
player.getWorld());
int maxheight = (int) ((double) defaultheight * ProjectKorra.plugin.getConfig().getDouble("Properties.Water.NightFactor")) + 5;
Block blocki;
for (int i = 0; i < maxheight; i++) {
blocki = location.clone().add(0, -i, 0).getBlock();
// if (Methods.isRegionProtectedFromBuild(player, Abilities.WaterSpout,
// blocki.getLocation()))
// return -1;
if (!affectedblocks.contains(blocki)) {
if (blocki.getType() == Material.WATER
|| blocki.getType() == Material.STATIONARY_WATER) {
if (!TempBlock.isTempBlock(blocki)) {
revertBaseBlock(player);
}
spout.base = blocki;
if (i > height)
return height;
return i;
}
if (blocki.getType() == Material.ICE
|| blocki.getType() == Material.SNOW
|| blocki.getType() == Material.SNOW_BLOCK) {
if (!TempBlock.isTempBlock(blocki)) {
revertBaseBlock(player);
instances.get(player).baseblock = new TempBlock(blocki,
Material.WATER, full);
}
// blocki.setType(Material.WATER);
// blocki.setData(full);
spout.base = blocki;
if (i > height)
return height;
return i;
}
if ((blocki.getType() != Material.AIR && (!Methods
.isPlant(blocki) || !Methods.canPlantbend(player)))) {
revertBaseBlock(player);
return -1;
}
}
}
revertBaseBlock(player);
return -1;
}
public static void revertBaseBlock(Player player) {
if (instances.containsKey(player)) {
if (instances.get(player).baseblock != null) {
instances.get(player).baseblock.revertBlock();
instances.get(player).baseblock = null;
}
}
}
public static void removeAll() {
for (Player player : instances.keySet()) {
instances.get(player).remove();
}
for (Block block : affectedblocks.keySet()) {
// block.setType(Material.AIR);
TempBlock.revertBlock(block, Material.AIR);
affectedblocks.remove(block);
}
}
public static ArrayList<Player> getPlayers() {
ArrayList<Player> players = new ArrayList<Player>();
for (Player player : instances.keySet())
players.add(player);
return players;
}
public static void removeSpouts(Location loc0, double radius,
Player sourceplayer) {
for (Player player : instances.keySet()) {
if (!player.equals(sourceplayer)) {
Location loc1 = player.getLocation().getBlock().getLocation();
loc0 = loc0.getBlock().getLocation();
double dx = loc1.getX() - loc0.getX();
double dy = loc1.getY() - loc0.getY();
double dz = loc1.getZ() - loc0.getZ();
double distance = Math.sqrt(dx * dx + dz * dz);
if (distance <= radius && dy > 0 && dy < defaultheight)
instances.get(player).remove();
}
}
}
public static String getDescription() {
return "To use this ability, click while over or in water. "
+ "You will spout water up from beneath you to experience controlled levitation. "
+ "This ability is a toggle, so you can activate it then use other abilities and it "
+ "will remain on. If you try to spout over an area with no water, snow or ice, "
+ "the spout will dissipate and you will fall. Click again with this ability selected to deactivate it.";
}
}

View file

@ -80,6 +80,10 @@ Abilities:
Range: 10 Range: 10
Plantbending: Plantbending:
RegrowTime: 180000 RegrowTime: 180000
WaterSpout:
Enabled: true
Description: "To use this ability, click while over or in water. You will spout water up from beneath you to experience controlled levitation. This ability is a toggle, so you can activate it then use other abilities and it will remain on. If you try to spout over an area with no water, snow, or ice, the spout will dissipate and you will fall. Click again with this ability selected to deactivate it."
Height: 20
Earth: Earth:
Passive: Passive:
Duration: 2500 Duration: 2500