Update config file

This commit is contained in:
Nathan Braun 2016-01-16 13:07:14 -08:00
parent 0e6e41ad88
commit 0ba7dda744
74 changed files with 984 additions and 680 deletions

View file

@ -5,7 +5,6 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
@ -415,7 +414,7 @@ public class AirBlast extends AirAbility {
public static boolean removeAirBlastsAroundPoint(Location location, double radius) {
boolean removed = false;
for (AirBlast airBlast : CoreAbility.getAbilities(AirBlast.class)) {
for (AirBlast airBlast : getAbilities(AirBlast.class)) {
Location airBlastlocation = airBlast.location;
if (location.getWorld() == airBlastlocation.getWorld()) {
if (location.distanceSquared(airBlastlocation) <= radius * radius) {

View file

@ -4,7 +4,6 @@ import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
@ -36,7 +35,7 @@ public class AirBubble extends AirAbility {
}
public static boolean canFlowTo(Block block) {
for (AirBubble airBubble : CoreAbility.getAbilities(AirBubble.class)) {
for (AirBubble airBubble : getAbilities(AirBubble.class)) {
if (airBubble.blockInBubble(block)) {
return false;
}
@ -53,7 +52,7 @@ public class AirBubble extends AirAbility {
String name = bPlayer.getBoundAbilityName();
if (name.equalsIgnoreCase("AirBubble") | name.equalsIgnoreCase("WaterBubble")) {
if (!CoreAbility.hasAbility(player, AirBubble.class) && player.isSneaking()) {
if (!hasAbility(player, AirBubble.class) && player.isSneaking()) {
AirBubble airBubble = new AirBubble(player);
if (name.equalsIgnoreCase("WaterBubble")) {
airBubble.waterBubble = true;

View file

@ -1,6 +1,8 @@
package com.projectkorra.projectkorra.airbending;
import java.util.ArrayList;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
@ -8,10 +10,7 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import java.util.ArrayList;
public class AirBurst extends AirAbility {
@ -101,9 +100,11 @@ public class AirBurst extends AirAbility {
for (double phi = 0; phi < 360; phi += dphi) {
double rphi = Math.toRadians(phi);
double rtheta = Math.toRadians(theta);
x = r * Math.cos(rphi) * Math.sin(rtheta);
y = r * Math.sin(rphi) * Math.sin(rtheta);
z = r * Math.cos(rtheta);
Vector direction = new Vector(x, z, y);
AirBlast blast = new AirBlast(player, location, direction.normalize(), pushFactor, this);
blast.setDamage(damage);
@ -112,8 +113,8 @@ public class AirBurst extends AirAbility {
}
public static void coneBurst(Player player) {
if (CoreAbility.hasAbility(player, AirBurst.class)) {
AirBurst airBurst = CoreAbility.getAbility(player, AirBurst.class);
if (hasAbility(player, AirBurst.class)) {
AirBurst airBurst = getAbility(player, AirBurst.class);
airBurst.startConeBurst();
airBurst.remove();
}
@ -126,14 +127,17 @@ public class AirBurst extends AirAbility {
double angle = Math.toRadians(30);
double x, y, z;
double r = 1;
for (double theta = 0; theta <= 180; theta += blastAngleTheta) {
double dphi = blastAnglePhi / Math.sin(Math.toRadians(theta));
for (double phi = 0; phi < 360; phi += dphi) {
double rphi = Math.toRadians(phi);
double rtheta = Math.toRadians(theta);
x = r * Math.cos(rphi) * Math.sin(rtheta);
y = r * Math.sin(rphi) * Math.sin(rtheta);
z = r * Math.cos(rtheta);
Vector direction = new Vector(x, z, y);
if (direction.angle(vector) <= angle) {
AirBlast blast = new AirBlast(player, location, direction.normalize(), pushFactor, this);
@ -172,11 +176,14 @@ public class AirBurst extends AirAbility {
for (double phi = 0; phi < 360; phi += dphi) {
double rphi = Math.toRadians(phi);
double rtheta = Math.toRadians(theta);
x = r * Math.cos(rphi) * Math.sin(rtheta);
y = r * Math.sin(rphi) * Math.sin(rtheta);
z = r * Math.cos(rtheta);
Vector direction = new Vector(x, z, y);
AirBlast blast = new AirBlast(player, location, direction.normalize(), pushFactor, this);
blast.setDamage(damage);
blast.setShowParticles(false);
blasts.add(blast);

View file

@ -4,7 +4,6 @@ import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -363,7 +362,7 @@ public class AirCombo extends AirAbility implements ComboAbility {
public static boolean removeAroundPoint(Player player, String ability, Location loc, double radius) {
boolean removed = false;
for (AirCombo combo : CoreAbility.getAbilities(AirCombo.class)) {
for (AirCombo combo : getAbilities(AirCombo.class)) {
if (combo.getPlayer().equals(player)) {
continue;
} else if (ability.equalsIgnoreCase("Twister") && combo.abilityName.equalsIgnoreCase("Twister")) {

View file

@ -1,15 +1,14 @@
package com.projectkorra.projectkorra.airbending;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.ability.FlightAbility;
import com.projectkorra.projectkorra.util.Flight;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.FlightAbility;
import com.projectkorra.projectkorra.util.Flight;
import java.util.concurrent.ConcurrentHashMap;
public class AirFlight extends FlightAbility {
@ -18,17 +17,19 @@ public class AirFlight extends FlightAbility {
private boolean firstProgressIteration;
private int maxHitsBeforeRemoval;
private double speed;
private Flight flight;
public AirFlight(Player player) {
super(player);
this.maxHitsBeforeRemoval = 4;
this.maxHitsBeforeRemoval = getConfig().getInt("Abilities.Air.Flight.MaxHits");
this.speed = getConfig().getDouble("Abilities.Air.Flight.Speed");
this.firstProgressIteration = true;
start();
}
public static void addHit(Player player) {
AirFlight airFlight = CoreAbility.getAbility(player, AirFlight.class);
AirFlight airFlight = getAbility(player, AirFlight.class);
if (airFlight != null) {
if (HITS.containsKey(player.getName())) {
if (HITS.get(player.getName()) >= airFlight.maxHitsBeforeRemoval) {
@ -42,7 +43,7 @@ public class AirFlight extends FlightAbility {
}
public static boolean isFlying(Player player) {
return CoreAbility.hasAbility(player, AirFlight.class);
return hasAbility(player, AirFlight.class);
}
public static boolean isHovering(Player player) {
@ -51,7 +52,7 @@ public class AirFlight extends FlightAbility {
public static void remove(Player player) {
if (isFlying(player)) {
CoreAbility.getAbility(player, AirFlight.class).remove();
getAbility(player, AirFlight.class).remove();
}
}
@ -100,7 +101,7 @@ public class AirFlight extends FlightAbility {
vec.setY(0);
player.setVelocity(vec);
} else {
player.setVelocity(player.getEyeLocation().getDirection().normalize());
player.setVelocity(player.getEyeLocation().getDirection().normalize().multiply(speed));
}
}

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.util.Flight;
@ -63,8 +62,8 @@ public class AirScooter extends AirAbility {
* @return false If player doesn't have an instance
*/
public static boolean check(Player player) {
if (CoreAbility.hasAbility(player, AirScooter.class)) {
CoreAbility.getAbility(player, AirScooter.class).remove();
if (hasAbility(player, AirScooter.class)) {
getAbility(player, AirScooter.class).remove();
return true;
}
return false;

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.earthbending.EarthBlast;
@ -31,8 +30,8 @@ public class AirShield extends AirAbility {
private double maxRadius;
private double radius;
private double speed;
private int numberOfStreams;
private int particleCount;
private int streams;
private int particles;
private Random random;
private HashMap<Integer, Integer> angles;
@ -42,19 +41,19 @@ public class AirShield extends AirAbility {
this.maxRadius = getConfig().getDouble("Abilities.Air.AirShield.Radius");
this.isToggledByAvatarState = getConfig().getBoolean("Abilities.Air.AirShield.IsAvatarStateToggle");
this.radius = this.maxRadius;
this.speed = 10;
this.numberOfStreams = (int) (.75 * this.maxRadius);
this.particleCount = 5;
this.speed = getConfig().getDouble("Abilities.Air.AirShield.Speed");
this.streams = getConfig().getInt("Abilities.Air.AirShield.Streams");
this.particles = getConfig().getInt("Abilities.Air.AirShield.Particles");
this.random = new Random();
this.angles = new HashMap<>();
if (bPlayer.isAvatarState() && CoreAbility.hasAbility(player, AirShield.class) && isToggledByAvatarState) {
CoreAbility.getAbility(player, AirShield.class).remove();
if (bPlayer.isAvatarState() && hasAbility(player, AirShield.class) && isToggledByAvatarState) {
getAbility(player, AirShield.class).remove();
return;
}
int angle = 0;
int di = (int) (maxRadius * 2 / numberOfStreams);
int di = (int) (maxRadius * 2 / streams);
for (int i = -(int) maxRadius + di; i < (int) maxRadius; i += di) {
angles.put(i, angle);
angle += 90;
@ -67,7 +66,7 @@ public class AirShield extends AirAbility {
}
public static boolean isWithinShield(Location loc) {
for (AirShield ashield : CoreAbility.getAbilities(AirShield.class)) {
for (AirShield ashield : getAbilities(AirShield.class)) {
if (!ashield.player.getWorld().equals(loc.getWorld())) {
return false;
} else if (ashield.player.getLocation().distanceSquared(loc) <= ashield.radius * ashield.radius) {
@ -166,7 +165,7 @@ public class AirShield extends AirAbility {
Location effect = new Location(origin.getWorld(), x, y, z);
if (!GeneralMethods.isRegionProtectedFromBuild(this, effect)) {
playAirbendingParticles(effect, particleCount);
playAirbendingParticles(effect, particles);
if (random.nextInt(4) == 0) {
playAirbendingSound(effect);
}
@ -240,20 +239,20 @@ public class AirShield extends AirAbility {
this.speed = speed;
}
public int getNumberOfStreams() {
return numberOfStreams;
public int getStreams() {
return streams;
}
public void setNumberOfStreams(int numberOfStreams) {
this.numberOfStreams = numberOfStreams;
public void setStreams(int streams) {
this.streams = streams;
}
public int getParticleCount() {
return particleCount;
public int getParticles() {
return particles;
}
public void setParticleCount(int particleCount) {
this.particleCount = particleCount;
public void setParticles(int particles) {
this.particles = particles;
}
public HashMap<Integer, Integer> getAngles() {

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.util.Flight;
import org.bukkit.Location;
@ -14,17 +13,17 @@ import java.util.Random;
public class AirSpout extends AirAbility {
private static final Integer[] DIRECTIONS = { 0, 1, 2, 3, 5, 6, 7, 8 };
private static final Integer[] DIRECTIONS = {0, 1, 2, 3, 5, 6, 7, 8};
private int angle;
private long updateInterval;
private long interval;
private long cooldown;
private double height;
public AirSpout(Player player) {
super(player);
AirSpout spout = CoreAbility.getAbility(player, AirSpout.class);
AirSpout spout = getAbility(player, AirSpout.class);
if (spout != null) {
spout.remove();
return;
@ -37,8 +36,8 @@ public class AirSpout extends AirAbility {
this.angle = 0;
this.cooldown = 0;
this.interval = getConfig().getLong("Abilities.Air.AirSpout.Interval");
this.height = getConfig().getDouble("Abilities.Air.AirSpout.Height");
this.updateInterval = 100;
new Flight(player);
start();
@ -47,7 +46,7 @@ public class AirSpout extends AirAbility {
public static boolean removeSpouts(Location loc0, double radius, Player sourceplayer) {
boolean removed = false;
for (AirSpout spout : CoreAbility.getAbilities(AirSpout.class)) {
for (AirSpout spout : getAbilities(AirSpout.class)) {
if (!spout.player.equals(sourceplayer)) {
Location loc1 = spout.player.getLocation().getBlock().getLocation();
loc0 = loc0.getBlock().getLocation();
@ -129,7 +128,7 @@ public class AirSpout extends AirAbility {
if (!player.getWorld().equals(block.getWorld())) {
return;
}
if (System.currentTimeMillis() >= startTime + updateInterval) {
if (System.currentTimeMillis() >= startTime + interval) {
startTime = System.currentTimeMillis();
Location location = block.getLocation();
Location playerloc = player.getLocation();
@ -180,12 +179,12 @@ public class AirSpout extends AirAbility {
this.angle = angle;
}
public long getUpdateInterval() {
return updateInterval;
public long getInterval() {
return interval;
}
public void setUpdateInterval(long updateInterval) {
this.updateInterval = updateInterval;
public void setInterval(long interval) {
this.interval = interval;
}
public double getHeight() {

View file

@ -5,7 +5,6 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
@ -23,10 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class AirSuction extends AirAbility {
private static final int ORIGIN_PARTICLE_COUNT = 6;
private static final int ABILITY_PARTICLE_COUNT = 6;
private static final int MAX_TICKS = 10000;
private static final double ORIGIN_SELECT_RANGE = 10;
private static final ConcurrentHashMap<Player, Location> ORIGINS = new ConcurrentHashMap<>();
private boolean hasOtherOrigin;
@ -44,24 +40,23 @@ public class AirSuction extends AirAbility {
public AirSuction(Player player) {
super(player);
if (bPlayer.isOnCooldown("AirSuction")) {
if (bPlayer.isOnCooldown(this)) {
return;
}
if (player.getEyeLocation().getBlock().isLiquid()) {
} else if (player.getEyeLocation().getBlock().isLiquid()) {
return;
}
if ( CoreAbility.hasAbility(player, AirSpout.class) || CoreAbility.hasAbility(player, WaterSpout.class)) {
} else if (hasAbility(player, AirSpout.class) || hasAbility(player, WaterSpout.class)) {
return;
}
this.hasOtherOrigin = false;
this.ticks = 0;
this.particleCount = ABILITY_PARTICLE_COUNT;
this.particleCount = getConfig().getInt("Abilities.Air.AirSuction.Particles");
this.speed = getConfig().getDouble("Abilities.Air.AirSuction.Speed");
this.range = getConfig().getDouble("Abilities.Air.AirSuction.Range");
this.radius = getConfig().getDouble("Abilities.Air.AirSuction.Radius");
this.pushFactor = getConfig().getDouble("Abilities.Air.AirSuction.Push");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Air.AirSuction.Cooldown");
this.random = new Random();
if (ORIGINS.containsKey(player)) {
@ -81,7 +76,7 @@ public class AirSuction extends AirAbility {
location = getLocation(origin, direction.clone().multiply(-1));
}
bPlayer.addCooldown("AirSuction", cooldown);
bPlayer.addCooldown(this);
start();
}
@ -100,12 +95,12 @@ public class AirSuction extends AirAbility {
} else if (!bPlayer.canBendIgnoreCooldowns(getAbility("AirSuction"))) {
ORIGINS.remove(player);
return;
} else if (origin.distanceSquared(player.getEyeLocation()) > ORIGIN_SELECT_RANGE * ORIGIN_SELECT_RANGE) {
} else if (origin.distanceSquared(player.getEyeLocation()) > getSelectRange() * getSelectRange()) {
ORIGINS.remove(player);
return;
}
playAirbendingParticles(origin, ORIGIN_PARTICLE_COUNT);
playAirbendingParticles(origin, getSelectParticles());
}
public static void progressOrigins() {
@ -115,7 +110,7 @@ public class AirSuction extends AirAbility {
}
public static void setOrigin(Player player) {
Location location = GeneralMethods.getTargetedLocation(player, ORIGIN_SELECT_RANGE, GeneralMethods.NON_OPAQUE);
Location location = GeneralMethods.getTargetedLocation(player, getSelectRange(), GeneralMethods.NON_OPAQUE);
if (location.getBlock().isLiquid() || GeneralMethods.isSolid(location.getBlock())) {
return;
} else if (GeneralMethods.isRegionProtectedFromBuild(player, "AirSuction", location)) {
@ -224,7 +219,7 @@ public class AirSuction extends AirAbility {
public static boolean removeAirSuctionsAroundPoint(Location location, double radius) {
boolean removed = false;
for (AirSuction airSuction : CoreAbility.getAbilities(AirSuction.class)) {
for (AirSuction airSuction : getAbilities(AirSuction.class)) {
Location airSuctionlocation = airSuction.location;
if (location.getWorld() == airSuctionlocation.getWorld()) {
if (location.distanceSquared(airSuctionlocation) <= radius * radius) {
@ -341,4 +336,16 @@ public class AirSuction extends AirAbility {
this.cooldown = cooldown;
}
public static ConcurrentHashMap<Player, Location> getOrigins() {
return ORIGINS;
}
public static int getSelectParticles() {
return getConfig().getInt("Abilities.Air.AirSuction.SelectParticles");
}
public static double getSelectRange() {
return getConfig().getDouble("Abilities.Air.AirSuction.SelectRange");
}
}

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.airbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.command.Commands;
@ -31,15 +30,14 @@ import java.util.concurrent.ConcurrentHashMap;
public class AirSwipe extends AirAbility {
private static final Integer[] BREAKABLES = { 6, 31, 32, 37, 38, 39, 40, 59, 81, 83, 106, 175 };
private static byte FULL_LIQUID_DATA = 0x0;
private static final int STEP_SIZE = 4;
// Limiting the entities reduces the risk of crashing
private static final int MAX_AFFECTABLE_ENTITIES = 10;
private static final Integer[] BREAKABLES = {6, 31, 32, 37, 38, 39, 40, 59, 81, 83, 106, 175};
private boolean charging;
private int arc;
private int particleCount;
private int particles;
private int stepSize;
private long maxChargeTime;
private long cooldown;
private double damage;
@ -63,8 +61,9 @@ public class AirSwipe extends AirAbility {
this.charging = charging;
this.origin = player.getEyeLocation();
this.charging = false;
this.particleCount = 3;
this.particles = getConfig().getInt("Abilities.Air.AirSwipe.Particles");
this.arc = getConfig().getInt("Abilities.Air.AirSwipe.Arc");
this.stepSize = getConfig().getInt("Abilities.Air.AirSwipe.StepSize");
this.maxChargeTime = getConfig().getLong("Abilities.Air.AirSwipe.MaxChargeTime");
this.cooldown = getConfig().getLong("Abilities.Air.AirSwipe.Cooldown");
this.damage = getConfig().getDouble("Abilities.Air.AirSwipe.Damage");
@ -90,7 +89,7 @@ public class AirSwipe extends AirAbility {
public static boolean removeSwipesAroundPoint(Location loc, double radius) {
boolean removed = false;
for (AirSwipe aswipe : CoreAbility.getAbilities(AirSwipe.class)) {
for (AirSwipe aswipe : getAbilities(AirSwipe.class)) {
for (Vector vec : aswipe.elements.keySet()) {
Location vectorLoc = aswipe.elements.get(vec);
if (vectorLoc != null && vectorLoc.getWorld().equals(loc.getWorld())) {
@ -147,14 +146,14 @@ public class AirSwipe extends AirAbility {
elements.remove(direction);
}
if (isLava(block)) {
if (block.getData() == FULL_LIQUID_DATA) {
if (block.getData() == 0x0) {
block.setType(Material.OBSIDIAN);
} else {
block.setType(Material.COBBLESTONE);
}
}
} else {
playAirbendingParticles(location, particleCount, 0.2F, 0.2F, 0);
playAirbendingParticles(location, particles, 0.2F, 0.2F, 0);
if (random.nextInt(4) == 0) {
playAirbendingSound(location);
}
@ -230,7 +229,7 @@ public class AirSwipe extends AirAbility {
private void launch() {
origin = player.getEyeLocation();
for (int i = -arc; i <= arc; i += STEP_SIZE) {
for (double i = -arc; i <= arc; i += stepSize) {
double angle = Math.toRadians((double) i);
Vector direction = player.getEyeLocation().getDirection().clone();
@ -283,7 +282,7 @@ public class AirSwipe extends AirAbility {
pushFactor *= factor;
return;
} else if (System.currentTimeMillis() >= startTime + maxChargeTime) {
playAirbendingParticles(player.getEyeLocation(), particleCount);
playAirbendingParticles(player.getEyeLocation(), particles);
}
}
}
@ -337,12 +336,20 @@ public class AirSwipe extends AirAbility {
this.arc = arc;
}
public int getParticleCount() {
return particleCount;
public int getParticles() {
return particles;
}
public void setParticleCount(int particleCount) {
this.particleCount = particleCount;
public void setParticles(int particles) {
this.particles = particles;
}
public static int getMaxAffectableEntities() {
return MAX_AFFECTABLE_ENTITIES;
}
public static Integer[] getBreakables() {
return BREAKABLES;
}
public long getMaxChargeTime() {
@ -413,4 +420,12 @@ public class AirSwipe extends AirAbility {
this.cooldown = cooldown;
}
public int getStepSize() {
return stepSize;
}
public void setStepSize(int stepSize) {
this.stepSize = stepSize;
}
}

View file

@ -1,7 +1,9 @@
package com.projectkorra.projectkorra.airbending;
import java.util.ArrayList;
import java.util.List;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
@ -11,11 +13,8 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.scheduler.BukkitRunnable;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import java.util.ArrayList;
import java.util.List;
/**
* Suffocate
@ -58,7 +57,7 @@ public class Suffocate extends AirAbility {
super(player);
if (bPlayer.isOnCooldown(this)) {
return;
} else if (CoreAbility.hasAbility(player, Suffocate.class)) {
} else if (hasAbility(player, Suffocate.class)) {
return;
}
@ -220,7 +219,7 @@ public class Suffocate extends AirAbility {
/** Stops an entity from being suffocated **/
public static void breakSuffocate(Entity entity) {
for (Suffocate suffocate : CoreAbility.getAbilities(Suffocate.class)) {
for (Suffocate suffocate : getAbilities(Suffocate.class)) {
if (suffocate.targets.contains(entity)) {
suffocate.breakSuffocateLocal(entity);
}
@ -229,7 +228,7 @@ public class Suffocate extends AirAbility {
/** Checks if an entity is being suffocated **/
public static boolean isBreathbent(Entity entity) {
for (Suffocate suffocate : CoreAbility.getAbilities(Suffocate.class)) {
for (Suffocate suffocate : getAbilities(Suffocate.class)) {
if (suffocate.targets.contains(entity)) {
return suffocate.started;
}
@ -239,14 +238,14 @@ public class Suffocate extends AirAbility {
/** Determines if a player is Suffocating entities **/
public static boolean isChannelingSphere(Player player) {
return CoreAbility.hasAbility(player, Suffocate.class);
return hasAbility(player, Suffocate.class);
}
/**
* Removes an instance of Suffocate if player is the one suffocating entities
**/
public static void remove(Player player) {
Suffocate suff = CoreAbility.getAbility(player, Suffocate.class);
Suffocate suff = getAbility(player, Suffocate.class);
if (suff != null) {
suff.remove();
}
@ -263,7 +262,7 @@ public class Suffocate extends AirAbility {
if (causer == null) {
return false;
}
for (Suffocate suff : CoreAbility.getAbilities(Suffocate.class)) {
for (Suffocate suff : getAbilities(Suffocate.class)) {
if (!suff.player.equals(causer)) {
Location playerLoc = suff.getPlayer().getLocation();
if (playerLoc.getWorld().equals(loc.getWorld()) && playerLoc.distanceSquared(loc) <= radius * radius) {

View file

@ -41,8 +41,8 @@ public class Tornado extends AirAbility {
this.playerPushFactor = getConfig().getDouble("Abilities.Air.Tornado.PlayerPushFactor");
this.radius = getConfig().getDouble("Abilities.Air.Tornado.Radius");
this.range = getConfig().getDouble("Abilities.Air.Tornado.Range");
this.npcPushFactor = getConfig().getDouble("Abilities.Air.Tornado.MobPushFactor");
this.speed = 1;
this.npcPushFactor = getConfig().getDouble("Abilities.Air.Tornado.NpcPushFactor");
this.speed = getConfig().getDouble("Abilities.Air.Tornado.Speed");
this.numberOfStreams = (int) (.3 * (double) maxHeight);
this.currentHeight = 2;
this.currentRadius = currentHeight / maxHeight * radius;

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.avatar;
import com.projectkorra.projectkorra.ability.AvatarAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.util.Flight;
import org.bukkit.Location;
@ -30,7 +29,7 @@ public class AvatarState extends AvatarAbility {
public AvatarState(Player player) {
super(player);
AvatarState oldAbil = CoreAbility.getAbility(player, AvatarState.class);
AvatarState oldAbil = getAbility(player, AvatarState.class);
if (oldAbil != null) {
oldAbil.remove();
return;

View file

@ -17,10 +17,10 @@ public class AcrobatStance extends ChiAbility {
public AcrobatStance(Player player) {
super(player);
this.speed = getConfig().getInt("Abilities.Chi.AcrobatStance.Speed");
this.jump = getConfig().getInt("Abilities.Chi.AcrobatStance.Jump");
this.chiBlockBoost = getConfig().getDouble("Abilities.Chi.AcrobatStance.ChiBlockBoost");
this.paralyzeDodgeBoost = getConfig().getDouble("Abilities.Chi.AcrobatStance.ParalyzeChanceDecrease");
this.speed = ChiPassive.getSpeedPower() + 1;
this.jump = ChiPassive.getJumpPower() + 1;
ChiAbility stance = bPlayer.getStance();
if (stance != null && !(stance instanceof AcrobatStance)) {

View file

@ -74,10 +74,10 @@ public class ChiPassive {
ChiAbility stance = bPlayer.getStance();
if (player.isSprinting() && !(stance instanceof AcrobatStance)) {
if (!player.hasPotionEffect(PotionEffectType.JUMP)) {
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60, getJumpPower() - 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60, getJumpPower()));
}
if (!player.hasPotionEffect(PotionEffectType.SPEED)) {
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, getSpeedPower() - 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, getSpeedPower()));
}
}
}

View file

@ -14,7 +14,6 @@ import java.util.concurrent.ConcurrentHashMap;
public class Paralyze extends ChiAbility {
private static final String DURATION_STRING = "Abilities.Chi.Paralyze.Duration";
private static final ConcurrentHashMap<Entity, Long> ENTITIES = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<Entity, Long> COOLDOWNS = new ConcurrentHashMap<>();
@ -108,7 +107,7 @@ public class Paralyze extends ChiAbility {
}
public static long getDuration() {
return getConfig().getLong(DURATION_STRING);
return getConfig().getLong("Abilities.Chi.Paralyze.Duration");
}
public Entity getTarget() {
@ -119,10 +118,6 @@ public class Paralyze extends ChiAbility {
this.target = target;
}
public static String getDurationString() {
return DURATION_STRING;
}
public static ConcurrentHashMap<Entity, Long> getEntities() {
return ENTITIES;
}

View file

@ -17,8 +17,8 @@ public class SwiftKick extends ChiAbility {
public SwiftKick(Player player) {
super(player);
this.damage = getConfig().getInt("Abilities.Chi.SwiftKick.Damage");
this.cooldown = getConfig().getInt("Abilities.Chi.ChiCombo.ChiBlockChance");
this.cooldown = 4000;
this.blockChance = getConfig().getInt("Abilities.Chi.ChiCombo.ChiBlockChance");
this.cooldown = getConfig().getInt("Abilities.Chi.ChiCombo.Cooldown");
this.target = GeneralMethods.getTargetedEntity(player, 4);
start();
}

View file

@ -14,7 +14,7 @@ public class WarriorStance extends ChiAbility {
public WarriorStance(Player player) {
super(player);
this.strength = getConfig().getInt("Abilities.Chi.WarriorStance.Strength") - 1;
this.strength = getConfig().getInt("Abilities.Chi.WarriorStance.Strength");
this.resistance = getConfig().getInt("Abilities.Chi.WarriorStance.Resistance");
ChiAbility stance = bPlayer.getStance();

View file

@ -253,18 +253,26 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirShield.Enabled", true);
config.addDefault("Abilities.Air.AirShield.Description", "Air Shield is one of the most powerful defensive techniques in existence. " + "To use, simply sneak (default: shift). " + "This will create a whirlwind of air around the user, " + "with a small pocket of safe space in the center. " + "This wind will deflect all projectiles and will prevent any creature from " + "entering it for as long as its maintained.");
config.addDefault("Abilities.Air.AirShield.Radius", 7);
config.addDefault("Abilities.Air.AirShield.Streams", 5);
config.addDefault("Abilities.Air.AirShield.Speed", 10);
config.addDefault("Abilities.Air.AirShield.Particles", 5);
config.addDefault("Abilities.Air.AirShield.IsAvatarStateToggle", 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 " + "toggle - click to activate and form a whirling spout of air " + "beneath you, lifting you up. You can bend other abilities while using AirSpout. " + "Click again to deactivate this ability.");
config.addDefault("Abilities.Air.AirSpout.Height", 20);
config.addDefault("Abilities.Air.AirSpout.Interval", 100);
config.addDefault("Abilities.Air.AirSuction.Enabled", true);
config.addDefault("Abilities.Air.AirSuction.Description", "To use, simply left-click in a direction. A gust of wind will originate as far as it can in that direction and flow towards you, sucking anything in its path harmlessly with it. Skilled benders can use this technique to pull items from precarious locations. Additionally, tapping sneak will change the origin of your next AirSuction to your targeted location.");
config.addDefault("Abilities.Air.AirSuction.Speed", 25);
config.addDefault("Abilities.Air.AirSuction.Range", 20);
config.addDefault("Abilities.Air.AirSuction.SelectRange", 10);
config.addDefault("Abilities.Air.AirSuction.Radius", 2);
config.addDefault("Abilities.Air.AirSuction.Push", 2.5);
config.addDefault("Abilities.Air.AirSuction.Cooldown", 500);
config.addDefault("Abilities.Air.AirSuction.Particles", 6);
config.addDefault("Abilities.Air.AirSuction.SelectParticles", 6);
config.addDefault("Abilities.Air.AirSwipe.Enabled", true);
config.addDefault("Abilities.Air.AirSwipe.Description", "To use, simply left-click in a direction. An arc of air will flow from you towards that direction, cutting and pushing back anything in its path. Its damage is minimal, but it still sends the message. This ability will extinguish fires, cool lava, and cut things like grass, mushrooms, and flowers. Additionally, you can charge it by holding sneak. Charging before attacking will increase damage and knockback, up to a maximum.");
@ -277,10 +285,14 @@ public class ConfigManager {
config.addDefault("Abilities.Air.AirSwipe.Cooldown", 1500);
config.addDefault("Abilities.Air.AirSwipe.ChargeFactor", 3);
config.addDefault("Abilities.Air.AirSwipe.MaxChargeTime", 3000);
config.addDefault("Abilities.Air.AirSwipe.Particles", 3);
config.addDefault("Abilities.Air.AirSwipe.StepSize", 4);
config.addDefault("Abilities.Air.Flight.Enabled", true);
config.addDefault("Abilities.Air.Flight.Description", "Jump in the air, crouch (default: shift) and hold with this ability bound and you will glide around in the direction you look. While flying, click to Hover. Click again to disable Hovering.");
config.addDefault("Abilities.Air.Flight.HoverEnabled", true);
config.addDefault("Abilities.Air.Flight.Speed", 1);
config.addDefault("Abilities.Air.Flight.MaxHits", 4);
config.addDefault("Abilities.Air.Suffocate.Enabled", true);
config.addDefault("Abilities.Air.Suffocate.Description", "This ability is one of the most dangerous abilities an Airbender possesses. To use, simply look at an entity and hold shift. The entity will begin taking damage as you extract the air from their lungs. Any bender caught in this sphere will only be able to use basic moves, such as AirSwipe, WaterManipulation, FireBlast, or EarthBlast. An entity can be knocked out of the sphere by certain bending arts, and your attention will be disrupted if you are hit by bending.");
@ -306,7 +318,8 @@ public class ConfigManager {
config.addDefault("Abilities.Air.Tornado.Radius", 10);
config.addDefault("Abilities.Air.Tornado.Height", 25);
config.addDefault("Abilities.Air.Tornado.Range", 25);
config.addDefault("Abilities.Air.Tornado.MobPushFactor", 1);
config.addDefault("Abilities.Air.Tornado.Speed", 1);
config.addDefault("Abilities.Air.Tornado.NpcPushFactor", 1);
config.addDefault("Abilities.Air.Tornado.PlayerPushFactor", 1);
config.addDefault("Abilities.Air.AirCombo.Enabled", true);
@ -347,10 +360,14 @@ public class ConfigManager {
config.addDefault("Abilities.Water.HealingWaters.Radius", 5);
config.addDefault("Abilities.Water.HealingWaters.Interval", 750);
config.addDefault("Abilities.Water.HealingWaters.Power", 1);
config.addDefault("Abilities.Water.HealingWaters.Duration", 70);
config.addDefault("Abilities.Water.IceBlast.Enabled", true);
config.addDefault("Abilities.Water.IceBlast.Damage", 3);
config.addDefault("Abilities.Water.IceBlast.Range", 20);
config.addDefault("Abilities.Water.IceBlast.DeflectRange", 3);
config.addDefault("Abilities.Water.IceBlast.CollisionRadius", 2);
config.addDefault("Abilities.Water.IceBlast.Interval", 20);
config.addDefault("Abilities.Water.IceBlast.Cooldown", 1500);
config.addDefault("Abilities.Water.IceBlast.Description", "This ability offers a powerful ice utility for Waterbenders. It can be used to fire an explosive burst of ice at an opponent, spraying ice and snow around it. To use, simply tap sneak (Default: Shift) while targeting a block of ice to select it as a source. From there, you can just left click to send the blast off at your opponent.");
@ -359,10 +376,25 @@ public class ConfigManager {
config.addDefault("Abilities.Water.IceSpike.Cooldown", 2000);
config.addDefault("Abilities.Water.IceSpike.Damage", 2);
config.addDefault("Abilities.Water.IceSpike.Range", 20);
config.addDefault("Abilities.Water.IceSpike.ThrowingMult", 0.7);
config.addDefault("Abilities.Water.IceSpike.Push", 0.7);
config.addDefault("Abilities.Water.IceSpike.Height", 6);
config.addDefault("Abilities.Water.IceSpike.Projectile.Range", 20);
config.addDefault("Abilities.Water.IceSpike.Projectile.Damage", 1);
config.addDefault("Abilities.Water.IceSpike.Speed", 25);
config.addDefault("Abilities.Water.IceSpike.SlowCooldown", 5000);
config.addDefault("Abilities.Water.IceSpike.SlowPower", 2);
config.addDefault("Abilities.Water.IceSpike.SlowDuration", 70);
config.addDefault("Abilities.Water.IceSpike.Field.Damage", 2);
config.addDefault("Abilities.Water.IceSpike.Field.Radius", 6);
config.addDefault("Abilities.Water.IceSpike.Field.Push", 1);
config.addDefault("Abilities.Water.IceSpike.Field.Cooldown", 2000);
config.addDefault("Abilities.Water.IceSpike.Blast.Range", 20);
config.addDefault("Abilities.Water.IceSpike.Blast.Damage", 1);
config.addDefault("Abilities.Water.IceSpike.Blast.CollisionRadius", 2);
config.addDefault("Abilities.Water.IceSpike.Blast.DeflectRange", 3);
config.addDefault("Abilities.Water.IceSpike.Blast.Cooldown", 500);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowCooldown", 5000);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowPower", 2);
config.addDefault("Abilities.Water.IceSpike.Blast.SlowDuration", 70);
config.addDefault("Abilities.Water.IceSpike.Blast.Interval", 20);
config.addDefault("Abilities.Water.OctopusForm.Enabled", true);
config.addDefault("Abilities.Water.OctopusForm.Description", "This ability allows the waterbender to manipulate a large quantity of water into a form resembling that of an octopus. " + "To use, click to select a water source. Then, hold sneak to channel this ability. " + "While channeling, the water will form itself around you and has a chance to block incoming attacks. " + "Additionally, you can click while channeling to attack things near you, dealing damage and knocking them back. " + "Releasing shift at any time will dissipate the form.");
@ -372,11 +404,15 @@ public class ConfigManager {
config.addDefault("Abilities.Water.OctopusForm.Damage", 4);
config.addDefault("Abilities.Water.OctopusForm.Knockback", 1.75);
config.addDefault("Abilities.Water.OctopusForm.FormDelay", 40);
config.addDefault("Abilities.Water.OctopusForm.Cooldown", 0);
config.addDefault("Abilities.Water.OctopusForm.AngleIncrement", 45);
config.addDefault("Abilities.Water.PhaseChange.Enabled", true);
config.addDefault("Abilities.Water.PhaseChange.Description", "To use, simply left-click. " + "Any water you are looking at within range will instantly freeze over into solid ice. " + "Provided you stay within range of the ice and do not unbind FreezeMelt, " + "that ice will not thaw. If, however, you do either of those the ice will instantly thaw. " + "If you sneak (default: shift), anything around where you are looking at will instantly melt. " + "Since this is a more favorable state for these things, they will never re-freeze unless they " + "would otherwise by nature or some other bending ability. Additionally, if you tap sneak while " + "targetting water with FreezeMelt, it will evaporate water around that block that is above " + "sea level. ");
config.addDefault("Abilities.Water.PhaseChange.Range", 20);
config.addDefault("Abilities.Water.PhaseChange.Radius", 5);
config.addDefault("Abilities.Water.PhaseChange.Freeze.Cooldown", 0);
config.addDefault("Abilities.Water.PhaseChange.Melt.Cooldown", 0);
config.addDefault("Abilities.Water.PlantArmor.Enabled", true);
config.addDefault("Abilities.Water.PlantArmor.Description", "PlantArmor is a defensive ability in the arsenal of the plantbender. Clicking on leaves with this ability will temporarily clad you in strong armor made out of plants! You can use this defensively, but you can also use the armor as a source for other plantbending skills.");
@ -390,18 +426,34 @@ public class ConfigManager {
config.addDefault("Abilities.Water.Surge.Wave.Radius", 3);
config.addDefault("Abilities.Water.Surge.Wave.Range", 20);
config.addDefault("Abilities.Water.Surge.Wave.HorizontalPush", 1);
config.addDefault("Abilities.Water.Surge.VerticalPush", 0.2);
config.addDefault("Abilities.Water.Surge.Wave.VerticalPush", 0.2);
config.addDefault("Abilities.Water.Surge.Wave.MaxFreezeRadius", 7);
config.addDefault("Abilities.Water.Surge.Wave.Cooldown", 500);
config.addDefault("Abilities.Water.Surge.Wave.Interval", 30);
config.addDefault("Abilities.Water.Surge.Wall.Range", 5);
config.addDefault("Abilities.Water.Surge.Wall.Radius", 2);
config.addDefault("Abilities.Water.Surge.Wall.Cooldown", 0);
config.addDefault("Abilities.Water.Surge.Wall.Interval", 30);
config.addDefault("Abilities.Water.Torrent.Enabled", true);
config.addDefault("Abilities.Water.Torrent.Description", "Torrent is one of the strongest moves in a waterbender's arsenal. To use, first click a source block to select it; then hold shift to begin streaming the water around you. Water flowing around you this way will damage and knock back nearby enemies and projectiles. If you release shift during this, you will create a large wave that expands outwards from you, launching anything in its path back. Instead, if you click you release the water and channel it to flow towards your cursor. Anything caught in the blast will be tossed about violently and take damage. Finally, if you click again when the water is torrenting, it will freeze the area around it when it is obstructed.");
config.addDefault("Abilities.Water.Torrent.Range", 25);
config.addDefault("Abilities.Water.Torrent.DeflectDamage", 1);
config.addDefault("Abilities.Water.Torrent.SelectRange", 10);
config.addDefault("Abilities.Water.Torrent.Damage", 3);
config.addDefault("Abilities.Water.Torrent.DeflectDamage", 1);
config.addDefault("Abilities.Water.Torrent.MaxLayer", 3);
config.addDefault("Abilities.Water.Torrent.Push", 1);
config.addDefault("Abilities.Water.Torrent.Angle", 20);
config.addDefault("Abilities.Water.Torrent.Radius", 3);
config.addDefault("Abilities.Water.Torrent.MaxUpwardForce", 0.2);
config.addDefault("Abilities.Water.Torrent.Interval", 30);
config.addDefault("Abilities.Water.Torrent.Cooldown", 0);
config.addDefault("Abilities.Water.Torrent.Wave.Radius", 15);
config.addDefault("Abilities.Water.Torrent.Wave.Knockback", 1.5);
config.addDefault("Abilities.Water.Torrent.Wave.Height", 1);
config.addDefault("Abilities.Water.Torrent.Wave.GrowSpeed", 0.5);
config.addDefault("Abilities.Water.Torrent.Wave.Interval", 30);
config.addDefault("Abilities.Water.Torrent.Wave.Cooldown", 0);
config.addDefault("Abilities.Water.Plantbending.RegrowTime", 180000);
@ -466,6 +518,8 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterManipulation.Description", "To use, place your cursor over a waterbendable object and tap sneak (default: shift). Smoke will appear where you've selected, indicating the origin of your ability. After you have selected an origin, simply left-click in any direction and you will see your water spout off in that direction, slicing any creature in its path. If you look towards a creature when you use this ability, it will target that creature. A collision from Water Manipulation both knocks the target back and deals some damage. Alternatively, if you have the source selected and tap shift again, you will be able to control the water more directly.");
config.addDefault("Abilities.Water.WaterManipulation.Damage", 3.0);
config.addDefault("Abilities.Water.WaterManipulation.Range", 30);
config.addDefault("Abilities.Water.WaterManipulation.CollisionRadius", 2);
config.addDefault("Abilities.Water.WaterManipulation.DeflectRange", 3);
config.addDefault("Abilities.Water.WaterManipulation.Speed", 35);
config.addDefault("Abilities.Water.WaterManipulation.Push", 0.3);
config.addDefault("Abilities.Water.WaterManipulation.Cooldown", 1000);
@ -473,11 +527,15 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterSpout.Enabled", true);
config.addDefault("Abilities.Water.WaterSpout.Description", "This ability provides a Waterbender with a means of transportation. To use, simply left click while in or over water to spout water up beneath you, experiencing controlled levitation. Left clicking again while the spout is active will cause it to disappear. Alternatively, tapping a Waterbendable block while not in Water will select a water block as a source, from there, you can tap sneak (Default:Shift) to channel the Water around you. Releasing the sneak will create a wave allowing you a quick burst of controlled transportation. While riding the wave you may press sneak to cause the wave to disappear.");
config.addDefault("Abilities.Water.WaterSpout.Height", 20);
config.addDefault("Abilities.Water.WaterSpout.Interval", 50);
config.addDefault("Abilities.Water.WaterSpout.BlockSpiral", false);
config.addDefault("Abilities.Water.WaterSpout.Particles", false);
config.addDefault("Abilities.Water.WaterSpout.Wave.Particles", false);
config.addDefault("Abilities.Water.WaterSpout.Wave.Enabled", true);
config.addDefault("Abilities.Water.WaterSpout.Wave.Radius", 3.8);
config.addDefault("Abilities.Water.WaterSpout.Wave.WaveRadius", 1.5);
config.addDefault("Abilities.Water.WaterSpout.Wave.Range", 6);
config.addDefault("Abilities.Water.WaterSpout.Wave.AnimationSpeed", 1.2);
config.addDefault("Abilities.Water.WaterSpout.Wave.ChargeTime", 500);
config.addDefault("Abilities.Water.WaterSpout.Wave.FlightTime", 2500);
config.addDefault("Abilities.Water.WaterSpout.Wave.Speed", 1.3);
@ -495,23 +553,27 @@ public class ConfigManager {
config.addDefault("Abilities.Water.WaterCombo.IceBullet.Cooldown", 10000);
config.addDefault("Abilities.Earth.Passive.Duration", 2500);
config.addDefault("Properties.Earth.Passive.SandRunPower", 1);
config.addDefault("Properties.Earth.Passive.SandRunSpeed", 0);
config.addDefault("Abilities.Earth.Catapult.Enabled", true);
config.addDefault("Abilities.Earth.Catapult.Description", "To use, left-click while looking in the direction you want to be launched. " + "A pillar of earth will jut up from under you and launch you in that direction - " + "if and only if there is enough earth behind where you're looking to launch you. " + "Skillful use of this ability takes much time and work, and it does result in the " + "death of certain gung-ho earthbenders. If you plan to use this ability, be sure " + "you've read about your passive ability you innately have as an earthbender.");
config.addDefault("Abilities.Earth.Catapult.Length", 6);
config.addDefault("Abilities.Earth.Catapult.Speed", 10);
config.addDefault("Abilities.Earth.Catapult.Push", 4);
config.addDefault("Abilities.Earth.Catapult.ShiftModifier", 2);
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
config.addDefault("Abilities.Earth.Collapse.Description", " To use, simply left-click on an earthbendable block. " + "That block and the earthbendable blocks above it will be shoved " + "back into the earth below them, if they can. " + "This ability does have the capacity to trap something inside of it, " + "although it is incredibly difficult to do so. " + "Additionally, press sneak with this ability to affect an area around your targetted location - " + "all earth that can be moved downwards will be moved downwards. " + "This ability is especially risky or deadly in caves, depending on the " + "earthbender's goal and technique.");
config.addDefault("Abilities.Earth.Collapse.Range", 20);
config.addDefault("Abilities.Earth.Collapse.SelectRange", 20);
config.addDefault("Abilities.Earth.Collapse.Radius", 7);
config.addDefault("Abilities.Earth.Collapse.Speed", 8);
config.addDefault("Abilities.Earth.Collapse.Column.Height", 6);
config.addDefault("Abilities.Earth.Collapse.Column.Cooldown", 500);
config.addDefault("Abilities.Earth.Collapse.Wall.Height", 6);
config.addDefault("Abilities.Earth.Collapse.Wall.Cooldown", 500);
config.addDefault("Abilities.Earth.EarthArmor.Enabled", true);
config.addDefault("Abilities.Earth.EarthArmor.Description", "This ability encases the earthbender in temporary armor. To use, click on a block that is earthbendable. If there is another block under it that is earthbendable, the block will fly to you and grant you temporary armor and damage reduction. This ability has a long cooldown.");
config.addDefault("Abilities.Earth.EarthArmor.SelectRange", 7);
config.addDefault("Abilities.Earth.EarthArmor.Duration", 10000);
config.addDefault("Abilities.Earth.EarthArmor.Strength", 2);
config.addDefault("Abilities.Earth.EarthArmor.Cooldown", 17500);
@ -519,16 +581,21 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.EarthBlast.Enabled", true);
config.addDefault("Abilities.Earth.EarthBlast.Description", "To use, place your cursor over an earthbendable object (dirt, rock, ores, etc) " + "and tap sneak (default: shift). The object will temporarily turn to stone, " + "indicating that you have it focused as the source for your ability. " + "After you have selected an origin (you no longer need to be sneaking), " + "simply left-click in any direction and you will see your object launch " + "off in that direction, smashing into any creature in its path. If you look " + "towards a creature when you use this ability, it will target that creature. " + "A collision from Earth Blast both knocks the target back and deals some damage. " + "You cannot have multiple of these abilities flying at the same time.");
config.addDefault("Abilities.Earth.EarthBlast.CanHitSelf", false);
config.addDefault("Abilities.Earth.EarthBlast.PrepareRange", 10);
config.addDefault("Abilities.Earth.EarthBlast.SelectRange", 10);
config.addDefault("Abilities.Earth.EarthBlast.Range", 30);
config.addDefault("Abilities.Earth.EarthBlast.Speed", 35);
config.addDefault("Abilities.Earth.EarthBlast.Revert", true);
config.addDefault("Abilities.Earth.EarthBlast.Damage", 3);
config.addDefault("Abilities.Earth.EarthBlast.Push", 0.3);
config.addDefault("Abilities.Earth.EarthBlast.Cooldown", 500);
config.addDefault("Abilities.Earth.EarthBlast.DeflectRange", 3);
config.addDefault("Abilities.Earth.EarthBlast.CollisionRadius", 2);
config.addDefault("Abilities.Earth.EarthGrab.Enabled", true);
config.addDefault("Abilities.Earth.EarthGrab.Description", "To use, simply left-click while targeting a creature within range. " + "This ability will erect a circle of earth to trap the creature in.");
config.addDefault("Abilities.Earth.EarthGrab.Range", 8);
config.addDefault("Abilities.Earth.EarthGrab.SelectRange", 8);
config.addDefault("Abilities.Earth.EarthGrab.Height", 6);
config.addDefault("Abilities.Earth.EarthGrab.Cooldown", 500);
config.addDefault("Abilities.Earth.EarthTunnel.Enabled", true);
config.addDefault("Abilities.Earth.EarthTunnel.Description", "Earth Tunnel is a completely utility ability for earthbenders. To use, simply sneak (default: shift) in the direction you want to tunnel. You will slowly begin tunneling in the direction you're facing for as long as you sneak or if the tunnel has been dug long enough. This ability will be interrupted if it hits a block that cannot be earthbent.");
@ -540,6 +607,7 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.Extraction.Enabled", true);
config.addDefault("Abilities.Earth.Extraction.Description", "This ability allows metalbenders to extract the minerals from ore blocks. To use, simply tap sneak while looking at an ore block with metal in it (iron, gold, quartz) and the ore will be extracted and drop in front of you. This ability has a small chance of doubling or tripling the loot. This ability has a short cooldown.");
config.addDefault("Abilities.Earth.Extraction.SelectRange", 5);
config.addDefault("Abilities.Earth.Extraction.Cooldown", 500);
config.addDefault("Abilities.Earth.Extraction.TripleLootChance", 15);
config.addDefault("Abilities.Earth.Extraction.DoubleLootChance", 40);
@ -570,23 +638,30 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.EarthSmash.Enabled", true);
config.addDefault("Abilities.Earth.EarthSmash.Description", "To raise an EarthSmash hold sneak (default: shift) for approximately 1.5 seconds, " + "then release while aiming at dirt. To grab the EarthSmash aim at the center and hold sneak, " + "the EarthSmash will follow your mouse. You can shoot the EarthSmash by grabbing onto it and left clicking. " + "To ride the EarthSmash simply hop ontop of it and hold sneak while aiming in the direction that you wish to go. " + "Another way to ride an EarthSmash is to grab it with sneak and then right click it. " + "Use EarthSmash as a defensive shield, a powerful attack, or an advanced means of transportation.");
config.addDefault("Abilities.Earth.EarthSmash.AllowGrab", true);
config.addDefault("Abilities.Earth.EarthSmash.AllowShooting", true);
config.addDefault("Abilities.Earth.EarthSmash.AllowFlight", true);
config.addDefault("Abilities.Earth.EarthSmash.GrabRange", 10);
config.addDefault("Abilities.Earth.EarthSmash.ChargeTime", 1500);
config.addDefault("Abilities.Earth.EarthSmash.Cooldown", 2500);
config.addDefault("Abilities.Earth.EarthSmash.ShotRange", 30);
config.addDefault("Abilities.Earth.EarthSmash.ShootRange", 30);
config.addDefault("Abilities.Earth.EarthSmash.Damage", 6);
config.addDefault("Abilities.Earth.EarthSmash.Knockback", 3.5);
config.addDefault("Abilities.Earth.EarthSmash.Knockup", 0.15);
config.addDefault("Abilities.Earth.EarthSmash.FlightSpeed", 0.72);
config.addDefault("Abilities.Earth.EarthSmash.FlightTimer", 3000);
config.addDefault("Abilities.Earth.EarthSmash.RemoveTimer", 30000);
config.addDefault("Abilities.Earth.EarthSmash.RequiredBendableBlocks", 11);
config.addDefault("Abilities.Earth.EarthSmash.MaxBlocksToPassThrough", 3);
config.addDefault("Abilities.Earth.EarthSmash.ShootAnimationInterval", 25);
config.addDefault("Abilities.Earth.EarthSmash.FlightAnimationInterval", 0);
config.addDefault("Abilities.Earth.EarthSmash.LiftAnimationInterval", 30);
config.addDefault("Abilities.Earth.EarthSmash.GrabDetectionRadius", 3.5);
config.addDefault("Abilities.Earth.EarthSmash.FlightDetectionRadius", 3.8);
config.addDefault("Abilities.Earth.MetalClips.Enabled", true);
config.addDefault("Abilities.Earth.MetalClips.Description", "MetalClips has the potential to be both an offensive and a utility ability. To start, you must carry smelted Iron Ingots in your inventory. To apply the clips onto an entity, simply click at them. If the entity is a Zombie, a Skeleton, or a Player, the clips will form armor around the entity, giving you some control over them. Each additional clip will give you more control. If you have permission to do so, you may crush the entity against a wall with a 4th clip, hurting them. Without explicit permissions, you will only be able to strap three clips on your target. If the entity is not one of the above, the clip will simply do damage and fall to the ground, to be collected. Another permission requiring action is throwing entities. To do so, click while controlling a metalclipped entity");
config.addDefault("Abilities.Earth.MetalClips.Damage", 2);
config.addDefault("Abilities.Earth.MetalClips.DamageInterval", 500);
config.addDefault("Abilities.Earth.MetalClips.Range", 10);
config.addDefault("Abilities.Earth.MetalClips.MagnetRange", 20);
config.addDefault("Abilities.Earth.MetalClips.MagnetPower", 0.6);
config.addDefault("Abilities.Earth.MetalClips.Cooldown", 1000);
@ -595,18 +670,24 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.RaiseEarth.Enabled", true);
config.addDefault("Abilities.Earth.RaiseEarth.Description", "To use, simply left-click on an earthbendable block. " + "A column of earth will shoot upwards from that location. " + "Anything in the way of the column will be brought up with it, " + "leaving talented benders the ability to trap brainless entities up there. " + "Additionally, simply sneak (default shift) looking at an earthbendable block. " + "A wall of earth will shoot upwards from that location. " + "Anything in the way of the wall will be brought up with it. ");
config.addDefault("Abilities.Earth.RaiseEarth.Speed", 8);
config.addDefault("Abilities.Earth.RaiseEarth.Column.SelectRange", 20);
config.addDefault("Abilities.Earth.RaiseEarth.Column.Height", 6);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Range", 15);
config.addDefault("Abilities.Earth.RaiseEarth.Column.Cooldown", 500);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.SelectRange", 20);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Height", 6);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Width", 6);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Cooldown", 500);
config.addDefault("Abilities.Earth.Shockwave.Enabled", true);
config.addDefault("Abilities.Earth.Shockwave.Description", "This is one of the most powerful moves in the earthbender's arsenal. " + "To use, you must first charge it by holding sneak (default: shift). " + "Once charged, you can release sneak to create an enormous shockwave of earth, " + "disturbing all earth around you and expanding radially outwards. " + "Anything caught in the shockwave will be blasted back and dealt damage. " + "If you instead click while charged, the disruption is focused in a cone in front of you. " + "Lastly, if you fall from a great enough height with this ability selected, you will automatically create a shockwave.");
config.addDefault("Abilities.Earth.Shockwave.FallThreshold", 10);
config.addDefault("Abilities.Earth.Shockwave.ChargeTime", 2500);
config.addDefault("Abilities.Earth.Shockwave.Cooldown", 1500);
config.addDefault("Abilities.Earth.Shockwave.Damage", 4);
config.addDefault("Abilities.Earth.Shockwave.Knockback", 1.1);
config.addDefault("Abilities.Earth.Shockwave.Range", 15);
config.addDefault("Abilities.Earth.Shockwave.Angle", 40);
config.addDefault("Abilities.Earth.SandSpout.Enabled", true);
config.addDefault("Abilities.Earth.SandSpout.Description", "SandSpout is a core move for travelling, evasion, and mobility for sandbenders. To use, simply left click while over sand or sandstone, and a column of sand will form at your feet, enabling you to levitate. Any mobs or players that touch your column will receive damage and be blinded. Beware, as the spout will stop working when no longer over sand!");
@ -614,6 +695,7 @@ public class ConfigManager {
config.addDefault("Abilities.Earth.SandSpout.BlindnessTime", 10);
config.addDefault("Abilities.Earth.SandSpout.SpoutDamage", 1);
config.addDefault("Abilities.Earth.SandSpout.Spiral", false);
config.addDefault("Abilities.Earth.SandSpout.Interval", 100);
config.addDefault("Abilities.Earth.Tremorsense.Enabled", true);
config.addDefault("Abilities.Earth.Tremorsense.Description", "This is a pure utility ability for earthbenders. If you are in an area of low-light and are standing on top of an earthbendable block, this ability will automatically turn that block into glowstone, visible *only by you*. If you lose contact with a bendable block, the light will go out as you have lost contact with the earth and cannot 'see' until you can touch earth again. Additionally, if you click with this ability selected, smoke will appear above nearby earth with pockets of air beneath them.");
@ -626,14 +708,17 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.Blaze.Enabled", true);
config.addDefault("Abilities.Fire.Blaze.Description", "To use, simply left-click in any direction. An arc of fire will flow from your location, igniting anything in its path. Additionally, tap sneak to engulf the area around you in roaring flames.");
config.addDefault("Abilities.Fire.Blaze.ArcOfFire.Arc", 16);
config.addDefault("Abilities.Fire.Blaze.ArcOfFire.Range", 7);
config.addDefault("Abilities.Fire.Blaze.RingOfFire.Range", 7);
config.addDefault("Abilities.Fire.Blaze.Arc", 16);
config.addDefault("Abilities.Fire.Blaze.Range", 7);
config.addDefault("Abilities.Fire.Blaze.Speed", 15);
config.addDefault("Abilities.Fire.Blaze.Cooldown", 500);
config.addDefault("Abilities.Fire.Blaze.Ring.Range", 7);
config.addDefault("Abilities.Fire.Blaze.Ring.Angle", 10);
config.addDefault("Abilities.Fire.Blaze.Ring.Cooldown", 500);
config.addDefault("Abilities.Fire.Combustion.Enabled", true);
config.addDefault("Abilities.Fire.Combustion.Description", "Combustion is a powerful ability only known by a few skilled Firebenders. It allows the bender to Firebend with their mind, concentrating energy to create a powerful blast. To use, simply tap sneak (Default: Shift) to launch the blast. This technique is highly destructive and very effective, it also comes with a long cooldown.");
config.addDefault("Abilities.Fire.Combustion.Cooldown", 10000);
// config.addDefault("Abilities.Fire.Combustion.ChargeTime", 5000);
config.addDefault("Abilities.Fire.Combustion.BreakBlocks", false);
config.addDefault("Abilities.Fire.Combustion.Power", 1.0);
config.addDefault("Abilities.Fire.Combustion.Damage", 5);
@ -645,13 +730,16 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireBlast.Description", "FireBlast is the most fundamental bending technique of a firebender. " + "To use, simply left-click in a direction. A blast of fire will be created at your fingertips. " + "If this blast contacts an enemy, it will dissipate and engulf them in flames, " + "doing additional damage and knocking them back slightly. " + "If the blast hits terrain, it will ignite the nearby area. " + "Additionally, if you hold sneak, you will charge up the fireblast. " + "If you release it when it's charged, it will instead launch a powerful " + "fireball that explodes on contact.");
config.addDefault("Abilities.Fire.FireBlast.Speed", 20);
config.addDefault("Abilities.Fire.FireBlast.Range", 20);
config.addDefault("Abilities.Fire.FireBlast.Radius", 2);
config.addDefault("Abilities.Fire.FireBlast.CollisionRadius", 2);
config.addDefault("Abilities.Fire.FireBlast.Push", 0.3);
config.addDefault("Abilities.Fire.FireBlast.Damage", 3);
config.addDefault("Abilities.Fire.FireBlast.Cooldown", 1500);
config.addDefault("Abilities.Fire.FireBlast.Dissipate", false);
config.addDefault("Abilities.Fire.FireBlast.FireTicks", 2);
config.addDefault("Abilities.Fire.FireBlast.SmokeParticleRadius", 0.3);
config.addDefault("Abilities.Fire.FireBlast.FlameParticleRadius", 0.275);
config.addDefault("Abilities.Fire.FireBlast.Charged.ChargeTime", 3000);
config.addDefault("Abilities.Fire.FireBlast.Charged.CollisionRadius", 2);
config.addDefault("Abilities.Fire.FireBlast.Charged.Damage", 4);
config.addDefault("Abilities.Fire.FireBlast.Charged.DamageRadius", 4);
config.addDefault("Abilities.Fire.FireBlast.Charged.DamageBlocks", true);
@ -663,7 +751,11 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireBurst.Description", "FireBurst is a very powerful firebending ability. " + "To use, press and hold sneak to charge your burst. " + "Once charged, you can either release sneak to release the burst in a sphere around you or " + "click to launch a cone-shaped burst of flames in front of you.");
config.addDefault("Abilities.Fire.FireBurst.Damage", 2);
config.addDefault("Abilities.Fire.FireBurst.ChargeTime", 3500);
config.addDefault("Abilities.Fire.FireBurst.Cooldown", 0);
config.addDefault("Abilities.Fire.FireBurst.Range", 15);
config.addDefault("Abilities.Fire.FireBurst.AnglePhi", 10);
config.addDefault("Abilities.Fire.FireBurst.AngleTheta", 10);
config.addDefault("Abilities.Fire.FireBurst.ParticlesPercentage", 5);
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 " + "ability selected will launch you in the direction you're looking, granting you " + "controlled flight for a short time. This ability can be used mid-air to prevent falling " + "to your death, but on the ground it can only be used if standing on a block that's " + "ignitable (e.g. not snow or water).");
@ -677,21 +769,26 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.FireShield.Radius", 3);
config.addDefault("Abilities.Fire.FireShield.DiscRadius", 1.5);
config.addDefault("Abilities.Fire.FireShield.Duration", 1000);
config.addDefault("Abilities.Fire.FireShield.Cooldown", 500);
config.addDefault("Abilities.Fire.FireShield.Interval", 100);
config.addDefault("Abilities.Fire.FireShield.FireTicks", 4);
config.addDefault("Abilities.Fire.HeatControl.Enabled", true);
config.addDefault("Abilities.Fire.HeatControl.Description", "While this ability is selected, the firebender becomes impervious " + "to fire damage and cannot be ignited. " + "If the user left-clicks with this ability, the targeted area will be " + "extinguished, although it will leave any creature burning engulfed in flames. " + "This ability can also cool lava. If this ability is used while targetting ice or snow, it" + " will instead melt blocks in that area. Finally, sneaking with this ability will cook any food in your hand.");
config.addDefault("Abilities.Fire.HeatControl.Extinguish.Range", 20);
config.addDefault("Abilities.Fire.HeatControl.Extinguish.Radius", 7);
config.addDefault("Abilities.Fire.HeatControl.Extinguish.Cooldown", 500);
config.addDefault("Abilities.Fire.HeatControl.Solidify.Range", 10);
config.addDefault("Abilities.Fire.HeatControl.Solidify.Radius", 7);
config.addDefault("Abilities.Fire.HeatControl.Solidify.RevertTime", 20000);
config.addDefault("Abilities.Fire.HeatControl.Melt.Range", 15);
config.addDefault("Abilities.Fire.HeatControl.Melt.Radius", 5);
config.addDefault("Abilities.Fire.HeatControl.Cook.CookTime", 2000);
config.addDefault("Abilities.Fire.Illumination.Enabled", true);
config.addDefault("Abilities.Fire.Illumination.Description", "This ability gives firebenders a means of illuminating the area. It is a toggle - clicking " + "will create a torch that follows you around. The torch will only appear on objects that are " + "ignitable and can hold a torch (e.g. not leaves or ice). If you get too far away from the torch, " + "it will disappear, but will reappear when you get on another ignitable block. Clicking again " + "dismisses this torch.");
config.addDefault("Abilities.Fire.Illumination.Range", 5);
config.addDefault("Abilities.Fire.Illumination.Cooldown", 500);
config.addDefault("Abilities.Fire.Lightning.Enabled", true);
config.addDefault("Abilities.Fire.Lightning.Description", "Hold sneak while selecting this ability to charge up a lightning strike. Once charged, release sneak to discharge the lightning to the targeted location.");
@ -720,8 +817,10 @@ public class ConfigManager {
config.addDefault("Abilities.Fire.WallOfFire.Duration", 5000);
config.addDefault("Abilities.Fire.WallOfFire.Damage", 1);
config.addDefault("Abilities.Fire.WallOfFire.Cooldown", 11000);
config.addDefault("Abilities.Fire.WallOfFire.Interval", 500);
config.addDefault("Abilities.Fire.WallOfFire.Interval", 250);
config.addDefault("Abilities.Fire.WallOfFire.DamageInterval", 500);
config.addDefault("Abilities.Fire.WallOfFire.FireTicks", 2);
config.addDefault("Abilities.Fire.WallOfFire.MaxAngle", 50);
config.addDefault("Abilities.Fire.FireCombo.Enabled", true);
config.addDefault("Abilities.Fire.FireCombo.FireKick.Range", 7.0);
@ -756,6 +855,8 @@ public class ConfigManager {
config.addDefault("Abilities.Chi.AcrobatStance.Enabled", true);
config.addDefault("Abilities.Chi.AcrobatStance.Description", "AcrobatStance gives a Chiblocker a higher probability of blocking a Bender's Chi while granting them a Speed and Jump Boost. It also increases the rate at which the hunger bar depletes. To use, simply left click. Left clicking again will de-activate the stance.");
config.addDefault("Abilities.Chi.AcrobatStance.ChiBlockBoost", 5);
config.addDefault("Abilities.Chi.AcrobatStance.Speed", 1);
config.addDefault("Abilities.Chi.AcrobatStance.Jump", 1);
config.addDefault("Abilities.Chi.HighJump.Enabled", true);
config.addDefault("Abilities.Chi.HighJump.Description", "To use this ability, simply click. You will jump quite high. This ability has a short cooldown.");
@ -782,7 +883,7 @@ public class ConfigManager {
config.addDefault("Abilities.Chi.WarriorStance.Enabled", true);
config.addDefault("Abilities.Chi.WarriorStance.Description", "WarriorStance gives a Chiblocker increased damage but makes them a tad more vulnerable. To activate, simply left click.");
config.addDefault("Abilities.Chi.WarriorStance.Strength", 1);
config.addDefault("Abilities.Chi.WarriorStance.Strength", 0);
config.addDefault("Abilities.Chi.WarriorStance.Resistance", -1);
config.addDefault("Abilities.Chi.QuickStrike.Enabled", true);
@ -794,6 +895,7 @@ public class ConfigManager {
config.addDefault("Abilities.Chi.SwiftKick.Description", "SwiftKick allows a chiblocker to swiftly kick an enemy, potentially blocking their chi. The chiblocker must be in the air to use this ability.");
config.addDefault("Abilities.Chi.SwiftKick.Damage", 2);
config.addDefault("Abilities.Chi.SwiftKick.ChiBlockChance", 15);
config.addDefault("Abilities.Chi.SwiftKick.Cooldown", 4000);
config.addDefault("Storage.engine", "sqlite");

View file

@ -9,7 +9,6 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
// TODO: Remove Catapult.Speed from the Configuration
public class Catapult extends EarthAbility {
private boolean catapult;

View file

@ -1,17 +1,15 @@
package com.projectkorra.projectkorra.earthbending;
import java.util.concurrent.ConcurrentHashMap;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
import java.util.concurrent.ConcurrentHashMap;
public class Collapse extends EarthAbility {
@ -19,7 +17,7 @@ public class Collapse extends EarthAbility {
private int height;
private long time;
private long cooldown;
private double range;
private double selectRange;
private double speed;
private Location origin;
private Location location;
@ -35,7 +33,7 @@ public class Collapse extends EarthAbility {
return;
}
block = BlockSource.getEarthSourceBlock(player, range, ClickType.LEFT_CLICK);
block = BlockSource.getEarthSourceBlock(player, selectRange, ClickType.LEFT_CLICK);
if (block == null) {
return;
}
@ -73,10 +71,10 @@ public class Collapse extends EarthAbility {
}
private void setFields() {
this.height = getConfig().getInt("Abilities.Earth.RaiseEarth.Column.Height");
this.range = getConfig().getInt("Abilities.Earth.Collapse.Range");
this.height = getConfig().getInt("Abilities.Earth.Collapse.Column.Height");
this.selectRange = getConfig().getInt("Abilities.Earth.Collapse.Range");
this.speed = getConfig().getDouble("Abilities.Earth.Collapse.Speed");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Earth.Collapse.Column.Cooldown");
this.direction = new Vector(0, -1, 0);
this.affectedBlocks = new ConcurrentHashMap<>();
}
@ -95,7 +93,7 @@ public class Collapse extends EarthAbility {
}
public static boolean blockInAllAffectedBlocks(Block block) {
for (Collapse collapse : CoreAbility.getAbilities(Collapse.class)) {
for (Collapse collapse : getAbilities(Collapse.class)) {
if (collapse.affectedBlocks.containsKey(block)) {
return true;
}
@ -104,7 +102,7 @@ public class Collapse extends EarthAbility {
}
public static void revert(Block block) {
for (Collapse collapse : CoreAbility.getAbilities(Collapse.class)) {
for (Collapse collapse : getAbilities(Collapse.class)) {
collapse.affectedBlocks.remove(block);
}
}
@ -205,12 +203,12 @@ public class Collapse extends EarthAbility {
this.time = time;
}
public double getRange() {
return range;
public double getSelectRange() {
return selectRange;
}
public void setRange(double range) {
this.range = range;
public void setSelectRange(double selectRange) {
this.selectRange = selectRange;
}
public double getSpeed() {

View file

@ -13,10 +13,9 @@ import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
// TODO: Merge this ability with Collapse
public class CollapseWall extends EarthAbility {
private int range;
private int selectRange;
private int height;
private long cooldown;
private double radius;
@ -30,16 +29,16 @@ public class CollapseWall extends EarthAbility {
return;
}
this.range = getConfig().getInt("Abilities.Earth.Collapse.Range");
this.height = getConfig().getInt("Abilities.Earth.RaiseEarth.Column.Height");
this.selectRange = getConfig().getInt("Abilities.Earth.Collapse.SelectRange");
this.height = getConfig().getInt("Abilities.Earth.Collapse.Wall.Height");
this.radius = getConfig().getDouble("Abilities.Earth.Collapse.Radius");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Earth.Collapse.Wall.Cooldown");
this.blocks = new ConcurrentHashMap<>();
this.baseBlocks = new ConcurrentHashMap<>();
Block sblock = BlockSource.getEarthSourceBlock(player, range, ClickType.SHIFT_DOWN);
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, ClickType.SHIFT_DOWN);
if (sblock == null) {
location = getTargetEarthBlock(range).getLocation();
location = getTargetEarthBlock(selectRange).getLocation();
} else {
location = sblock.getLocation();
}
@ -109,12 +108,12 @@ public class CollapseWall extends EarthAbility {
return false;
}
public int getRange() {
return range;
public int getSelectRange() {
return selectRange;
}
public void setRange(int range) {
this.range = range;
public void setSelectRange(int selectRange) {
this.selectRange = selectRange;
}
public int getHeight() {

View file

@ -1,5 +1,10 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempPotionEffect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -10,12 +15,6 @@ import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.util.Vector;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.util.TempPotionEffect;
public class EarthArmor extends EarthAbility {
private boolean formed;
@ -23,23 +22,23 @@ public class EarthArmor extends EarthAbility {
private byte headData;
private byte legsData;
private int strength;
private int range;
private long time;
private long cooldown;
private long interval;
private long duration;
private double selectRange;
private Block headBlock;
private Block legsBlock;
private Location headBlockLocation;
private Location legsBlockLocation;
private Material headType;
private Material legsType;
private Location headBlockLocation;
private Location legsBlockLocation;
private ItemStack[] oldArmor;
@SuppressWarnings("deprecation")
public EarthArmor(Player player) {
super(player);
if (CoreAbility.hasAbility(player, EarthArmor.class) || !bPlayer.canBend(this)) {
if (hasAbility(player, EarthArmor.class) || !bPlayer.canBend(this)) {
return;
}
@ -49,9 +48,9 @@ public class EarthArmor extends EarthAbility {
this.cooldown = getConfig().getLong("Abilities.Earth.EarthArmor.Cooldown");
this.duration = getConfig().getLong("Abilities.Earth.EarthArmor.Duration");
this.strength = getConfig().getInt("Abilities.Earth.EarthArmor.Strength");
this.range = 7;
this.selectRange = getConfig().getDouble("Abilities.Earth.EarthArmor.SelectRange");
headBlock = getTargetEarthBlock(range);
headBlock = getTargetEarthBlock((int) selectRange);
if (!GeneralMethods.isRegionProtectedFromBuild(this, headBlock.getLocation())
&& getEarthbendableBlocksLength(headBlock, new Vector(0, -1, 0), 2) >= 2) {
this.legsBlock = headBlock.getRelative(BlockFace.DOWN);
@ -138,8 +137,8 @@ public class EarthArmor extends EarthAbility {
return false;
}
if (headBlock.getLocation().distanceSquared(player.getEyeLocation()) > range * range
|| legsBlock.getLocation().distanceSquared(player.getLocation()) > range * range) {
if (headBlock.getLocation().distanceSquared(player.getEyeLocation()) > selectRange * selectRange
|| legsBlock.getLocation().distanceSquared(player.getLocation()) > selectRange * selectRange) {
remove();
return false;
}
@ -270,13 +269,13 @@ public class EarthArmor extends EarthAbility {
public void setStrength(int strength) {
this.strength = strength;
}
public int getRange() {
return range;
public double getSelectRange() {
return selectRange;
}
public void setRange(int range) {
this.range = range;
public void setSelectRange(double selectRange) {
this.selectRange = selectRange;
}
public long getTime() {

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.firebending.Combustion;
@ -35,7 +34,7 @@ public class EarthBlast extends EarthAbility {
private double damage;
private double speed;
private double pushFactor;
private double prepareRange;
private double selectRange;
private double deflectRange;
private double collisionRadius;
private Material sourceType;
@ -50,15 +49,15 @@ public class EarthBlast extends EarthAbility {
this.isProgressing = false;
this.isAtDestination = false;
this.isSettingUp = true;
this.deflectRange = 3;
this.collisionRadius = 2;
this.cooldown = GeneralMethods.getGlobalCooldown();
this.deflectRange = getConfig().getDouble("Abilities.Earth.EarthBlast.DeflectRange");
this.collisionRadius = getConfig().getDouble("Abilities.Earth.EarthBlast.CollisionRadius");
this.cooldown = getConfig().getLong("Abilities.Earth.EarthBlast.Cooldown");
this.canHitSelf = getConfig().getBoolean("Abilities.Earth.EarthBlast.CanHitSelf");
this.range = getConfig().getDouble("Abilities.Earth.EarthBlast.Range");
this.damage = getConfig().getDouble("Abilities.Earth.EarthBlast.Damage");
this.speed = getConfig().getDouble("Abilities.Earth.EarthBlast.Speed");
this.pushFactor = getConfig().getDouble("Abilities.Earth.EarthBlast.Push");
this.prepareRange = getConfig().getDouble("Abilities.Earth.EarthBlast.PrepareRange");
this.selectRange = getConfig().getDouble("Abilities.Earth.EarthBlast.SelectRange");
this.time = System.currentTimeMillis();
this.interval = (long) (1000.0 / speed);
@ -69,7 +68,7 @@ public class EarthBlast extends EarthAbility {
}
private void checkForCollision() {
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (blast.player.equals(player)) {
continue;
} else if (!blast.location.getWorld().equals(player.getWorld())) {
@ -136,7 +135,7 @@ public class EarthBlast extends EarthAbility {
}
boolean selectedABlockInUse = false;
for (EarthBlast blast : CoreAbility.getAbilities(player, EarthBlast.class)) {
for (EarthBlast blast : getAbilities(player, EarthBlast.class)) {
if (!blast.isProgressing) {
blast.remove();
} else if (blast.isProgressing && block.equals(blast.sourceBlock)) {
@ -149,7 +148,7 @@ public class EarthBlast extends EarthAbility {
}
checkForCollision();
if (block.getLocation().distanceSquared(player.getLocation()) > prepareRange * prepareRange) {
if (block.getLocation().distanceSquared(player.getLocation()) > selectRange * selectRange) {
return false;
}
sourceBlock = block;
@ -183,7 +182,7 @@ public class EarthBlast extends EarthAbility {
} else if (!player.getWorld().equals(sourceBlock.getWorld())) {
remove();
return;
} else if (sourceBlock.getLocation().distanceSquared(player.getLocation()) > prepareRange * prepareRange) {
} else if (sourceBlock.getLocation().distanceSquared(player.getLocation()) > selectRange * selectRange) {
remove();
return;
}
@ -393,7 +392,7 @@ public class EarthBlast extends EarthAbility {
public static boolean annihilateBlasts(Location location, double radius, Player source) {
boolean broke = false;
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (blast.location.getWorld().equals(location.getWorld()) && !source.equals(blast.player)) {
if (blast.location.distanceSquared(location) <= radius * radius) {
blast.remove();
@ -406,7 +405,7 @@ public class EarthBlast extends EarthAbility {
public static ArrayList<EarthBlast> getAroundPoint(Location location, double radius) {
ArrayList<EarthBlast> list = new ArrayList<EarthBlast>();
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (blast.location.getWorld().equals(location.getWorld())) {
if (blast.location.distanceSquared(location) <= radius * radius) {
list.add(blast);
@ -417,7 +416,7 @@ public class EarthBlast extends EarthAbility {
}
public static EarthBlast getBlastFromSource(Block block) {
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (blast.sourceBlock.equals(block)) {
return blast;
}
@ -426,7 +425,7 @@ public class EarthBlast extends EarthAbility {
}
private static void redirectTargettedBlasts(Player player, ArrayList<EarthBlast> ignore) {
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (!blast.isProgressing || ignore.contains(blast)) {
continue;
} else if (!blast.location.getWorld().equals(player.getWorld())) {
@ -452,7 +451,7 @@ public class EarthBlast extends EarthAbility {
}
public static void removeAroundPoint(Location location, double radius) {
for (EarthBlast blast : CoreAbility.getAbilities(EarthBlast.class)) {
for (EarthBlast blast : getAbilities(EarthBlast.class)) {
if (blast.location.getWorld().equals(location.getWorld())) {
if (blast.location.distanceSquared(location) <= radius * radius) {
blast.remove();
@ -470,7 +469,7 @@ public class EarthBlast extends EarthAbility {
return;
}
for (EarthBlast blast : CoreAbility.getAbilities(player, EarthBlast.class)) {
for (EarthBlast blast : getAbilities(player, EarthBlast.class)) {
if (!blast.isProgressing && bPlayer.canBend(blast)) {
blast.throwEarth();
ignore.add(blast);
@ -589,12 +588,12 @@ public class EarthBlast extends EarthAbility {
this.pushFactor = pushFactor;
}
public double getPrepareRange() {
return prepareRange;
public double getSelectRange() {
return selectRange;
}
public void setPrepareRange(double prepareRange) {
this.prepareRange = prepareRange;
public void setSelectRange(double selectRange) {
this.selectRange = selectRange;
}
public double getDeflectRange() {

View file

@ -16,7 +16,7 @@ public class EarthGrab extends EarthAbility {
private long cooldown;
private double lowestDistance;
private double range;
private double selectRange;
private double height;
private Location origin;
private Vector direction;
@ -25,12 +25,12 @@ public class EarthGrab extends EarthAbility {
public EarthGrab(Player player, boolean isOtherEntity) {
super(player);
this.range = getConfig().getDouble("Abilities.Earth.EarthGrab.Range");
this.height = 6;
this.cooldown = GeneralMethods.getGlobalCooldown();
this.selectRange = getConfig().getDouble("Abilities.Earth.EarthGrab.SelectRange");
this.height = getConfig().getDouble("Abilities.Earth.EarthGrab.Height");
this.cooldown = getConfig().getLong("Abilities.Earth.EarthGrab.Cooldown");
this.origin = player.getEyeLocation();
this.direction = origin.getDirection();
this.lowestDistance = range + 1;
this.lowestDistance = selectRange + 1;
this.closestEntity = null;
if (!bPlayer.canBend(this)) {
@ -47,7 +47,7 @@ public class EarthGrab extends EarthAbility {
}
public void earthGrabOtherEntity() {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(origin, range)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(origin, selectRange)) {
if (GeneralMethods.getDistanceFromLine(direction, origin, entity.getLocation()) <= 3
&& (entity instanceof LivingEntity)
&& (entity.getEntityId() != player.getEntityId())) {
@ -195,11 +195,11 @@ public class EarthGrab extends EarthAbility {
}
public double getRange() {
return range;
return selectRange;
}
public void setRange(double range) {
this.range = range;
this.selectRange = range;
}
public double getHeight() {

View file

@ -3,9 +3,9 @@ package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.ElementalAbility;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.util.TempBlock;
import org.bukkit.Bukkit;
@ -23,11 +23,8 @@ import java.util.concurrent.ConcurrentHashMap;
public class EarthPassive {
public static ConcurrentHashMap<Block, Long> sandBlocks = new ConcurrentHashMap<Block, Long>();
public static ConcurrentHashMap<Block, MaterialData> sandIdEntities = new ConcurrentHashMap<Block, MaterialData>();
private static final long duration = ProjectKorra.plugin.getConfig().getLong("Abilities.Earth.Passive.Duration");
private static final int sandSpeed = ProjectKorra.plugin.getConfig().getInt("Properties.Earth.Passive.SandRunPower");
private static final ConcurrentHashMap<Block, Long> SAND_BLOCKS = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<Block, MaterialData> SAND_ID_ENTITIES = new ConcurrentHashMap<>();
@SuppressWarnings("deprecation")
public static boolean softenLanding(Player player) {
@ -50,9 +47,9 @@ public class EarthPassive {
} else {
block.setType(Material.SAND);
}
if (!sandBlocks.containsKey(block)) {
sandIdEntities.put(block, type);
sandBlocks.put(block, System.currentTimeMillis());
if (!SAND_BLOCKS.containsKey(block)) {
SAND_ID_ENTITIES.put(block, type);
SAND_BLOCKS.put(block, System.currentTimeMillis());
}
}
}
@ -68,9 +65,9 @@ public class EarthPassive {
} else {
affectedBlock.setType(Material.SAND);
}
if (!sandBlocks.containsKey(affectedBlock)) {
sandIdEntities.putIfAbsent(affectedBlock, type);
sandBlocks.put(affectedBlock, System.currentTimeMillis());
if (!SAND_BLOCKS.containsKey(affectedBlock)) {
SAND_ID_ENTITIES.putIfAbsent(affectedBlock, type);
SAND_BLOCKS.put(affectedBlock, System.currentTimeMillis());
}
}
}
@ -82,14 +79,14 @@ public class EarthPassive {
}
public static boolean isPassiveSand(Block block) {
return sandBlocks.containsKey(block);
return SAND_BLOCKS.containsKey(block);
}
@SuppressWarnings("deprecation")
public static void revertSand(Block block) {
MaterialData materialdata = sandIdEntities.get(block);
sandIdEntities.remove(block);
sandBlocks.remove(block);
MaterialData materialdata = SAND_ID_ENTITIES.get(block);
SAND_ID_ENTITIES.remove(block);
SAND_BLOCKS.remove(block);
if (block.getType() == Material.SAND) {
block.setType(materialdata.getItemType());
@ -107,7 +104,7 @@ public class EarthPassive {
if (player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.SAND
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.SANDSTONE
|| player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType() == Material.RED_SANDSTONE) {
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, sandSpeed - 1));
player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, getSandRunSpeed()));
}
}
}
@ -147,15 +144,15 @@ public class EarthPassive {
}
public static void revertSands() {
for (Block block : sandBlocks.keySet()) {
if (System.currentTimeMillis() >= sandBlocks.get(block) + duration) {
for (Block block : SAND_BLOCKS.keySet()) {
if (System.currentTimeMillis() >= SAND_BLOCKS.get(block) + getDuration()) {
revertSand(block);
}
}
}
public static void revertAllSand() {
for (Block block : sandBlocks.keySet()) {
for (Block block : SAND_BLOCKS.keySet()) {
revertSand(block);
}
}
@ -191,4 +188,20 @@ public class EarthPassive {
}
return true;
}
public static ConcurrentHashMap<Block, Long> getSandBlocks() {
return SAND_BLOCKS;
}
public static ConcurrentHashMap<Block, MaterialData> getSandIdEntities() {
return SAND_ID_ENTITIES;
}
public static long getDuration() {
return ConfigManager.getConfig().getLong("Abilities.Earth.Passive.Duration");
}
public static int getSandRunSpeed() {
return ConfigManager.getConfig().getInt("Properties.Earth.Passive.SandRunSpeed");
}
}

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -23,7 +22,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Random;
// TODO: remove allowShooting from config
public class EarthSmash extends EarthAbility {
public static enum State {
@ -42,15 +40,15 @@ public class EarthSmash extends EarthAbility {
private long removeTimer;
private long flightRemoveTimer;
private long flightStartTime;
private long shootAnimationCooldown;
private long flightAnimationCooldown;
private long liftAnimationCooldown;
private long shootAnimationInterval;
private long flightAnimationInterval;
private long liftAnimationInterval;
private double grabRange;
private double shootRange;
private double damage;
private double knockback;
private double knockup;
private double flySpeed;
private double flightSpeed;
private double grabbedDistance;
private double grabDetectionRadius;
private double flightDetectionRadius;
@ -65,22 +63,22 @@ public class EarthSmash extends EarthAbility {
public EarthSmash(Player player, ClickType type) {
super(player);
this.requiredBendableBlocks = 11;
this.maxBlocksToPassThrough = 3;
this.shootAnimationCooldown = 25;
this.flightAnimationCooldown = 0;
this.liftAnimationCooldown = 30;
this.grabDetectionRadius = 3.5;
this.flightDetectionRadius = 3.8;
this.state = State.START;
this.requiredBendableBlocks = getConfig().getInt("Abilities.Earth.EarthSmash.RequiredBendableBlocks");
this.maxBlocksToPassThrough = getConfig().getInt("Abilities.Earth.EarthSmash.MaxBlocksToPassThrough");
this.shootAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.ShootAnimationInterval");
this.flightAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.FlightAnimationInterval");
this.liftAnimationInterval = getConfig().getLong("Abilities.Earth.EarthSmash.LiftAnimationInterval");
this.grabDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.GrabDetectionRadius");
this.flightDetectionRadius = getConfig().getDouble("Abilities.Earth.EarthSmash.FlightDetectionRadius");
this.allowGrab = getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowGrab");
this.allowFlight = getConfig().getBoolean("Abilities.Earth.EarthSmash.AllowFlight");
this.grabRange = getConfig().getDouble("Abilities.Earth.EarthSmash.GrabRange");
this.shootRange = getConfig().getDouble("Abilities.Earth.EarthSmash.ShotRange");
this.shootRange = getConfig().getDouble("Abilities.Earth.EarthSmash.ShootRange");
this.damage = getConfig().getDouble("Abilities.Earth.EarthSmash.Damage");
this.knockback = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockback");
this.knockup = getConfig().getDouble("Abilities.Earth.EarthSmash.Knockup");
this.flySpeed = getConfig().getDouble("Abilities.Earth.EarthSmash.FlightSpeed");
this.flightSpeed = getConfig().getDouble("Abilities.Earth.EarthSmash.FlightSpeed");
this.chargeTime = getConfig().getLong("Abilities.Earth.EarthSmash.ChargeTime");
this.cooldown = getConfig().getLong("Abilities.Earth.EarthSmash.Cooldown");
this.flightRemoveTimer = getConfig().getLong("Abilities.Earth.EarthSmash.FlightTimer");
@ -97,7 +95,7 @@ public class EarthSmash extends EarthAbility {
damage = AvatarState.getValue(damage);
knockback = AvatarState.getValue(knockback);
knockup = AvatarState.getValue(knockup);
flySpeed = AvatarState.getValue(flySpeed);
flightSpeed = AvatarState.getValue(flightSpeed);
flightRemoveTimer = Integer.MAX_VALUE;
shootRange = AvatarState.getValue(shootRange);
}
@ -127,7 +125,7 @@ public class EarthSmash extends EarthAbility {
start();
} else if (type == ClickType.LEFT_CLICK && player.isSneaking()) {
for (EarthSmash smash : CoreAbility.getAbilities(EarthSmash.class)) {
for (EarthSmash smash : getAbilities(EarthSmash.class)) {
if (smash.state == State.GRABBED && smash.player == player) {
smash.state = State.SHOT;
smash.destination = player.getEyeLocation().clone().add(player.getEyeLocation().getDirection().normalize().multiply(smash.shootRange));
@ -188,7 +186,7 @@ public class EarthSmash extends EarthAbility {
ParticleEffect.SMOKE.display(tempLoc, 0.3F, 0.1F, 0.3F, 0, 4);
}
} else if (state == State.LIFTING) {
if (System.currentTimeMillis() - delay >= liftAnimationCooldown) {
if (System.currentTimeMillis() - delay >= liftAnimationInterval) {
delay = System.currentTimeMillis();
animateLift();
}
@ -215,7 +213,7 @@ public class EarthSmash extends EarthAbility {
return;
}
} else if (state == State.SHOT) {
if (System.currentTimeMillis() - delay >= shootAnimationCooldown) {
if (System.currentTimeMillis() - delay >= shootAnimationInterval) {
delay = System.currentTimeMillis();
if (GeneralMethods.isRegionProtectedFromBuild(this, location)) {
remove();
@ -254,7 +252,7 @@ public class EarthSmash extends EarthAbility {
if (!player.isSneaking()) {
remove();
return;
} else if (System.currentTimeMillis() - delay >= flightAnimationCooldown) {
} else if (System.currentTimeMillis() - delay >= flightAnimationInterval) {
delay = System.currentTimeMillis();
if (GeneralMethods.isRegionProtectedFromBuild(this, location)) {
remove();
@ -270,7 +268,7 @@ public class EarthSmash extends EarthAbility {
return;
}
for (Entity entity : entities) {
entity.setVelocity(direction.clone().multiply(flySpeed));
entity.setVelocity(direction.clone().multiply(flightSpeed));
}
// These values tend to work well when dealing with a person aiming upward or downward.
@ -519,7 +517,7 @@ public class EarthSmash extends EarthAbility {
}
List<Block> blocks = GeneralMethods.getBlocksAroundPoint(GeneralMethods.getTargetedLocation(player, grabRange, GeneralMethods.NON_OPAQUE), 1);
for (EarthSmash smash : CoreAbility.getAbilities(EarthSmash.class)) {
for (EarthSmash smash : getAbilities(EarthSmash.class)) {
if (reqState == null || smash.state == reqState) {
for (Block block : blocks) {
if (block.getLocation().getWorld() == smash.location.getWorld()
@ -557,7 +555,7 @@ public class EarthSmash extends EarthAbility {
* at a time.
*/
public void smashToSmashCollisionDetection() {
for (EarthSmash smash : CoreAbility.getAbilities(EarthSmash.class)) {
for (EarthSmash smash : getAbilities(EarthSmash.class)) {
if (smash.location != null && smash != this && smash.location.getWorld() == location.getWorld()
&& smash.location.distanceSquared(location) < Math.pow(flightDetectionRadius, 2)) {
smash.remove();
@ -573,7 +571,7 @@ public class EarthSmash extends EarthAbility {
* ontop of the earthsmash and holding shift.
*/
private static EarthSmash flyingInSmashCheck(Player player) {
for (EarthSmash smash : CoreAbility.getAbilities(EarthSmash.class)) {
for (EarthSmash smash : getAbilities(EarthSmash.class)) {
if (!smash.allowFlight) {
continue;
}
@ -737,6 +735,22 @@ public class EarthSmash extends EarthAbility {
this.progressCounter = progressCounter;
}
public int getRequiredBendableBlocks() {
return requiredBendableBlocks;
}
public void setRequiredBendableBlocks(int requiredBendableBlocks) {
this.requiredBendableBlocks = requiredBendableBlocks;
}
public int getMaxBlocksToPassThrough() {
return maxBlocksToPassThrough;
}
public void setMaxBlocksToPassThrough(int maxBlocksToPassThrough) {
this.maxBlocksToPassThrough = maxBlocksToPassThrough;
}
public long getDelay() {
return delay;
}
@ -777,6 +791,30 @@ public class EarthSmash extends EarthAbility {
this.flightStartTime = flightStartTime;
}
public long getShootAnimationInterval() {
return shootAnimationInterval;
}
public void setShootAnimationInterval(long shootAnimationInterval) {
this.shootAnimationInterval = shootAnimationInterval;
}
public long getFlightAnimationInterval() {
return flightAnimationInterval;
}
public void setFlightAnimationInterval(long flightAnimationInterval) {
this.flightAnimationInterval = flightAnimationInterval;
}
public long getLiftAnimationInterval() {
return liftAnimationInterval;
}
public void setLiftAnimationInterval(long liftAnimationInterval) {
this.liftAnimationInterval = liftAnimationInterval;
}
public double getGrabRange() {
return grabRange;
}
@ -817,12 +855,12 @@ public class EarthSmash extends EarthAbility {
this.knockup = knockup;
}
public double getFlySpeed() {
return flySpeed;
public double getFlightSpeed() {
return flightSpeed;
}
public void setFlySpeed(double flySpeed) {
this.flySpeed = flySpeed;
public void setFlightSpeed(double flightSpeed) {
this.flightSpeed = flightSpeed;
}
public double getGrabbedDistance() {
@ -833,6 +871,22 @@ public class EarthSmash extends EarthAbility {
this.grabbedDistance = grabbedDistance;
}
public double getGrabDetectionRadius() {
return grabDetectionRadius;
}
public void setGrabDetectionRadius(double grabDetectionRadius) {
this.grabDetectionRadius = grabDetectionRadius;
}
public double getFlightDetectionRadius() {
return flightDetectionRadius;
}
public void setFlightDetectionRadius(double flightDetectionRadius) {
this.flightDetectionRadius = flightDetectionRadius;
}
public State getState() {
return state;
}
@ -877,60 +931,4 @@ public class EarthSmash extends EarthAbility {
this.location = location;
}
public int getRequiredBendableBlocks() {
return requiredBendableBlocks;
}
public void setRequiredBendableBlocks(int requiredBendableBlocks) {
this.requiredBendableBlocks = requiredBendableBlocks;
}
public int getMaxBlocksToPassThrough() {
return maxBlocksToPassThrough;
}
public void setMaxBlocksToPassThrough(int maxBlocksToPassThrough) {
this.maxBlocksToPassThrough = maxBlocksToPassThrough;
}
public long getShootAnimationCooldown() {
return shootAnimationCooldown;
}
public void setShootAnimationCooldown(long shootAnimationCooldown) {
this.shootAnimationCooldown = shootAnimationCooldown;
}
public long getFlightAnimationCooldown() {
return flightAnimationCooldown;
}
public void setFlightAnimationCooldown(long flightAnimationCooldown) {
this.flightAnimationCooldown = flightAnimationCooldown;
}
public long getLiftAnimationCooldown() {
return liftAnimationCooldown;
}
public void setLiftAnimationCooldown(long liftAnimationCooldown) {
this.liftAnimationCooldown = liftAnimationCooldown;
}
public double getGrabDetectionRadius() {
return grabDetectionRadius;
}
public void setGrabDetectionRadius(double grabDetectionRadius) {
this.grabDetectionRadius = grabDetectionRadius;
}
public double getFlightDetectionRadius() {
return flightDetectionRadius;
}
public void setFlightDetectionRadius(double flightDetectionRadius) {
this.flightDetectionRadius = flightDetectionRadius;
}
}

View file

@ -15,7 +15,6 @@ public class EarthTunnel extends EarthAbility {
private long interval;
private long time;
private long cooldown;
private double depth;
private double radius;
private double angle;
@ -34,7 +33,6 @@ public class EarthTunnel extends EarthAbility {
this.range = getConfig().getDouble("Abilities.Earth.EarthTunnel.Range");
this.radius = getConfig().getDouble("Abilities.Earth.EarthTunnel.Radius");
this.interval = getConfig().getLong("Abilities.Earth.EarthTunnel.Interval");
this.cooldown = 0;
this.radiusIncrement = radius;
this.time = System.currentTimeMillis();
@ -50,7 +48,6 @@ public class EarthTunnel extends EarthAbility {
}
start();
bPlayer.addCooldown(this);
}
@Override
@ -115,7 +112,7 @@ public class EarthTunnel extends EarthAbility {
@Override
public long getCooldown() {
return cooldown;
return 0;
}
@Override
@ -216,10 +213,6 @@ public class EarthTunnel extends EarthAbility {
this.direction = direction;
}
public void setCooldown(long cooldown) {
this.cooldown = cooldown;
}
public void setLocation(Location location) {
this.location = location;
}

View file

@ -16,7 +16,7 @@ public class Extraction extends EarthAbility {
private int doubleChance;
private int tripleChance;
private int range;
private int selectRange;
private long cooldown;
private Block originBlock;
@ -26,13 +26,13 @@ public class Extraction extends EarthAbility {
this.doubleChance = getConfig().getInt("Abilities.Earth.Extraction.DoubleLootChance");
this.tripleChance = getConfig().getInt("Abilities.Earth.Extraction.TripleLootChance");
this.cooldown = getConfig().getLong("Abilities.Earth.Extraction.Cooldown");
this.range = 5;
this.selectRange = getConfig().getInt("Abilities.Earth.Extraction.SelectRange");
if (!bPlayer.canBend(this)) {
return;
}
originBlock = player.getTargetBlock((HashSet<Material>) null, range);
originBlock = player.getTargetBlock((HashSet<Material>) null, selectRange);
if (originBlock == null) {
return;
}
@ -134,12 +134,12 @@ public class Extraction extends EarthAbility {
this.tripleChance = tripleChance;
}
public int getRange() {
return range;
public int getSelectRange() {
return selectRange;
}
public void setRange(int range) {
this.range = range;
public void setSelectRange(int selectRange) {
this.selectRange = selectRange;
}
public Block getOriginBlock() {

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource;
@ -526,7 +525,7 @@ public class LavaFlow extends LavaAbility {
*/
public static ArrayList<LavaFlow> getLavaFlow(Player player, AbilityType type) {
ArrayList<LavaFlow> list = new ArrayList<LavaFlow>();
for (LavaFlow lf : CoreAbility.getAbilities(LavaFlow.class)) {
for (LavaFlow lf : getAbilities(LavaFlow.class)) {
if (lf.player != null && lf.player == player && lf.type != null && lf.type == type) {
list.add(lf);
}

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
@ -100,7 +99,7 @@ public class LavaSurge extends LavaAbility {
return false;
}
LavaSurge otherSurge = CoreAbility.getAbility(player, this.getClass());
LavaSurge otherSurge = getAbility(player, this.getClass());
if (otherSurge != null) {
otherSurge.revertFracture();
}

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.FireBlast;
@ -50,7 +49,7 @@ public class LavaSurgeWall extends LavaAbility {
this.range = getConfig().getDouble("Abilities.Water.Surge.Wall.Range");
this.cooldown = GeneralMethods.getGlobalCooldown();
LavaSurgeWave wave = CoreAbility.getAbility(player, LavaSurgeWave.class);
LavaSurgeWave wave = getAbility(player, LavaSurgeWave.class);
if (wave != null && wave.isProgressing()) {
LavaSurgeWave.launch(player);
return;
@ -78,7 +77,7 @@ public class LavaSurgeWall extends LavaAbility {
}
private void cancelPrevious() {
LavaSurgeWall lavaWall = CoreAbility.getAbility(player, LavaSurgeWall.class);
LavaSurgeWall lavaWall = getAbility(player, LavaSurgeWall.class);
if (lavaWall != null) {
if (lavaWall.progressing) {
lavaWall.removeLava(lavaWall.sourceBlock);
@ -278,7 +277,7 @@ public class LavaSurgeWall extends LavaAbility {
}
public static void moveLava(Player player) {
LavaSurgeWall wall = CoreAbility.getAbility(player, LavaSurgeWall.class);
LavaSurgeWall wall = getAbility(player, LavaSurgeWall.class);
if (wall != null) {
wall.moveLava();
}
@ -286,7 +285,7 @@ public class LavaSurgeWall extends LavaAbility {
@SuppressWarnings("deprecation")
public static void form(Player player) {
if (!CoreAbility.hasAbility(player, LavaSurgeWall.class)) {
if (!hasAbility(player, LavaSurgeWall.class)) {
new LavaSurgeWave(player);
return;
} else if (isLavabendable(player.getTargetBlock((HashSet<Byte>) null, SURGE_WAVE_RANGE))) {
@ -310,7 +309,7 @@ public class LavaSurgeWall extends LavaAbility {
}
public static boolean wasBrokenFor(Player player, Block block) {
LavaSurgeWall wall = CoreAbility.getAbility(player, LavaSurgeWall.class);
LavaSurgeWall wall = getAbility(player, LavaSurgeWall.class);
if (wall != null) {
if (wall.sourceBlock == null) {
return false;

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.LavaAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -65,7 +64,7 @@ public class LavaSurgeWave extends LavaAbility {
}
if (prepare()) {
LavaSurgeWave wave = CoreAbility.getAbility(player, LavaSurgeWave.class);
LavaSurgeWave wave = getAbility(player, LavaSurgeWave.class);
if (wave != null) {
wave.remove();
}
@ -87,7 +86,7 @@ public class LavaSurgeWave extends LavaAbility {
}
private void cancelPrevious() {
LavaSurgeWave oldWave = CoreAbility.getAbility(player, LavaSurgeWave.class);
LavaSurgeWave oldWave = getAbility(player, LavaSurgeWave.class);
if (oldWave != null) {
if (oldWave.progressing) {
oldWave.breakBlock();
@ -266,7 +265,7 @@ public class LavaSurgeWave extends LavaAbility {
}
public static boolean isBlockInWave(Block block) {
for (LavaSurgeWave lavaWave : CoreAbility.getAbilities(LavaSurgeWave.class)) {
for (LavaSurgeWave lavaWave : getAbilities(LavaSurgeWave.class)) {
if (block.getLocation().distance(lavaWave.location) <= 2 * lavaWave.radius) {
return true;
}
@ -275,7 +274,7 @@ public class LavaSurgeWave extends LavaAbility {
}
public static boolean isBlockWave(Block block) {
for (LavaSurgeWave lavaWave : CoreAbility.getAbilities(LavaSurgeWave.class)) {
for (LavaSurgeWave lavaWave : getAbilities(LavaSurgeWave.class)) {
if (lavaWave.waveBlocks.containsKey(block)) {
return true;
}
@ -284,14 +283,14 @@ public class LavaSurgeWave extends LavaAbility {
}
public static void launch(Player player) {
LavaSurgeWave lavaWave = CoreAbility.getAbility(player, LavaSurgeWave.class);
LavaSurgeWave lavaWave = getAbility(player, LavaSurgeWave.class);
if (lavaWave != null) {
lavaWave.moveLava();
}
}
public static void cleanup() {
for (LavaSurgeWave lavaWave : CoreAbility.getAbilities(LavaSurgeWave.class)) {
for (LavaSurgeWave lavaWave : getAbilities(LavaSurgeWave.class)) {
for (Block block : lavaWave.waveBlocks.keySet()) {
block.setType(Material.AIR);
lavaWave.waveBlocks.remove(block);

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.MetalAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -55,16 +54,16 @@ public class MetalClips extends MetalAbility {
public MetalClips(Player player, int abilityType) {
super(player);
if (CoreAbility.hasAbility(player, MetalClips.class)) {
if (hasAbility(player, MetalClips.class)) {
return;
}
this.abilityType = abilityType;
this.range = 10;
this.canLoot = player.hasPermission("bending.ability.MetalClips.loot");
this.canUse4Clips = player.hasPermission("bending.ability.MetalClips.4clips");
this.armorTime = getConfig().getInt("Abilities.Earth.MetalClips.Duration");
this.crushInterval = getConfig().getInt("Abilities.Earth.MetalClips.DamageInterval");;
this.range = getConfig().getDouble("Abilities.Earth.MetalClips.Range");
this.cooldown = getConfig().getInt("Abilities.Earth.MetalClips.Cooldown");
this.crushDamage = getConfig().getInt("Abilities.Earth.MetalClips.Damage");
this.magnetRange = getConfig().getInt("Abilities.Earth.MetalClips.MagnetRange");
@ -454,7 +453,7 @@ public class MetalClips extends MetalAbility {
}
public static boolean isControllingEntity(Player player) {
MetalClips clips = CoreAbility.getAbility(player, MetalClips.class);
MetalClips clips = getAbility(player, MetalClips.class);
return clips != null && player.isSneaking() && clips.targetEntity != null;
}

View file

@ -1,7 +1,5 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.configuration.ConfigManager;
@ -25,7 +23,7 @@ public class RaiseEarth extends EarthAbility {
private long time;
private long interval;
private long cooldown;
private double range;
private double selectRange;
private double speed;
private Block block;
private Vector direction;
@ -45,7 +43,7 @@ public class RaiseEarth extends EarthAbility {
if (bPlayer.isAvatarState()) {
height = (int) (2.0 / 5.0 * (double) AvatarState.getValue(height));
}
block = BlockSource.getEarthSourceBlock(player, range, ClickType.LEFT_CLICK);
block = BlockSource.getEarthSourceBlock(player, selectRange, ClickType.LEFT_CLICK);
if (block == null) {
return;
}
@ -90,13 +88,13 @@ public class RaiseEarth extends EarthAbility {
}
private void setFields() {
this.speed = getConfig().getDouble("Abilities.Earth.RaiseEarth.Speed");
this.height = getConfig().getInt("Abilities.Earth.RaiseEarth.Column.Height");
this.range = 20;
this.speed = 8;
this.selectRange = getConfig().getDouble("Abilities.Earth.RaiseEarth.Column.SelectRange");
this.cooldown = getConfig().getLong("Abilities.Earth.RaiseEarth.Column.Cooldown");
this.direction = new Vector(0, 1, 0);
this.interval = (long) (1000.0 / speed);
this.cooldown = GeneralMethods.getGlobalCooldown();
this.affectedBlocks = new ConcurrentHashMap<Block, Block>();
this.affectedBlocks = new ConcurrentHashMap<>();
}
private boolean canInstantiate() {
@ -142,7 +140,7 @@ public class RaiseEarth extends EarthAbility {
public static void revertAffectedBlock(Block block) {
ALL_AFFECTED_BLOCKS.remove(block);
for (RaiseEarth raiseEarth : CoreAbility.getAbilities(RaiseEarth.class)) {
for (RaiseEarth raiseEarth : getAbilities(RaiseEarth.class)) {
raiseEarth.affectedBlocks.remove(block);
}
}
@ -204,14 +202,6 @@ public class RaiseEarth extends EarthAbility {
this.interval = interval;
}
public double getRange() {
return range;
}
public void setRange(double range) {
this.range = range;
}
public double getSpeed() {
return speed;
}
@ -255,5 +245,13 @@ public class RaiseEarth extends EarthAbility {
public void setLocation(Location location) {
this.location = location;
}
public double getSelectRange() {
return selectRange;
}
public void setSelectRange(double selectRange) {
this.selectRange = selectRange;
}
}

View file

@ -1,6 +1,5 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.EarthAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource;
@ -15,7 +14,7 @@ import org.bukkit.util.Vector;
public class RaiseEarthWall extends EarthAbility {
private int range;
private int selectRange;
private int height;
private int width;
private long cooldown;
@ -23,10 +22,10 @@ public class RaiseEarthWall extends EarthAbility {
public RaiseEarthWall(Player player) {
super(player);
this.range = getConfig().getInt("Abilities.Earth.RaiseEarth.Wall.Range");
this.selectRange = getConfig().getInt("Abilities.Earth.RaiseEarth.Wall.SelectRange");
this.height = getConfig().getInt("Abilities.Earth.RaiseEarth.Wall.Height");
this.width = getConfig().getInt("Abilities.Earth.RaiseEarth.Wall.Width");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Earth.RaiseEarth.Wall.Cooldown");
if (!bPlayer.canBend(this)) {
return;
@ -46,10 +45,10 @@ public class RaiseEarthWall extends EarthAbility {
Vector orth = new Vector(ox, oy, oz);
orth = orth.normalize();
Block sblock = BlockSource.getEarthSourceBlock(player, range, ClickType.SHIFT_DOWN);
Block sblock = BlockSource.getEarthSourceBlock(player, selectRange, ClickType.SHIFT_DOWN);
if (sblock == null) {
location = getTargetEarthBlock(range).getLocation();
location = getTargetEarthBlock(selectRange).getLocation();
} else {
location = sblock.getLocation();
}
@ -120,11 +119,11 @@ public class RaiseEarthWall extends EarthAbility {
}
public int getRange() {
return range;
return selectRange;
}
public void setRange(int range) {
this.range = range;
this.selectRange = range;
}
public int getHeight() {
@ -151,4 +150,12 @@ public class RaiseEarthWall extends EarthAbility {
this.location = location;
}
public int getSelectRange() {
return selectRange;
}
public void setSelectRange(int selectRange) {
this.selectRange = selectRange;
}
}

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.SandAbility;
import com.projectkorra.projectkorra.util.Flight;
@ -23,7 +22,6 @@ public class SandSpout extends SandAbility {
private int blindnessTime;
private long time;
private long interval;
private long cooldown;
private double damage;
private double height;
private double currentHeight;
@ -34,14 +32,13 @@ public class SandSpout extends SandAbility {
this.currentHeight = 0;
this.angle = 0;
this.interval = 100;
this.cooldown = 0;
this.interval = getConfig().getLong("Abilities.Earth.SandSpout.Interval");
this.canSpiral = getConfig().getBoolean("Abilities.Earth.SandSpout.Spiral");
this.height = getConfig().getDouble("Abilities.Earth.SandSpout.Height");
this.blindnessTime = getConfig().getInt("Abilities.Earth.SandSpout.BlindnessTime");
this.damage = getConfig().getInt("Abilities.Earth.SandSpout.SpoutDamage");
SandSpout oldSandSpout = CoreAbility.getAbility(player, SandSpout.class);
SandSpout oldSandSpout = getAbility(player, SandSpout.class);
if (oldSandSpout != null) {
oldSandSpout.remove();
return;
@ -195,7 +192,7 @@ public class SandSpout extends SandAbility {
public static boolean removeSpouts(Location location, double radius, Player sourcePlayer) {
boolean removed = false;
for (SandSpout spout : CoreAbility.getAbilities(SandSpout.class)) {
for (SandSpout spout : getAbilities(SandSpout.class)) {
Player player = spout.player;
if (!player.equals(sourcePlayer)) {
Location loc1 = player.getLocation().getBlock().getLocation();
@ -234,7 +231,7 @@ public class SandSpout extends SandAbility {
@Override
public long getCooldown() {
return cooldown;
return 0;
}
@Override
@ -310,9 +307,5 @@ public class SandSpout extends SandAbility {
public void setCurrentHeight(double currentHeight) {
this.currentHeight = currentHeight;
}
public void setCooldown(long cooldown) {
this.cooldown = cooldown;
}
}

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import org.bukkit.Effect;
@ -21,8 +20,8 @@ public class Shockwave extends EarthAbility {
public Shockwave(Player player) {
super(player);
this.angle = Math.toRadians(40);
this.cooldown = 1500;
this.angle = Math.toRadians(getConfig().getDouble("Abilities.Earth.Shockwave.Angle"));
this.cooldown = getConfig().getLong("Abilities.Earth.Shockwave.Cooldown");
this.chargeTime = getConfig().getLong("Abilities.Earth.Shockwave.ChargeTime");
this.threshold = getConfig().getDouble("Abilities.Earth.Shockwave.FallThreshold");
this.range = getConfig().getDouble("Abilities.Earth.Shockwave.Range");
@ -92,7 +91,7 @@ public class Shockwave extends EarthAbility {
}
public static void coneShockwave(Player player) {
Shockwave shockWave = CoreAbility.getAbility(player, Shockwave.class);
Shockwave shockWave = getAbility(player, Shockwave.class);
if (shockWave != null) {
if (shockWave.charged) {
double dtheta = 360.0 / (2 * Math.PI * shockWave.range) - 1;

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.earthbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.EarthAbility;
import org.bukkit.Effect;
@ -133,8 +132,8 @@ public class Tremorsense extends EarthAbility {
for (Player player : server.getOnlinePlayers()) {
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer != null && !CoreAbility.hasAbility(player, Tremorsense.class)
&& bPlayer.canBend(CoreAbility.getAbility("Tremorsense"))) {
if (bPlayer != null && !hasAbility(player, Tremorsense.class)
&& bPlayer.canBend(getAbility("Tremorsense"))) {
new Tremorsense(player);
}
}

View file

@ -1,6 +1,5 @@
package com.projectkorra.projectkorra.firebending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -20,9 +19,9 @@ public class Blaze extends FireAbility {
super(player);
this.speed = 2;
this.cooldown = GeneralMethods.getGlobalCooldown();
this.arc = getConfig().getInt("Abilities.Fire.Blaze.ArcOfFire.Arc");
this.range = getConfig().getDouble("Abilities.Fire.Blaze.ArcOfFire.Range");
this.cooldown = getConfig().getLong("Abilities.Fire.Blaze.Cooldown");
this.arc = getConfig().getInt("Abilities.Fire.Blaze.Arc");
this.range = getConfig().getDouble("Abilities.Fire.Blaze.Range");
if (!bPlayer.canBend(this)) {
return;

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.firebending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.waterbending.PlantRegrowth;
@ -37,7 +36,7 @@ public class BlazeArc extends FireAbility {
public BlazeArc(Player player, Location location, Vector direction, double range) {
super(player);
this.range = getDayFactor(range);
this.speed = 15;
this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed");
this.interval = (long) (1000. / speed);
this.origin = location.clone();
this.location = origin.clone();
@ -147,7 +146,7 @@ public class BlazeArc extends FireAbility {
}
public static void removeAroundPoint(Location location, double radius) {
for (BlazeArc stream : CoreAbility.getAbilities(BlazeArc.class)) {
for (BlazeArc stream : getAbilities(BlazeArc.class)) {
if (stream.location.getWorld().equals(location.getWorld())) {
if (stream.location.distanceSquared(location) <= radius * radius) {
stream.remove();

View file

@ -1,6 +1,5 @@
package com.projectkorra.projectkorra.firebending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -18,9 +17,9 @@ public class BlazeRing extends FireAbility {
public BlazeRing(Player player) {
super(player);
this.range = getConfig().getInt("Abilities.Fire.Blaze.RingOfFire.Range");
this.angleIncrement = 10;
this.cooldown = GeneralMethods.getGlobalCooldown();
this.range = getConfig().getInt("Abilities.Fire.Blaze.Ring.Range");
this.angleIncrement = getConfig().getDouble("Abilities.Fire.Blaze.Ring.Angle");
this.cooldown = getConfig().getLong("Abilities.Fire.Blaze.Ring.Cooldown");
this.location = player.getLocation();
this.range = (int) AvatarState.getValue(this.range, player);

View file

@ -22,7 +22,6 @@ public class Combustion extends CombustionAbility {
private boolean breakBlocks;
private int ticks;
private long cooldown;
private long chargeTime;
private float power;
private double damage;
private double radius;
@ -44,7 +43,6 @@ public class Combustion extends CombustionAbility {
this.breakBlocks = getConfig().getBoolean("Abilities.Fire.Combustion.BreakBlocks");
this.power = (float) getConfig().getDouble("Abilities.Fire.Combustion.Power");
this.cooldown = getConfig().getLong("Abilities.Fire.Combustion.Cooldown");
this.chargeTime = getConfig().getLong("Abilities.Fire.Combustion.ChargeTime");
this.damage = getConfig().getDouble("Abilities.Fire.Combustion.Damage");
this.radius = getConfig().getDouble("Abilities.Fire.Combustion.Radius");
this.speed = getConfig().getDouble("Abilities.Fire.Combustion.Speed");
@ -192,14 +190,6 @@ public class Combustion extends CombustionAbility {
this.ticks = ticks;
}
public long getChargeTime() {
return chargeTime;
}
public void setChargeTime(long chargeTime) {
this.chargeTime = chargeTime;
}
public float getPower() {
return power;
}

View file

@ -39,7 +39,7 @@ public class FireBlast extends FireAbility {
private double range;
private double damage;
private double speed;
private double radius;
private double collisionRadius;
private double fireTicks;
private double pushFactor;
private Random random;
@ -55,24 +55,13 @@ public class FireBlast extends FireAbility {
return;
}
this.isFireBurst = true;
setFields();
this.safeBlocks = safeBlocks;
this.damage = damage;
this.powerFurnace = true;
this.showParticles = true;
this.radius = 2;
this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate");
this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Cooldown");
this.range = getConfig().getDouble("Abilities.Fire.FireBlast.Range");
this.speed = getConfig().getDouble("Abilities.Fire.FireBlast.Speed");
this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.FireTicks");
this.pushFactor = getConfig().getDouble("Abilities.Fire.FireBlast.Push");
this.random = new Random();
this.location = location.clone();
this.origin = location.clone();
this.direction = direction.clone().normalize();
this.range = getDayFactor(range);
this.damage *= 1.5;
@ -87,23 +76,10 @@ public class FireBlast extends FireAbility {
} else if (player.getEyeLocation().getBlock().isLiquid() || FireBlastCharged.isCharging(player)) {
return;
}
this.isFireBurst = false;
this.powerFurnace = true;
this.showParticles = true;
this.radius = 2;
this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate");
this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Cooldown");
this.range = getConfig().getDouble("Abilities.Fire.FireBlast.Range");
this.damage = getConfig().getInt("Abilities.Fire.FireBlast.Damage");
this.speed = getConfig().getDouble("Abilities.Fire.FireBlast.Speed");
this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.FireTicks");
this.pushFactor = getConfig().getDouble("Abilities.Fire.FireBlast.Push");
this.random = new Random();
setFields();
this.safeBlocks = new ArrayList<>();
this.range = getDayFactor(this.range);
this.location = player.getEyeLocation();
this.origin = player.getEyeLocation();
this.direction = player.getEyeLocation().getDirection().normalize();
@ -111,7 +87,21 @@ public class FireBlast extends FireAbility {
start();
bPlayer.addCooldown(this);
}
}
private void setFields() {
this.isFireBurst = true;
this.powerFurnace = true;
this.showParticles = true;
this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate");
this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Cooldown");
this.range = getConfig().getDouble("Abilities.Fire.FireBlast.Range");
this.speed = getConfig().getDouble("Abilities.Fire.FireBlast.Speed");
this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.CollisionRadius");
this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.FireTicks");
this.pushFactor = getConfig().getDouble("Abilities.Fire.FireBlast.Push");
this.random = new Random();
}
private void advanceLocation() {
if (showParticles) {
@ -142,7 +132,7 @@ public class FireBlast extends FireAbility {
}
private void ignite(Location location) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, collisionRadius)) {
if (BlazeArc.isIgnitable(player, block)
&& !safeBlocks.contains(block)
&& !GeneralMethods.isRegionProtectedFromBuild(this, block.getLocation())) {
@ -202,14 +192,14 @@ public class FireBlast extends FireAbility {
AirAbility.removeAirSpouts(location, player);
Player source = player;
if (EarthBlast.annihilateBlasts(location, radius, source)
|| WaterManipulation.annihilateBlasts(location, radius, source)
|| FireBlast.annihilateBlasts(location, radius, source)) {
if (EarthBlast.annihilateBlasts(location, collisionRadius, source)
|| WaterManipulation.annihilateBlasts(location, collisionRadius, source)
|| FireBlast.annihilateBlasts(location, collisionRadius, source)) {
remove();
return;
}
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, radius)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, collisionRadius)) {
affect(entity);
if (entity instanceof LivingEntity) {
break;
@ -350,12 +340,12 @@ public class FireBlast extends FireAbility {
this.speed = speed;
}
public double getRadius() {
return radius;
public double getCollisionRadius() {
return collisionRadius;
}
public void setRadius(double radius) {
this.radius = radius;
public void setCollisionRadius(double collisionRadius) {
this.collisionRadius = collisionRadius;
}
public double getFireTicks() {

View file

@ -23,7 +23,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class FireBlastCharged extends FireAbility {
private static ConcurrentHashMap<Entity, FireBlastCharged> EXPLOSIONS = new ConcurrentHashMap<Entity, FireBlastCharged>();
private static final ConcurrentHashMap<Entity, FireBlastCharged> EXPLOSIONS = new ConcurrentHashMap<>();
private boolean charged;
private boolean launched;
@ -34,7 +34,7 @@ public class FireBlastCharged extends FireAbility {
private long interval;
private double maxDamage;
private double range;
private double radius;
private double collisionRadius;
private double damageRadius;
private double explosionRadius;
private double innerRadius;
@ -54,7 +54,7 @@ public class FireBlastCharged extends FireAbility {
this.chargeTime = getConfig().getLong("Abilities.Fire.FireBlast.Charged.ChargeTime");
this.time = System.currentTimeMillis();
this.interval = 25;
this.radius = 2;
this.collisionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.CollisionRadius");
this.maxDamage = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.Damage");
this.range = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.Range");
this.damageRadius = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.DamageRadius");
@ -189,7 +189,7 @@ public class FireBlastCharged extends FireAbility {
}
private void executeFireball() {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, collisionRadius)) {
ParticleEffect.FLAME.display(block.getLocation(), 0.5F, 0.5F, 0.5F, 0, 5);
ParticleEffect.SMOKE.display(block.getLocation(), 0.5F, 0.5F, 0.5F, 0, 2);
if ((new Random()).nextInt(4) == 0) {
@ -199,7 +199,7 @@ public class FireBlastCharged extends FireAbility {
}
boolean exploded = false;
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2 * radius)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2 * collisionRadius)) {
if (entity.getEntityId() == player.getEntityId()
|| GeneralMethods.isRegionProtectedFromBuild(this, entity.getLocation())) {
continue;
@ -216,7 +216,7 @@ public class FireBlastCharged extends FireAbility {
}
private void ignite(Location location) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, radius)) {
for (Block block : GeneralMethods.getBlocksAroundPoint(location, collisionRadius)) {
if (BlazeArc.isIgnitable(player, block)) {
if (block.getType() != Material.FIRE) {
BlazeArc.getReplacedBlocks().put(block.getLocation(), block.getState().getData());
@ -247,7 +247,7 @@ public class FireBlastCharged extends FireAbility {
launched = true;
location = player.getEyeLocation();
origin = location.clone();
direction = location.getDirection().normalize().multiply(radius);
direction = location.getDirection().normalize().multiply(collisionRadius);
}
if (System.currentTimeMillis() > time + interval) {
@ -309,4 +309,148 @@ public class FireBlastCharged extends FireAbility {
return false;
}
public boolean isCharged() {
return charged;
}
public void setCharged(boolean charged) {
this.charged = charged;
}
public boolean isLaunched() {
return launched;
}
public void setLaunched(boolean launched) {
this.launched = launched;
}
public boolean isCanDamageBlocks() {
return canDamageBlocks;
}
public void setCanDamageBlocks(boolean canDamageBlocks) {
this.canDamageBlocks = canDamageBlocks;
}
public boolean isDissipate() {
return dissipate;
}
public void setDissipate(boolean dissipate) {
this.dissipate = dissipate;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public long getChargeTime() {
return chargeTime;
}
public void setChargeTime(long chargeTime) {
this.chargeTime = chargeTime;
}
public long getInterval() {
return interval;
}
public void setInterval(long interval) {
this.interval = interval;
}
public double getMaxDamage() {
return maxDamage;
}
public void setMaxDamage(double maxDamage) {
this.maxDamage = maxDamage;
}
public double getRange() {
return range;
}
public void setRange(double range) {
this.range = range;
}
public double getCollisionRadius() {
return collisionRadius;
}
public void setCollisionRadius(double collisionRadius) {
this.collisionRadius = collisionRadius;
}
public double getDamageRadius() {
return damageRadius;
}
public void setDamageRadius(double damageRadius) {
this.damageRadius = damageRadius;
}
public double getExplosionRadius() {
return explosionRadius;
}
public void setExplosionRadius(double explosionRadius) {
this.explosionRadius = explosionRadius;
}
public double getInnerRadius() {
return innerRadius;
}
public void setInnerRadius(double innerRadius) {
this.innerRadius = innerRadius;
}
public double getFireTicks() {
return fireTicks;
}
public void setFireTicks(double fireTicks) {
this.fireTicks = fireTicks;
}
public TNTPrimed getExplosion() {
return explosion;
}
public void setExplosion(TNTPrimed explosion) {
this.explosion = explosion;
}
public Location getOrigin() {
return origin;
}
public void setOrigin(Location origin) {
this.origin = origin;
}
public Vector getDirection() {
return direction;
}
public void setDirection(Vector direction) {
this.direction = direction;
}
public static ConcurrentHashMap<Entity, FireBlastCharged> getExplosions() {
return EXPLOSIONS;
}
public void setLocation(Location location) {
this.location = location;
}
}

View file

@ -33,10 +33,10 @@ public class FireBurst extends FireAbility {
this.damage = getConfig().getInt("Abilities.Fire.FireBurst.Damage");
this.chargeTime = getConfig().getLong("Abilities.Fire.FireBurst.ChargeTime");
this.range = getConfig().getLong("Abilities.Fire.FireBurst.Range");
this.cooldown = 0;
this.angleTheta = 10;
this.anglePhi = 10;
this.particlesPercentage = 5;
this.cooldown = getConfig().getLong("Abilities.Fire.FireBurst.Cooldown");
this.angleTheta = getConfig().getDouble("Abilities.Fire.FireBurst.AngleTheta");
this.anglePhi = getConfig().getDouble("Abilities.Fire.FireBurst.AnglePhi");
this.particlesPercentage = getConfig().getDouble("Abilities.Fire.FireBurst.ParticlesPercentage");
this.blasts = new ArrayList<>();
if (!bPlayer.canBend(this) || hasAbility(player, FireBurst.class)) {

View file

@ -41,8 +41,8 @@ public class FireShield extends FireAbility {
this.shield = shield;
this.ignite = true;
this.interval = 100;
this.cooldown = shield ? 0 : GeneralMethods.getGlobalCooldown();
this.interval = getConfig().getLong("Abilities.Fire.FireShield.Interval");
this.cooldown = shield ? 0 : getConfig().getLong("Abilities.Fire.FireShield.Cooldown");
this.duration = getConfig().getLong("Abilities.Fire.FireShield.Duration");
this.radius = getConfig().getDouble("Abilities.Fire.FireShield.Radius");
this.discRadius = getConfig().getDouble("Abilities.Fire.FireShield.DiscRadius");

View file

@ -25,7 +25,7 @@ public class HeatControlCook extends FireAbility {
this.time = System.currentTimeMillis();
this.cookTime = 2000;
this.cookTime = getConfig().getLong("Abilities.Fire.HeatControl.Cook.CookTime");
this.item = player.getItemInHand();
if (isCookable(item.getType())) {
@ -135,5 +135,33 @@ public class HeatControlCook extends FireAbility {
public boolean isHarmlessAbility() {
return true;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public long getCookTime() {
return cookTime;
}
public void setCookTime(long cookTime) {
this.cookTime = cookTime;
}
public ItemStack getItem() {
return item;
}
public void setItem(ItemStack item) {
this.item = item;
}
public static Material[] getCookableMaterials() {
return COOKABLE_MATERIALS;
}
}

View file

@ -29,7 +29,7 @@ public class HeatControlExtinguish extends FireAbility {
this.range = getConfig().getDouble("Abilities.Fire.HeatControl.Extinguish.Range");
this.radius = getConfig().getDouble("Abilities.Fire.HeatControl.Extinguish.Radius");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Fire.HeatControl.Extinguish.Cooldown");
this.range = getDayFactor(this.range);
this.radius = getDayFactor(this.radius);
@ -95,5 +95,29 @@ public class HeatControlExtinguish extends FireAbility {
public boolean isHarmlessAbility() {
return true;
}
public double getRange() {
return range;
}
public void setRange(double range) {
this.range = range;
}
public double getRadius() {
return radius;
}
public void setRadius(double radius) {
this.radius = radius;
}
public void setCooldown(long cooldown) {
this.cooldown = cooldown;
}
public void setLocation(Location location) {
this.location = location;
}
}

View file

@ -31,7 +31,7 @@ public class Illumination extends FireAbility {
}
this.range = getConfig().getDouble("Abilities.Fire.Illumination.Range");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.cooldown = getConfig().getLong("Abilities.Fire.Illumination.Cooldown");
this.range = getDayFactor(this.range);

View file

@ -40,14 +40,14 @@ public class WallOfFire extends FireAbility {
super(player);
this.active = true;
this.maxAngle = 50;
this.interval = 250;
this.maxAngle = getConfig().getDouble("Abilities.Fire.WallOfFire.MaxAngle");
this.interval = getConfig().getLong("Abilities.Fire.WallOfFire.Interval");
this.range = getConfig().getInt("Abilities.Fire.WallOfFire.Range");
this.height = getConfig().getInt("Abilities.Fire.WallOfFire.Height");
this.width = getConfig().getInt("Abilities.Fire.WallOfFire.Width");
this.damage = getConfig().getInt("Abilities.Fire.WallOfFire.Damage");
this.cooldown = getConfig().getLong("Abilities.Fire.WallOfFire.Cooldown");
this.damageInterval = getConfig().getLong("Abilities.Fire.WallOfFire.Interval");
this.damageInterval = getConfig().getLong("Abilities.Fire.WallOfFire.DamageInterval");
this.duration = getConfig().getLong("Abilities.Fire.WallOfFire.Duration");
this.fireTicks = getConfig().getDouble("Abilities.Fire.WallOfFire.FireTicks");
this.random = new Random();

View file

@ -5,7 +5,6 @@ import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.BloodAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
import com.projectkorra.projectkorra.util.TempPotionEffect;
@ -40,7 +39,7 @@ public class Bloodbending extends BloodAbility {
public Bloodbending(Player player) {
super(player);
Bloodbending ability = CoreAbility.getAbility(player, getClass());
Bloodbending ability = getAbility(player, getClass());
if (ability != null) {
ability.remove();
return;
@ -122,7 +121,7 @@ public class Bloodbending extends BloodAbility {
}
public static void launch(Player player) {
Bloodbending bloodbending = CoreAbility.getAbility(player, Bloodbending.class);
Bloodbending bloodbending = getAbility(player, Bloodbending.class);
if (bloodbending != null) {
bloodbending.launch();
}

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.HealingAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.chiblocking.Smokescreen;
@ -31,7 +30,7 @@ public class HealingWaters extends HealingAbility {
time = System.currentTimeMillis();
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer != null && bPlayer.canBend(CoreAbility.getAbility("HealingWaters"))) {
if (bPlayer != null && bPlayer.canBend(getAbility("HealingWaters"))) {
heal(player);
}
}
@ -119,8 +118,7 @@ public class HealingWaters extends HealingAbility {
}
public static int getDuration() {
// TODO: add a duration config option
return 70;
return getConfig().getInt("Abilities.Water.HealingWaters.Duration");
}
@Override

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
@ -36,7 +35,7 @@ public class IceBlast extends IceAbility {
private long interval;
private double range;
private double damage;
private double radius;
private double collisionRadius;
private double deflectRange;
private Block sourceBlock;
private Location location;
@ -48,9 +47,9 @@ public class IceBlast extends IceAbility {
super(player);
this.data = 0;
this.interval = 20;
this.radius = 2;
this.deflectRange = 3;
this.interval = getConfig().getLong("Abilities.Water.IceBlast.Interval");
this.collisionRadius = getConfig().getDouble("Abilities.Water.IceBlast.CollisionRadius");
this.deflectRange = getConfig().getDouble("Abilities.Water.IceBlast.DeflectRange");
this.range = getConfig().getDouble("Abilities.Water.IceBlast.Range");
this.damage = getConfig().getInt("Abilities.Water.IceBlast.Damage");
this.cooldown = getConfig().getInt("Abilities.Water.IceBlast.Cooldown");
@ -75,7 +74,7 @@ public class IceBlast extends IceAbility {
}
private void prepare(Block block) {
for (IceBlast iceBlast : CoreAbility.getAbilities(player, IceBlast.class)) {
for (IceBlast iceBlast : getAbilities(player, IceBlast.class)) {
if (iceBlast.prepared) {
iceBlast.remove();
}
@ -85,13 +84,13 @@ public class IceBlast extends IceAbility {
location = sourceBlock.getLocation();
prepared = true;
if (CoreAbility.getAbilities(player, IceBlast.class).isEmpty()) {
if (getAbilities(player, IceBlast.class).isEmpty()) {
start();
}
}
private static void block(Player player) {
for (IceBlast iceBlast : CoreAbility.getAbilities(player, IceBlast.class)) {
for (IceBlast iceBlast : getAbilities(player, IceBlast.class)) {
if (!iceBlast.location.getWorld().equals(player.getWorld())) {
continue;
} else if (!iceBlast.progressing) {
@ -118,7 +117,7 @@ public class IceBlast extends IceAbility {
return;
}
for (IceBlast ice : CoreAbility.getAbilities(IceBlast.class)) {
for (IceBlast ice : getAbilities(IceBlast.class)) {
if (ice.prepared) {
ice.throwIce();
}
@ -270,7 +269,7 @@ public class IceBlast extends IceAbility {
return;
}
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, radius)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, collisionRadius)) {
if (entity.getEntityId() != player.getEntityId() && entity instanceof LivingEntity) {
affect((LivingEntity) entity);
progressing = false;
@ -401,12 +400,12 @@ public class IceBlast extends IceAbility {
this.damage = damage;
}
public double getRadius() {
return radius;
public double getCollisionRadius() {
return collisionRadius;
}
public void setRadius(double radius) {
this.radius = radius;
public void setCollisionRadius(double collisionRadius) {
this.collisionRadius = collisionRadius;
}
public double getDeflectRange() {

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
@ -36,7 +35,7 @@ public class IceSpikeBlast extends IceAbility {
private long slowCooldown;
private double range;
private double damage;
private double affectingRadius;
private double collisionRadius;
private double deflectRange;
private Block sourceBlock;
private Location location;
@ -48,15 +47,15 @@ public class IceSpikeBlast extends IceAbility {
super(player);
this.data = 0;
this.interval = 20;
this.slowCooldown = 5000;
this.affectingRadius = 2;
this.deflectRange = 3;
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Projectile.Range");
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Projectile.Damage");
this.cooldown = GeneralMethods.getGlobalCooldown();
this.slowPower = 2;
this.slowDuration = 70;
this.interval = getConfig().getLong("Abilities.Water.IceSpike.Blast.Interval");
this.slowCooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.SlowCooldown");
this.collisionRadius = getConfig().getDouble("Abilities.Water.IceSpike.Blast.CollisionRadius");
this.deflectRange = getConfig().getDouble("Abilities.Water.IceSpike.Blast.DeflectRange");
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Range");
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Blast.Damage");
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Blast.Cooldown");
this.slowPower = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowPower");
this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.Blast.SlowDuration");
if (!bPlayer.canBend(this) || !bPlayer.canIcebend()) {
return;
@ -98,7 +97,7 @@ public class IceSpikeBlast extends IceAbility {
}
private void prepare(Block block) {
for (IceSpikeBlast iceSpike : CoreAbility.getAbilities(player, IceSpikeBlast.class)) {
for (IceSpikeBlast iceSpike : getAbilities(player, IceSpikeBlast.class)) {
if (iceSpike.prepared) {
iceSpike.remove();
}
@ -177,7 +176,7 @@ public class IceSpikeBlast extends IceAbility {
return;
}
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, affectingRadius)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, collisionRadius)) {
if (entity.getEntityId() != player.getEntityId() && entity instanceof LivingEntity) {
affect((LivingEntity) entity);
progressing = false;
@ -270,7 +269,7 @@ public class IceSpikeBlast extends IceAbility {
return;
}
for (IceSpikeBlast ice : CoreAbility.getAbilities(player, IceSpikeBlast.class)) {
for (IceSpikeBlast ice : getAbilities(player, IceSpikeBlast.class)) {
if (ice.prepared) {
ice.throwIce();
activate = true;
@ -286,7 +285,7 @@ public class IceSpikeBlast extends IceAbility {
}
private static void block(Player player) {
for (IceSpikeBlast iceSpike : CoreAbility.getAbilities(IceSpikeBlast.class)) {
for (IceSpikeBlast iceSpike : getAbilities(IceSpikeBlast.class)) {
if (iceSpike.player.equals(player)) {
continue;
} else if (!iceSpike.location.getWorld().equals(player.getWorld())) {
@ -309,7 +308,7 @@ public class IceSpikeBlast extends IceAbility {
}
private static void redirect(Player player) {
for (IceSpikeBlast iceSpike : CoreAbility.getAbilities(IceSpikeBlast.class)) {
for (IceSpikeBlast iceSpike : getAbilities(IceSpikeBlast.class)) {
if (!iceSpike.progressing) {
continue;
} else if (!iceSpike.location.getWorld().equals(player.getWorld())) {
@ -389,7 +388,7 @@ public class IceSpikeBlast extends IceAbility {
@Override
public String getName() {
return "IceSpike";
return "IceSpikeBlast";
}
@Override
@ -407,6 +406,11 @@ public class IceSpikeBlast extends IceAbility {
return cooldown;
}
@Override
public boolean isHiddenAbility() {
return true;
}
@Override
public boolean isSneakAbility() {
return true;
@ -505,12 +509,12 @@ public class IceSpikeBlast extends IceAbility {
this.damage = damage;
}
public double getAffectingRadius() {
return affectingRadius;
public double getCollisionRadius() {
return collisionRadius;
}
public void setAffectingRadius(double affectingRadius) {
this.affectingRadius = affectingRadius;
public void setCollisionRadius(double collisionRadius) {
this.collisionRadius = collisionRadius;
}
public double getDeflectRange() {

View file

@ -1,9 +1,7 @@
package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.util.TempPotionEffect;
@ -117,20 +115,20 @@ public class IceSpikePillar extends IceAbility {
}
private void setFields() {
this.height = 2;
this.direction = new Vector(0, 1, 0);
this.speed = 25;
this.interval = (long) (1000. / speed);
this.slowCooldown = 5000;
this.slowPower = 2;
this.slowDuration = 70;
this.speed = getConfig().getDouble("Abilities.Water.IceSpike.Speed");
this.slowCooldown = getConfig().getLong("Abilities.Water.IceSpike.SlowCooldown");
this.slowPower = getConfig().getInt("Abilities.Water.IceSpike.SlowPower");
this.slowDuration = getConfig().getInt("Abilities.Water.IceSpike.SlowDuration");
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Damage");
this.range = getConfig().getDouble("Abilities.Water.IceSpike.Range");
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Cooldown");
this.height = getConfig().getInt("Abilities.Water.IceSpike.Height");
this.thrownForce = new Vector(0, ProjectKorra.plugin.getConfig().getDouble("Abilities.Water.IceSpike.ThrowingMult"), 0);
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Water.IceSpike.Push"), 0);
this.affectedBlocks = new ConcurrentHashMap<>();
this.damaged = new ArrayList<>();
this.interval = (long) (1000. / speed);
}
private void loadAffectedBlocks() {
@ -147,7 +145,7 @@ public class IceSpikePillar extends IceAbility {
}
public static boolean blockInAllAffectedBlocks(Block block) {
for (IceSpikePillar iceSpike : CoreAbility.getAbilities(IceSpikePillar.class)) {
for (IceSpikePillar iceSpike : getAbilities(IceSpikePillar.class)) {
if (iceSpike.blockInAffectedBlocks(block)) {
return true;
}
@ -156,7 +154,7 @@ public class IceSpikePillar extends IceAbility {
}
public static void revertBlock(Block block) {
for (IceSpikePillar iceSpike : CoreAbility.getAbilities(IceSpikePillar.class)) {
for (IceSpikePillar iceSpike : getAbilities(IceSpikePillar.class)) {
iceSpike.affectedBlocks.remove(block);
}
}

View file

@ -18,8 +18,8 @@ import java.util.Random;
public class IceSpikePillarField extends IceAbility {
private int damage;
private int radius;
private double damage;
private double radius;
private int numberOfSpikes;
private long cooldown;
private Vector thrownForce;
@ -27,24 +27,24 @@ public class IceSpikePillarField extends IceAbility {
public IceSpikePillarField(Player player) {
super(player);
this.damage = 2;
this.radius = 6;
this.numberOfSpikes = ((radius * 2) * (radius * 2)) / 16;
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Cooldown");
this.thrownForce = new Vector(0, 1, 0);
if (bPlayer.isOnCooldown(this)) {
return;
}
this.damage = getConfig().getDouble("Abilities.Water.IceSpike.Field.Damage");
this.radius = getConfig().getDouble("Abilities.Water.IceSpike.Field.Radius");
this.numberOfSpikes = (int) (((radius * 2) * (radius * 2)) / 16);
this.cooldown = getConfig().getLong("Abilities.Water.IceSpike.Field.Cooldown");
this.thrownForce = new Vector(0, getConfig().getDouble("Abilities.Water.IceSpike.Field.Push"), 0);
Random random = new Random();
int locX = player.getLocation().getBlockX();
int locY = player.getLocation().getBlockY();
int locZ = player.getLocation().getBlockZ();
List<Block> iceBlocks = new ArrayList<Block>();
for (int x = -(radius - 1); x <= (radius - 1); x++) {
for (int z = -(radius - 1); z <= (radius - 1); z++) {
for (int x = (int) -(radius - 1); x <= (radius - 1); x++) {
for (int z = (int) -(radius - 1); z <= (radius - 1); z++) {
for (int y = -1; y <= 1; y++) {
Block testBlock = player.getWorld().getBlockAt(locX + x, locY + y, locZ + z);
@ -90,7 +90,7 @@ public class IceSpikePillarField extends IceAbility {
}
if (targetBlock.getRelative(BlockFace.UP).getType() != Material.ICE) {
new IceSpikePillar(player, targetBlock.getLocation(), damage, thrownForce, cooldown);
new IceSpikePillar(player, targetBlock.getLocation(), (int) damage, thrownForce, cooldown);
bPlayer.addCooldown(this);
iceBlocks.remove(targetBlock);
}
@ -99,7 +99,7 @@ public class IceSpikePillarField extends IceAbility {
@Override
public String getName() {
return "IceSpike";
return "IceSpikePillarField";
}
@Override
@ -115,6 +115,11 @@ public class IceSpikePillarField extends IceAbility {
return cooldown;
}
@Override
public boolean isHiddenAbility() {
return true;
}
@Override
public boolean isSneakAbility() {
return true;
@ -125,19 +130,19 @@ public class IceSpikePillarField extends IceAbility {
return false;
}
public int getDamage() {
public double getDamage() {
return damage;
}
public void setDamage(int damage) {
public void setDamage(double damage) {
this.damage = damage;
}
public int getRadius() {
public double getRadius() {
return radius;
}
public void setRadius(int radius) {
public void setRadius(double radius) {
this.radius = radius;
}

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource;
@ -53,7 +52,7 @@ public class OctopusForm extends WaterAbility {
public OctopusForm(Player player) {
super(player);
OctopusForm oldOctopus = CoreAbility.getAbility(player, OctopusForm.class);
OctopusForm oldOctopus = getAbility(player, OctopusForm.class);
if (oldOctopus != null) {
if (oldOctopus.formed) {
oldOctopus.attack();
@ -63,6 +62,10 @@ public class OctopusForm extends WaterAbility {
}
}
if (!bPlayer.canBend(this)) {
return;
}
this.sourceSelected = false;
this.settingUp = false;
this.forming = false;
@ -76,9 +79,9 @@ public class OctopusForm extends WaterAbility {
this.attackRange = getConfig().getInt("Abilities.Water.OctopusForm.AttackRange");
this.knockback = getConfig().getDouble("Abilities.Water.OctopusForm.Knockback");
this.radius = getConfig().getDouble("Abilities.Water.OctopusForm.Radius");
this.cooldown = 0;
this.cooldown = getConfig().getLong("Abilities.Water.OctopusForm.Cooldown");
this.angleIncrement = getConfig().getDouble("Abilities.Water.OctopusForm.AngleIncrement");
this.currentFormHeight = 0;
this.angleIncrement = 45;
this.blocks = new ArrayList<TempBlock>();
this.newBlocks = new ArrayList<TempBlock>();
this.time = System.currentTimeMillis();
@ -102,12 +105,13 @@ public class OctopusForm extends WaterAbility {
} else if (forming) {
forming = false;
formed = true;
bPlayer.addCooldown(this);
}
}
@SuppressWarnings("deprecation")
public static void form(Player player) {
OctopusForm oldForm = CoreAbility.getAbility(player, OctopusForm.class);
OctopusForm oldForm = getAbility(player, OctopusForm.class);
if (oldForm != null) {
oldForm.form();
@ -391,7 +395,7 @@ public class OctopusForm extends WaterAbility {
}
public static boolean wasBrokenFor(Player player, Block block) {
OctopusForm form = CoreAbility.getAbility(player, OctopusForm.class);
OctopusForm form = getAbility(player, OctopusForm.class);
if (form != null) {
if (form.sourceBlock == null) {
return false;

View file

@ -32,17 +32,16 @@ public class PhaseChangeFreeze extends IceAbility {
public PhaseChangeFreeze(Player player) {
super(player);
this.range = getConfig().getDouble("Abilities.Water.PhaseChange.Range");
this.radius = getConfig().getDouble("Abilities.Water.PhaseChange.Radius");
this.cooldown = 0;
this.range = getNightFactor(range);
this.radius = getNightFactor(radius);
if (!bPlayer.canBend(this) || !bPlayer.canIcebend()) {
return;
}
this.range = getConfig().getDouble("Abilities.Water.PhaseChange.Range");
this.radius = getConfig().getDouble("Abilities.Water.PhaseChange.Radius");
this.cooldown = getConfig().getLong("Abilities.Water.PhaseChange.Freeze.Cooldown");
this.range = getNightFactor(range);
this.radius = getNightFactor(radius);
if (bPlayer.isAvatarState()) {
range = AvatarState.getValue(range);
}

View file

@ -18,6 +18,7 @@ public class PhaseChangeMelt extends IceAbility {
private static final byte FULL = 0x0;
private int seaLevel;
private long cooldown;
private double range;
private double radius;
private double evaporateRadius;
@ -26,9 +27,14 @@ public class PhaseChangeMelt extends IceAbility {
public PhaseChangeMelt(Player player) {
super(player);
if (!bPlayer.canBend(this)) {
return;
}
this.seaLevel = getConfig().getInt("Properties.SeaLevel");
this.range = getConfig().getDouble("Abilities.Water.PhaseChange.Range");
this.radius = getConfig().getDouble("Abilities.Water.PhaseChange.Radius");
this.cooldown = getConfig().getLong("Abilities.Water.PhaseChange.Melt.Cooldown");
this.evaporateRadius = 3;
this.range = getNightFactor(range);
@ -60,6 +66,8 @@ public class PhaseChangeMelt extends IceAbility {
melt(player, block);
}
}
bPlayer.addCooldown(this);
remove();
}
@ -102,7 +110,7 @@ public class PhaseChangeMelt extends IceAbility {
@Override
public String getName() {
return "PhaseChange";
return "PhaseChangeMelt";
}
@Override
@ -116,7 +124,12 @@ public class PhaseChangeMelt extends IceAbility {
@Override
public long getCooldown() {
return 0;
return cooldown;
}
@Override
public boolean isHiddenAbility() {
return true;
}
@Override

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.PlantAbility;
import org.bukkit.Color;
@ -42,7 +41,7 @@ public class PlantArmor extends PlantAbility {
this.range = getNightFactor(range);
this.duration = (long) getNightFactor(duration);
if (CoreAbility.hasAbility(player, PlantArmor.class)) {
if (hasAbility(player, PlantArmor.class)) {
return;
} else if (bPlayer.isOnCooldown(this)) {
return;
@ -171,7 +170,7 @@ public class PlantArmor extends PlantAbility {
}
public static boolean canRemoveArmor(Player player) {
PlantArmor plantArmor = CoreAbility.getAbility(player, PlantArmor.class);
PlantArmor plantArmor = getAbility(player, PlantArmor.class);
if (plantArmor != null) {
if (System.currentTimeMillis() < plantArmor.startTime + plantArmor.duration) {
return false;

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.FireBlast;
@ -26,8 +25,8 @@ public class SurgeWall extends WaterAbility {
private static final byte FULL = 0x0;
private static final String RANGE_CONFIG = "Abilities.Water.Surge.Wall.Range";
private static final ConcurrentHashMap<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<Block, Block>();
private static final ConcurrentHashMap<Block, Player> WALL_BLOCKS = new ConcurrentHashMap<Block, Player>();
private static final ConcurrentHashMap<Block, Block> AFFECTED_BLOCKS = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<Block, Player> WALL_BLOCKS = new ConcurrentHashMap<>();
private boolean progressing;
private boolean settingUp;
@ -49,12 +48,12 @@ public class SurgeWall extends WaterAbility {
public SurgeWall(Player player) {
super(player);
this.interval = 30;
this.cooldown = 0;
this.interval = getConfig().getLong("Abilities.Water.Surge.Wall.Interval");
this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wall.Cooldown");
this.range = getConfig().getDouble(RANGE_CONFIG);
this.radius = getConfig().getDouble("Abilities.Water.Surge.Wall.Radius");
SurgeWave wave = CoreAbility.getAbility(player, SurgeWave.class);
SurgeWave wave = getAbility(player, SurgeWave.class);
if (wave != null && !wave.isProgressing()) {
wave.moveWater();
return;
@ -64,7 +63,7 @@ public class SurgeWall extends WaterAbility {
radius = AvatarState.getValue(radius);
}
SurgeWall wall = CoreAbility.getAbility(player, SurgeWall.class);
SurgeWall wall = getAbility(player, SurgeWall.class);
if (wall != null) {
if (wall.progressing) {
freezeThaw();
@ -81,10 +80,10 @@ public class SurgeWall extends WaterAbility {
if (bPlayer.isOnCooldown(this)) {
return;
} else if (wall == null && WaterReturn.hasWaterBottle(player)) {
Location eyeloc = player.getEyeLocation();
Block block = eyeloc.add(eyeloc.getDirection().normalize()).getBlock();
Location eyeLoc = player.getEyeLocation();
Block block = eyeLoc.add(eyeLoc.getDirection().normalize()).getBlock();
if (isTransparent(player, block) && isTransparent(player, eyeloc.getBlock())) {
if (isTransparent(player, block) && isTransparent(player, eyeLoc.getBlock())) {
block.setType(Material.WATER);
block.setData(FULL);
@ -144,7 +143,7 @@ public class SurgeWall extends WaterAbility {
}
private void cancelPrevious() {
SurgeWall oldWave = CoreAbility.getAbility(player, SurgeWall.class);
SurgeWall oldWave = getAbility(player, SurgeWall.class);
if (oldWave != null) {
if (oldWave.progressing) {
oldWave.removeWater(oldWave.sourceBlock);
@ -167,6 +166,7 @@ public class SurgeWall extends WaterAbility {
progressing = false;
targetDestination = null;
} else {
bPlayer.addCooldown("SurgeWall", cooldown);
progressing = true;
settingUp = true;
firstDestination = getToEyeLevel();
@ -368,14 +368,14 @@ public class SurgeWall extends WaterAbility {
}
int range = getConfig().getInt(RANGE_CONFIG);
SurgeWall wall = CoreAbility.getAbility(player, SurgeWall.class);
SurgeWave wave = CoreAbility.getAbility(player, SurgeWave.class);
SurgeWall wall = getAbility(player, SurgeWall.class);
SurgeWave wave = getAbility(player, SurgeWave.class);
if (wall == null) {
if (wave == null
&& BlockSource.getWaterSourceBlock(player, range, ClickType.LEFT_CLICK, true, true, bPlayer.canPlantbend()) == null
&& WaterReturn.hasWaterBottle(player)) {
if (bPlayer.isOnCooldown("Surge")) {
if (bPlayer.isOnCooldown("SurgeWall")) {
return;
}
@ -430,7 +430,7 @@ public class SurgeWall extends WaterAbility {
}
public static boolean wasBrokenFor(Player player, Block block) {
SurgeWall wall = CoreAbility.getAbility(player, SurgeWall.class);
SurgeWall wall = getAbility(player, SurgeWall.class);
if (wall != null) {
if (wall.sourceBlock == null) {
return false;

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.firebending.FireBlast;
@ -49,7 +48,7 @@ public class SurgeWave extends WaterAbility {
public SurgeWave(Player player) {
super(player);
SurgeWave wave = CoreAbility.getAbility(player, SurgeWave.class);
SurgeWave wave = getAbility(player, SurgeWave.class);
if (wave != null) {
if (wave.progressing && !wave.freezing) {
wave.freezing = true;
@ -59,15 +58,15 @@ public class SurgeWave extends WaterAbility {
this.canHitSelf = true;
this.currentRadius = 1;
this.cooldown = GeneralMethods.getGlobalCooldown();
this.interval = 30;
this.cooldown = getConfig().getLong("Abilities.Water.Surge.Wave.Cooldown");
this.interval = getConfig().getLong("Abilities.Water.Surge.Wave.Interval");
this.maxRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.Radius");
this.pushFactor = getConfig().getDouble("Abilities.Water.Surge.Wave.HorizontalPush");
this.verticalFactor = getConfig().getDouble("Abilities.Water.Surge.Wave.VerticalPush");
this.maxFreezeRadius = 7;
this.maxFreezeRadius = getConfig().getDouble("Abilities.Water.Surge.Wave.MaxFreezeRadius");
this.range = getConfig().getDouble("Abilities.Water.Surge.Wave.Range");
this.waveBlocks = new ConcurrentHashMap<Block, Block>();
this.frozenBlocks = new ConcurrentHashMap<Block, Block>();
this.waveBlocks = new ConcurrentHashMap<>();
this.frozenBlocks = new ConcurrentHashMap<>();
if (bPlayer.isAvatarState()) {
maxRadius = AvatarState.getValue(maxRadius);
@ -75,7 +74,7 @@ public class SurgeWave extends WaterAbility {
maxRadius = getNightFactor(maxRadius);
if (prepare()) {
wave = CoreAbility.getAbility(player, SurgeWave.class);
wave = getAbility(player, SurgeWave.class);
if (wave != null) {
wave.remove();
}
@ -95,7 +94,7 @@ public class SurgeWave extends WaterAbility {
}
private void cancelPrevious() {
SurgeWave oldWave = CoreAbility.getAbility(player, SurgeWave.class);
SurgeWave oldWave = getAbility(player, SurgeWave.class);
if (oldWave != null) {
oldWave.remove();
}
@ -368,7 +367,7 @@ public class SurgeWave extends WaterAbility {
}
public static boolean canThaw(Block block) {
for (SurgeWave surgeWave : CoreAbility.getAbilities(SurgeWave.class)) {
for (SurgeWave surgeWave : getAbilities(SurgeWave.class)) {
if (surgeWave.frozenBlocks.containsKey(block)) {
return false;
}
@ -377,7 +376,7 @@ public class SurgeWave extends WaterAbility {
}
public static void removeAllCleanup() {
for (SurgeWave surgeWave : CoreAbility.getAbilities(SurgeWave.class)) {
for (SurgeWave surgeWave : getAbilities(SurgeWave.class)) {
for (Block block : surgeWave.waveBlocks.keySet()) {
block.setType(Material.AIR);
surgeWave.waveBlocks.remove(block);
@ -390,7 +389,7 @@ public class SurgeWave extends WaterAbility {
}
public static boolean isBlockWave(Block block) {
for (SurgeWave surgeWave : CoreAbility.getAbilities(SurgeWave.class)) {
for (SurgeWave surgeWave : getAbilities(SurgeWave.class)) {
if (surgeWave.waveBlocks.containsKey(block)) {
return true;
}
@ -399,7 +398,7 @@ public class SurgeWave extends WaterAbility {
}
public static void thaw(Block block) {
for (SurgeWave surgeWave : CoreAbility.getAbilities(SurgeWave.class)) {
for (SurgeWave surgeWave : getAbilities(SurgeWave.class)) {
if (surgeWave.frozenBlocks.containsKey(block)) {
TempBlock.revertBlock(block, Material.AIR);
surgeWave.frozenBlocks.remove(block);

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.util.BlockSource;
@ -27,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
public class Torrent extends WaterAbility {
private static final double CLEANUP_RANGE = 50;
private static final ConcurrentHashMap<TempBlock, Player> FROZEN_BLOCKS = new ConcurrentHashMap<TempBlock, Player>();
private static final ConcurrentHashMap<TempBlock, Player> FROZEN_BLOCKS = new ConcurrentHashMap<>();
private boolean sourceSelected;
private boolean settingUp;
@ -44,8 +43,8 @@ public class Torrent extends WaterAbility {
private double startAngle;
private double angle;
private double radius;
private double factor;
private double yLimit;
private double push;
private double maxUpwardForce;
private double damage;
private double deflectDamage;
private double range;
@ -61,23 +60,23 @@ public class Torrent extends WaterAbility {
super(player);
this.layer = 0;
this.maxLayer = 3;
this.factor = 1;
this.startAngle = 0;
this.angle = 20;
this.radius = 3;
this.yLimit = 0.2;
this.interval = 30;
this.maxLayer = getConfig().getInt("Abilities.Water.Torrent.MaxLayer");
this.push = getConfig().getDouble("Abilities.Water.Torrent.Push");
this.angle = getConfig().getDouble("Abilities.Water.Torrent.Angle");
this.radius = getConfig().getDouble("Abilities.Water.Torrent.Radius");
this.maxUpwardForce = getConfig().getDouble("Abilities.Water.Torrent.MaxUpwardForce");
this.interval = getConfig().getLong("Abilities.Water.Torrent.Interval");
this.damage = getConfig().getDouble("Abilities.Water.Torrent.Damage");
this.deflectDamage = getConfig().getDouble("Abilities.Water.Torrent.DeflectDamage");
this.range = getConfig().getDouble("Abilities.Water.Torrent.Range");
this.cooldown = 0;
this.selectRange = 10;
this.selectRange = getConfig().getDouble("Abilities.Water.Torrent.SelectRange");
this.cooldown = getConfig().getLong("Abilities.Water.Torrent.Cooldown");
this.blocks = new ArrayList<>();
this.launchedBlocks = new ArrayList<>();
this.hurtEntities = new ArrayList<>();
Torrent oldTorrent = CoreAbility.getAbility(player, Torrent.class);
Torrent oldTorrent = getAbility(player, Torrent.class);
if (oldTorrent != null) {
if (!oldTorrent.sourceSelected) {
oldTorrent.use();
@ -86,6 +85,10 @@ public class Torrent extends WaterAbility {
}
}
if (bPlayer.isOnCooldown(this)) {
return;
}
time = System.currentTimeMillis();
sourceBlock = BlockSource.getWaterSourceBlock(player, selectRange, ClickType.LEFT_CLICK, true, true, bPlayer.canPlantbend());
if (sourceBlock != null && !GeneralMethods.isRegionProtectedFromBuild(this, sourceBlock.getLocation())) {
@ -453,7 +456,7 @@ public class Torrent extends WaterAbility {
@SuppressWarnings("deprecation")
public static void create(Player player) {
if (CoreAbility.hasAbility(player, Torrent.class)) {
if (hasAbility(player, Torrent.class)) {
return;
}
@ -497,7 +500,7 @@ public class Torrent extends WaterAbility {
vx = (x * Math.cos(angle) - z * Math.sin(angle)) / mag;
vz = (x * Math.sin(angle) + z * Math.cos(angle)) / mag;
Vector vec = new Vector(vx, 0, vz).normalize().multiply(factor);
Vector vec = new Vector(vx, 0, vz).normalize().multiply(push);
Vector velocity = entity.getVelocity();
if (bPlayer.isAvatarState()) {
@ -521,11 +524,11 @@ public class Torrent extends WaterAbility {
if (entity.getEntityId() == player.getEntityId()) {
return;
}
if (direction.getY() > yLimit) {
direction.setY(yLimit);
if (direction.getY() > maxUpwardForce) {
direction.setY(maxUpwardForce);
}
if (!freeze) {
entity.setVelocity(direction.multiply(factor));
entity.setVelocity(direction.multiply(push));
}
if (entity instanceof LivingEntity && !hurtEntities.contains(entity)) {
double damageDealt = getNightFactor(damage);
@ -587,7 +590,7 @@ public class Torrent extends WaterAbility {
}
public static boolean wasBrokenFor(Player player, Block block) {
Torrent torrent = CoreAbility.getAbility(player, Torrent.class);
Torrent torrent = getAbility(player, Torrent.class);
if (torrent != null) {
if (torrent.sourceBlock == null) {
return false;
@ -736,20 +739,20 @@ public class Torrent extends WaterAbility {
this.radius = radius;
}
public double getFactor() {
return factor;
public double getPush() {
return push;
}
public void setFactor(double factor) {
this.factor = factor;
public void setPush(double push) {
this.push = push;
}
public double getyLimit() {
return yLimit;
public double getMaxUpwardForce() {
return maxUpwardForce;
}
public void setyLimit(double yLimit) {
this.yLimit = yLimit;
public void setMaxUpwardForce(double maxUpwardForce) {
this.maxUpwardForce = maxUpwardForce;
}
public double getDamage() {

View file

@ -37,25 +37,29 @@ public class TorrentWave extends WaterAbility {
public TorrentWave(Player player, Location location, double radius) {
super(player);
if (bPlayer.isOnCooldown("TorrentWave")) {
return;
}
this.radius = radius;
this.interval = 30;
this.interval = getConfig().getLong("Abilities.Water.Torrent.Wave.Interval");
this.maxHeight = getConfig().getDouble("Abilities.Water.Torrent.Wave.Height");
this.maxRadius = getConfig().getDouble("Abilities.Water.Torrent.Wave.Radius");
this.knockback = getConfig().getDouble("Abilities.Water.Torrent.Wave.Knockback");
this.cooldown = 0;
this.growSpeed = 0.5;
this.cooldown = getConfig().getLong("Abilities.Water.Torrent.Wave.Cooldown");
this.growSpeed = getConfig().getDouble("Abilities.Water.Torrent.Wave.GrowSpeed");
this.origin = location.clone();
this.time = System.currentTimeMillis();
this.heights = new ConcurrentHashMap<>();
this.blocks = new ArrayList<TempBlock>();
this.affectedEntities = new ArrayList<Entity>();
this.blocks = new ArrayList<>();
this.affectedEntities = new ArrayList<>();
this.knockback = getNightFactor(knockback);
this.maxRadius = getNightFactor(maxRadius);
initializeHeightsMap();
start();
bPlayer.addCooldown(this);
bPlayer.addCooldown("TorrentWave", cooldown);
}
private void initializeHeightsMap() {

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.FireAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
@ -81,7 +80,7 @@ public class WaterArms extends WaterAbility {
this.world = player.getWorld();
this.activeArm = Arm.RIGHT;
WaterArms oldArms = CoreAbility.getAbility(player, WaterArms.class);
WaterArms oldArms = getAbility(player, WaterArms.class);
if (oldArms != null) {
if (player.isSneaking()) {

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.IceAbility;
import com.projectkorra.projectkorra.util.ParticleEffect;
import com.projectkorra.projectkorra.util.TempBlock;
@ -45,7 +44,7 @@ public class WaterArmsFreeze extends IceAbility {
}
private void createInstance() {
waterArms = CoreAbility.getAbility(player, WaterArms.class);
waterArms = getAbility(player, WaterArms.class);
if (waterArms != null) {
waterArms.switchPreferredArm();
@ -94,7 +93,7 @@ public class WaterArmsFreeze extends IceAbility {
if (distanceTravelled >= 5 && !cancelled) {
cancelled = true;
if (CoreAbility.hasAbility(player, WaterArms.class)) {
if (hasAbility(player, WaterArms.class)) {
if (arm.equals(Arm.LEFT)) {
waterArms.setLeftArmCooldown(false);
} else {
@ -147,7 +146,7 @@ public class WaterArmsFreeze extends IceAbility {
@Override
public void remove() {
super.remove();
if (CoreAbility.hasAbility(player, WaterArms.class)) {
if (hasAbility(player, WaterArms.class)) {
if (!cancelled) {
if (arm.equals(Arm.LEFT)) {
waterArms.setLeftArmCooldown(false);

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingManager;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.util.TempBlock;
import com.projectkorra.projectkorra.waterbending.WaterArms.Arm;
@ -102,7 +101,7 @@ public class WaterArmsSpear extends WaterAbility {
}
private void createInstance() {
waterArms = CoreAbility.getAbility(player, WaterArms.class);
waterArms = getAbility(player, WaterArms.class);
if (waterArms != null) {
waterArms.switchPreferredArm();
arm = waterArms.getActiveArm();
@ -237,7 +236,7 @@ public class WaterArmsSpear extends WaterAbility {
@Override
public void remove() {
super.remove();
if (CoreAbility.hasAbility(player, WaterArms.class)) {
if (hasAbility(player, WaterArms.class)) {
if (arm.equals(Arm.LEFT)) {
waterArms.setLeftArmCooldown(false);
} else {

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingManager;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
import com.projectkorra.projectkorra.command.Commands;
@ -85,7 +84,7 @@ public class WaterArmsWhip extends WaterAbility {
this.pullMultiplier = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Pull.Multiplier");
this.punchDamage = getConfig().getDouble("Abilities.Water.WaterArms.Whip.Punch.PunchDamage");
WaterArmsWhip waw = CoreAbility.getAbility(player, WaterArmsWhip.class);
WaterArmsWhip waw = getAbility(player, WaterArmsWhip.class);
if (waw != null) {
if (waw.grabbed) {
waw.grabbed = false;
@ -95,7 +94,7 @@ public class WaterArmsWhip extends WaterAbility {
}
return;
}
if (!waw.arm.equals(CoreAbility.getAbility(player, WaterArms.class).getActiveArm())) {
if (!waw.arm.equals(getAbility(player, WaterArms.class).getActiveArm())) {
return;
}
}
@ -149,7 +148,7 @@ public class WaterArmsWhip extends WaterAbility {
}
private void createInstance() {
waterArms = CoreAbility.getAbility(player, WaterArms.class);
waterArms = getAbility(player, WaterArms.class);
if (waterArms != null) {
waterArms.switchPreferredArm();
arm = waterArms.getActiveArm();
@ -189,7 +188,7 @@ public class WaterArmsWhip extends WaterAbility {
@Override
public void progress() {
if (!CoreAbility.hasAbility(player, WaterArms.class)) {
if (!hasAbility(player, WaterArms.class)) {
remove();
return;
} else if (player.isDead() || !player.isOnline()) {
@ -389,7 +388,7 @@ public class WaterArmsWhip extends WaterAbility {
@Override
public void remove() {
super.remove();
if (CoreAbility.hasAbility(player, WaterArms.class)) {
if (hasAbility(player, WaterArms.class)) {
if (arm.equals(Arm.LEFT)) {
waterArms.setLeftArmCooldown(false);
} else {

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.ComboAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation;
import com.projectkorra.projectkorra.avatar.AvatarState;
@ -327,7 +326,7 @@ public class WaterCombo extends WaterAbility implements ComboAbility {
if (player == null || ability == null) {
return list;
}
for (WaterCombo combo : CoreAbility.getAbilities(player, WaterCombo.class)) {
for (WaterCombo combo : getAbilities(player, WaterCombo.class)) {
if (player.equals(combo.player) && combo.name.equalsIgnoreCase(ability)) {
list.add(combo);
}

View file

@ -3,7 +3,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.AirAbility;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.avatar.AvatarState;
import com.projectkorra.projectkorra.earthbending.EarthBlast;
@ -45,7 +44,7 @@ public class WaterManipulation extends WaterAbility {
private double damage;
private double speed;
private double deflectRange;
private double affectingRadius;
private double collisionRadius;
private Block sourceBlock;
private Location location;
private TempBlock trail;
@ -63,13 +62,13 @@ public class WaterManipulation extends WaterAbility {
this.falling = false;
this.settingUp = false;
this.displacing = false;
this.affectingRadius = 2.0;
this.collisionRadius = getConfig().getDouble("Abilities.Water.WaterManipulation.CollisionRadius");
this.cooldown = getConfig().getLong("Abilities.Water.WaterManipulation.Cooldown");
this.range = getConfig().getDouble("Abilities.Water.WaterManipulation.Range");
this.pushFactor = getConfig().getDouble("Abilities.Water.WaterManipulation.Push");
this.damage = getConfig().getDouble("Abilities.Water.WaterManipulation.Damage");
this.speed = getConfig().getDouble("Abilities.Water.WaterManipulation.Speed");
this.deflectRange = 3;
this.deflectRange = getConfig().getDouble("Abilities.Water.WaterManipulation.DeflectRange");
this.waterTypes = new HashSet<Byte>();
this.interval = (long) (1000. / speed);
@ -85,7 +84,7 @@ public class WaterManipulation extends WaterAbility {
}
private void cancelPrevious() {
WaterManipulation old = CoreAbility.getAbility(player, WaterManipulation.class);
WaterManipulation old = getAbility(player, WaterManipulation.class);
if (old != null && !old.progressing) {
old.remove();
}
@ -223,7 +222,7 @@ public class WaterManipulation extends WaterAbility {
playWaterbendingSound(location);
}
double radius = affectingRadius;
double radius = collisionRadius;
Player source = player;
if (!(location == null)) {
if (EarthBlast.annihilateBlasts(location, radius, source)
@ -271,7 +270,7 @@ public class WaterManipulation extends WaterAbility {
}
if (!displacing) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, affectingRadius)) {
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, collisionRadius)) {
if (entity instanceof LivingEntity && entity.getEntityId() != player.getEntityId()) {
Location location = player.getEyeLocation();
Vector vector = location.getDirection();
@ -368,7 +367,7 @@ public class WaterManipulation extends WaterAbility {
public static boolean annihilateBlasts(Location location, double radius, Player player) {
boolean broke = false;
for (WaterManipulation manip : CoreAbility.getAbilities(WaterManipulation.class)) {
for (WaterManipulation manip : getAbilities(WaterManipulation.class)) {
if (manip.location.getWorld().equals(location.getWorld()) && !player.equals(manip.player)) {
if (manip.location.distanceSquared(location) <= radius * radius) {
manip.remove();
@ -380,7 +379,7 @@ public class WaterManipulation extends WaterAbility {
}
private static void block(Player player) {
for (WaterManipulation manip : CoreAbility.getAbilities(player, WaterManipulation.class)) {
for (WaterManipulation manip : getAbilities(player, WaterManipulation.class)) {
if (!manip.location.getWorld().equals(player.getWorld())) {
continue;
} else if (!manip.progressing) {
@ -466,7 +465,7 @@ public class WaterManipulation extends WaterAbility {
boolean handledPrepare = false;
double range = 25;
for (WaterManipulation waterManip : CoreAbility.getAbilities(player, WaterManipulation.class)) {
for (WaterManipulation waterManip : getAbilities(player, WaterManipulation.class)) {
range = waterManip.range;
if (waterManip.prepared) {
waterManip.prepared = false;
@ -498,7 +497,7 @@ public class WaterManipulation extends WaterAbility {
}
private static void redirectTargettedBlasts(Player player) {
for (WaterManipulation manip : CoreAbility.getAbilities(WaterManipulation.class)) {
for (WaterManipulation manip : getAbilities(WaterManipulation.class)) {
if (!manip.progressing) {
continue;
} else if (!manip.location.getWorld().equals(player.getWorld())) {
@ -529,7 +528,7 @@ public class WaterManipulation extends WaterAbility {
}
public static void removeAroundPoint(Location location, double radius) {
for (WaterManipulation manip : CoreAbility.getAbilities(WaterManipulation.class)) {
for (WaterManipulation manip : getAbilities(WaterManipulation.class)) {
if (manip.location.getWorld().equals(location.getWorld())) {
if (manip.location.distanceSquared(location) <= radius * radius) {
manip.remove();
@ -743,5 +742,13 @@ public class WaterManipulation extends WaterAbility {
public void setLocation(Location location) {
this.location = location;
}
public double getCollisionRadius() {
return collisionRadius;
}
public void setCollisionRadius(double collisionRadius) {
this.collisionRadius = collisionRadius;
}
}

View file

@ -1,7 +1,6 @@
package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.util.TempBlock;
@ -25,7 +24,7 @@ public class WaterReturn extends WaterAbility {
public WaterReturn(Player player, Block block) {
super(player);
if (CoreAbility.hasAbility(player, WaterReturn.class)) {
if (hasAbility(player, WaterReturn.class)) {
return;
}
@ -122,19 +121,19 @@ public class WaterReturn extends WaterAbility {
}
private static boolean isBending(Player player) {
if (CoreAbility.hasAbility(player, WaterManipulation.class)
|| CoreAbility.hasAbility(player, WaterManipulation.class)
|| CoreAbility.hasAbility(player, OctopusForm.class)
|| CoreAbility.hasAbility(player, SurgeWave.class)
|| CoreAbility.hasAbility(player, SurgeWall.class)
|| CoreAbility.hasAbility(player, IceSpikeBlast.class)) {
if (hasAbility(player, WaterManipulation.class)
|| hasAbility(player, WaterManipulation.class)
|| hasAbility(player, OctopusForm.class)
|| hasAbility(player, SurgeWave.class)
|| hasAbility(player, SurgeWall.class)
|| hasAbility(player, IceSpikeBlast.class)) {
return true;
}
return false;
}
public static boolean hasWaterBottle(Player player) {
if (CoreAbility.hasAbility(player, WaterReturn.class) || isBending(player)) {
if (hasAbility(player, WaterReturn.class) || isBending(player)) {
return false;
}
PlayerInventory inventory = player.getInventory();

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.util.Flight;
import com.projectkorra.projectkorra.util.ParticleEffect;
@ -37,17 +36,17 @@ public class WaterSpout extends WaterAbility {
public WaterSpout(Player player) {
super(player);
WaterSpout oldSpout = CoreAbility.getAbility(player, WaterSpout.class);
WaterSpout oldSpout = getAbility(player, WaterSpout.class);
if (oldSpout != null) {
oldSpout.remove();
return;
}
this.canBendOnPackedIce = ProjectKorra.plugin.getConfig().getBoolean("Properties.Water.CanBendPackedIce");
this.canBendOnPackedIce = getConfig().getBoolean("Properties.Water.CanBendPackedIce");
this.useParticles = getConfig().getBoolean("Abilities.Water.WaterSpout.Particles");
this.useBlockSpiral = getConfig().getBoolean("Abilities.Water.WaterSpout.BlockSpiral");
this.height = getConfig().getDouble("Abilities.Water.WaterSpout.Height");
this.interval = 50;
this.interval = getConfig().getLong("Abilities.Water.WaterSpout.Interval");
WaterSpoutWave spoutWave = new WaterSpoutWave(player, WaterSpoutWave.AbilityType.CLICK);
if (spoutWave.isStarted()) {
@ -285,7 +284,7 @@ public class WaterSpout extends WaterAbility {
double dz = loc1.getZ() - loc0.getZ();
double distSquared = dx * dx + dz * dz;
for (WaterSpout spout : CoreAbility.getAbilities(sourcePlayer, WaterSpout.class)) {
for (WaterSpout spout : getAbilities(sourcePlayer, WaterSpout.class)) {
if (distSquared <= radius * radius && dy > 0 && dy < spout.height) {
removed = true;
spout.remove();

View file

@ -2,7 +2,6 @@ package com.projectkorra.projectkorra.waterbending;
import com.projectkorra.projectkorra.GeneralMethods;
import com.projectkorra.projectkorra.ProjectKorra;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.ability.WaterAbility;
import com.projectkorra.projectkorra.util.BlockSource;
import com.projectkorra.projectkorra.util.ClickType;
@ -63,13 +62,13 @@ public class WaterSpoutWave extends WaterAbility {
public WaterSpoutWave(Player player, AbilityType type) {
super(player);
this.radius = 3.8;
this.waveRadius = 1.5;
this.animationSpeed = 1.2;
this.charging = false;
this.iceWave = false;
this.iceOnly = false;
this.enabled = getConfig().getBoolean("Abilities.Water.WaterSpout.Wave.Enabled");
this.radius = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Radius");
this.waveRadius = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.WaveRadius");
this.animationSpeed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.AnimationSpeed");
this.range = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Range");
this.speed = getConfig().getDouble("Abilities.Water.WaterSpout.Wave.Speed");
this.damage = getConfig().getDouble("Abilities.Water.WaterCombo.IceWave.Damage");
@ -368,7 +367,7 @@ public class WaterSpoutWave extends WaterAbility {
}
public static boolean containsType(Player player, AbilityType type) {
for (WaterSpoutWave wave : CoreAbility.getAbilities(player, WaterSpoutWave.class)) {
for (WaterSpoutWave wave : getAbilities(player, WaterSpoutWave.class)) {
if (wave.type.equals(type)) {
return true;
}
@ -377,7 +376,7 @@ public class WaterSpoutWave extends WaterAbility {
}
public void removeOldType(Player player, AbilityType type) {
for (WaterSpoutWave wave : CoreAbility.getAbilities(player, WaterSpoutWave.class)) {
for (WaterSpoutWave wave : getAbilities(player, WaterSpoutWave.class)) {
if (wave.type.equals(type) && !wave.equals(this)) {
wave.remove();
}
@ -386,7 +385,7 @@ public class WaterSpoutWave extends WaterAbility {
public static ArrayList<WaterSpoutWave> getType(Player player, AbilityType type) {
ArrayList<WaterSpoutWave> list = new ArrayList<WaterSpoutWave>();
for (WaterSpoutWave wave : CoreAbility.getAbilities(player, WaterSpoutWave.class)) {
for (WaterSpoutWave wave : getAbilities(player, WaterSpoutWave.class)) {
if (wave.type.equals(type)) {
list.add(wave);
}