From b2fcfc493a9836fd5005c6de4654f1dd8deee029 Mon Sep 17 00:00:00 2001 From: Simplicitee Date: Fri, 10 Feb 2017 22:53:47 -0500 Subject: [PATCH] Remove Attribute system (#725) * AirJump, Attribute continuation * Remove AirJump * Revert "Remove AirJump" This reverts commit e6cf056bb746d70643931f523f163aea1738b482. * Revert "AirJump, Attribute continuation" This reverts commit b8198d7eaff34b089fb0ec1003e4b766503cb0ae. * Remove Attribute to redesign --- .../projectkorra/ProjectKorra.java | 2 - .../projectkorra/ability/CoreAbility.java | 12 --- .../projectkorra/airbending/AirBlast.java | 57 +++++------- .../projectkorra/airbending/AirBubble.java | 16 +--- .../projectkorra/airbending/AirBurst.java | 38 +++----- .../projectkorra/airbending/AirScooter.java | 69 +++++++------- .../configuration/ConfigManager.java | 4 +- .../projectkorra/util/Attribute.java | 90 ------------------- .../projectkorra/util/ClickType.java | 4 +- .../util/attributes/AttributeModifiers.java | 49 ---------- .../util/attributes/AvatarStateModifier.java | 18 ---- 11 files changed, 76 insertions(+), 283 deletions(-) delete mode 100644 src/com/projectkorra/projectkorra/util/Attribute.java delete mode 100644 src/com/projectkorra/projectkorra/util/attributes/AttributeModifiers.java delete mode 100644 src/com/projectkorra/projectkorra/util/attributes/AvatarStateModifier.java diff --git a/src/com/projectkorra/projectkorra/ProjectKorra.java b/src/com/projectkorra/projectkorra/ProjectKorra.java index d76f21af..09fdf60f 100644 --- a/src/com/projectkorra/projectkorra/ProjectKorra.java +++ b/src/com/projectkorra/projectkorra/ProjectKorra.java @@ -29,7 +29,6 @@ import com.projectkorra.projectkorra.util.MetricsLite; import com.projectkorra.projectkorra.util.RevertChecker; import com.projectkorra.projectkorra.util.TempBlock; import com.projectkorra.projectkorra.util.Updater; -import com.projectkorra.projectkorra.util.attributes.AttributeModifiers; import com.projectkorra.projectkorra.util.logging.PKLogHandler; import com.projectkorra.projectkorra.waterbending.util.WaterbendingManager; @@ -70,7 +69,6 @@ public class ProjectKorra extends JavaPlugin { CoreAbility.registerAbilities(); collisionInitializer.initializeDefaultCollisions(); // must be called after abilities have been registered collisionManager.startCollisionDetection(); - new AttributeModifiers(); Preset.loadExternalPresets(); diff --git a/src/com/projectkorra/projectkorra/ability/CoreAbility.java b/src/com/projectkorra/projectkorra/ability/CoreAbility.java index 1fe901a1..c934afb2 100644 --- a/src/com/projectkorra/projectkorra/ability/CoreAbility.java +++ b/src/com/projectkorra/projectkorra/ability/CoreAbility.java @@ -40,7 +40,6 @@ import com.projectkorra.projectkorra.configuration.ConfigManager; import com.projectkorra.projectkorra.event.AbilityEndEvent; import com.projectkorra.projectkorra.event.AbilityProgressEvent; import com.projectkorra.projectkorra.event.AbilityStartEvent; -import com.projectkorra.projectkorra.util.Attribute.Attributable; import sun.reflect.ReflectionFactory; @@ -492,11 +491,6 @@ public abstract class CoreAbility implements Ability { AddonAbility addon = (AddonAbility) ability; addon.load(); } - - if (ability instanceof Attributable) { - Attributable att = (Attributable) ability; - att.registerAttributes(); - } } catch (Exception e) { } @@ -571,12 +565,6 @@ public abstract class CoreAbility implements Ability { PassiveManager.getPassivesByElement().get(((SubElement) coreAbil.getElement()).getParentElement()).add(name); } } - - - if (coreAbil instanceof Attributable) { - Attributable att = (Attributable) coreAbil; - att.registerAttributes(); - } } catch (Exception | Error e) { plugin.getLogger().warning("The ability " + coreAbil.getName() + " was not able to load, if this message shows again please remove it!"); diff --git a/src/com/projectkorra/projectkorra/airbending/AirBlast.java b/src/com/projectkorra/projectkorra/airbending/AirBlast.java index 7f6e4c04..80840d98 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirBlast.java +++ b/src/com/projectkorra/projectkorra/airbending/AirBlast.java @@ -29,12 +29,10 @@ import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.command.Commands; import com.projectkorra.projectkorra.object.HorizontalVelocityTracker; -import com.projectkorra.projectkorra.util.Attribute; -import com.projectkorra.projectkorra.util.Attribute.Attributable; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.Flight; -public class AirBlast extends AirAbility implements Attributable{ +public class AirBlast extends AirAbility { private static final int MAX_TICKS = 10000; private static final Map ORIGINS = new ConcurrentHashMap<>(); @@ -46,9 +44,15 @@ public class AirBlast extends AirAbility implements Attributable{ private boolean isFromOtherOrigin; private boolean showParticles; private int ticks; - int particles; - long cooldown; - double speedFactor, range, pushFactor, pushFactorForOthers, damage, speed, radius; + private int particles; + private long cooldown; + private double speedFactor; + private double range; + private double pushFactor; + private double pushFactorForOthers; + private double damage; + private double speed; + private double radius; private Location location; private Location origin; private Vector direction; @@ -56,14 +60,6 @@ public class AirBlast extends AirAbility implements Attributable{ private Random random; private ArrayList affectedLevers; private ArrayList affectedEntities; - private static Attribute particlesA; - private static Attribute cooldownA; - private static Attribute rangeA; - private static Attribute pushFactorA; - private static Attribute pushFactorForOthersA; - private static Attribute damageA; - private static Attribute speedA; - private static Attribute radiusA; public AirBlast(Player player) { super(player); @@ -115,18 +111,23 @@ public class AirBlast extends AirAbility implements Attributable{ this.canPressButtons = false; this.canFlickLevers = false; + if (bPlayer.isAvatarState()) { + this.pushFactor = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Entities"); + this.pushFactorForOthers = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Self"); + } + start(); } private void setFields() { - this.particles = particlesA.getModified(bPlayer); - this.cooldown = cooldownA.getModified(bPlayer); - this.range = rangeA.getModified(bPlayer); - this.damage = damageA.getModified(bPlayer); - this.speed = speedA.getModified(bPlayer); - this.radius = radiusA.getModified(bPlayer); - this.pushFactor = pushFactorA.getModified(bPlayer); - this.pushFactorForOthers = pushFactorForOthersA.getModified(bPlayer); + this.particles = getConfig().getInt("Abilities.Air.AirBlast.Particles"); + this.cooldown = getConfig().getLong("Abilities.Air.AirBlast.Cooldown"); + this.range = getConfig().getDouble("Abilities.Air.AirBlast.Range"); + this.speed = getConfig().getDouble("Abilities.Air.AirBlast.Speed"); + this.range = getConfig().getDouble("Abilities.Air.AirBlast.Range"); + this.radius = getConfig().getDouble("Abilities.Air.AirBlast.Radius"); + this.pushFactor = getConfig().getDouble("Abilities.Air.AirBlast.Push.Entities"); + this.pushFactorForOthers = getConfig().getDouble("Abilities.Air.AirBlast.Push.Self"); this.canFlickLevers = getConfig().getBoolean("Abilities.Air.AirBlast.CanFlickLevers"); this.canOpenDoors = getConfig().getBoolean("Abilities.Air.AirBlast.CanOpenDoors"); this.canPressButtons = getConfig().getBoolean("Abilities.Air.AirBlast.CanPressButtons"); @@ -638,16 +639,4 @@ public class AirBlast extends AirAbility implements Attributable{ return getConfig().getInt("Abilities.Air.AirBlast.SelectRange"); } - @Override - public void registerAttributes() { - particlesA = new Attribute(this, "particles", getConfig().getInt("Abilities.Air.AirBlast.Particles")); - cooldownA = new Attribute(this, "cooldown", getConfig().getLong("Abilities.Air.AirBlast.Cooldown")); - rangeA = new Attribute(this, "range", getConfig().getDouble("Abilities.Air.AirBlast.Range")); - pushFactorA = new Attribute(this, "pushFactor", getConfig().getDouble("Abilities.Air.AirBlast.Push.Self")); - pushFactorForOthersA = new Attribute(this, "pushFactorForOthers", getConfig().getDouble("Abilities.Air.AirBlast.Push.Entities")); - damageA = new Attribute(this, "damage", getConfig().getDouble("Abilities.Air.AirBlast.Damage")); - speedA = new Attribute(this, "speed", getConfig().getDouble("Abilities.Air.AirBlast.Speed")); - radiusA = new Attribute(this, "radius", getConfig().getDouble("Abilities.Air.AirBlast.Radius")); - } - } diff --git a/src/com/projectkorra/projectkorra/airbending/AirBubble.java b/src/com/projectkorra/projectkorra/airbending/AirBubble.java index 4ed8d467..3c600293 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirBubble.java +++ b/src/com/projectkorra/projectkorra/airbending/AirBubble.java @@ -14,26 +14,22 @@ 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.util.Attribute; -import com.projectkorra.projectkorra.util.Attribute.Attributable; import com.projectkorra.projectkorra.waterbending.WaterManipulation; -public class AirBubble extends AirAbility implements Attributable{ +public class AirBubble extends AirAbility { private boolean waterBubble; private double radius; private double airRadius; private double waterRadius; private Map waterOrigins; - private static Attribute airRadiusA; - private static Attribute waterRadiusA; public AirBubble(Player player) { super(player); this.radius = 0; - this.airRadius = airRadiusA.getModified(bPlayer); - this.waterRadius = waterRadiusA.getModified(bPlayer); + this.airRadius = getConfig().getDouble("Abilities.Air.AirBubble.Radius"); + this.waterRadius = getConfig().getDouble("Abilities.Water.WaterBubble.Radius"); this.waterOrigins = new ConcurrentHashMap<>(); start(); } @@ -210,10 +206,4 @@ public class AirBubble extends AirAbility implements Attributable{ return waterOrigins; } - @Override - public void registerAttributes() { - airRadiusA = new Attribute(this, "airRadius", getConfig().getDouble("Abilities.Air.AirBubble.Radius")); - waterRadiusA = new Attribute(this, "waterRadius", getConfig().getDouble("Abilities.Water.WaterBubble.Radius")); - } - } diff --git a/src/com/projectkorra/projectkorra/airbending/AirBurst.java b/src/com/projectkorra/projectkorra/airbending/AirBurst.java index dfa01427..35337301 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirBurst.java +++ b/src/com/projectkorra/projectkorra/airbending/AirBurst.java @@ -11,10 +11,8 @@ import org.bukkit.util.Vector; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.AirAbility; -import com.projectkorra.projectkorra.util.Attribute; -import com.projectkorra.projectkorra.util.Attribute.Attributable; -public class AirBurst extends AirAbility implements Attributable{ +public class AirBurst extends AirAbility { private boolean isCharged; private boolean isFallBurst; @@ -29,12 +27,6 @@ public class AirBurst extends AirAbility implements Attributable{ private double particlePercentage; private ArrayList blasts; private ArrayList affectedEntities; - private static Attribute chargeTimeA; - private static Attribute fallThresholdA; - private static Attribute pushFactorA; - private static Attribute damageA; - private static Attribute blastAngleThetaA; - private static Attribute blastAnglePhiA; public AirBurst(Player player, boolean isFallBurst) { super(player); @@ -51,17 +43,21 @@ public class AirBurst extends AirAbility implements Attributable{ this.isFallBurst = isFallBurst; this.isCharged = false; this.playerFallDistance = player.getFallDistance(); - this.chargeTime = chargeTimeA.getModified(bPlayer); - this.fallThreshold = fallThresholdA.getModified(bPlayer); - this.pushFactor = pushFactorA.getModified(bPlayer); - this.damage = damageA.getModified(bPlayer); - this.blastAnglePhi = blastAnglePhiA.getModified(bPlayer); - this.blastAngleTheta = blastAngleThetaA.getModified(bPlayer); + this.chargeTime = getConfig().getLong("Abilities.Air.AirBurst.ChargeTime"); + this.fallThreshold = getConfig().getDouble("Abilities.Air.AirBurst.FallThreshold"); + this.pushFactor = getConfig().getDouble("Abilities.Air.AirBurst.PushFactor"); + this.damage = getConfig().getDouble("Abilities.Air.AirBurst.Damage"); + this.blastAnglePhi = getConfig().getDouble("Abilities.Air.AirBurst.AnglePhi"); + this.blastAngleTheta = getConfig().getDouble("Abilities.Air.AirBurst.AngleTheta"); this.sneakParticles = getConfig().getInt("Abilities.Air.AirBurst.SneakParticles"); this.particlePercentage = getConfig().getDouble("Abilities.Air.AirBurst.ParticlePercentage"); this.blasts = new ArrayList<>(); this.affectedEntities = new ArrayList<>(); - + + if (bPlayer.isAvatarState()) { + this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Air.AirBurst.ChargeTime"); + this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBurst.Damage"); + } start(); } @@ -319,14 +315,4 @@ public class AirBurst extends AirAbility implements Attributable{ public ArrayList getAffectedEntities() { return affectedEntities; } - - @Override - public void registerAttributes() { - chargeTimeA = new Attribute(this, "chargeTime", getConfig().getLong("Abilities.Air.AirBurst.ChargeTime")); - fallThresholdA = new Attribute(this, "fallThreshold", getConfig().getDouble("Abilities.Air.AirBurst.FallThreshold")); - pushFactorA = new Attribute(this, "pushFactor", getConfig().getDouble("Abilities.Air.AirBurst.PushFactor")); - damageA = new Attribute(this, "damage", getConfig().getDouble("Abilities.Air.AirBurst.Damage")); - blastAngleThetaA = new Attribute(this, "blastAngleTheta", getConfig().getDouble("Abilities.Air.AirBlast.AngleTheta")); - blastAnglePhiA = new Attribute(this, "blastAnglePhi", getConfig().getDouble("Abilities.Air.AirBlast.AnglePhi")); - } } diff --git a/src/com/projectkorra/projectkorra/airbending/AirScooter.java b/src/com/projectkorra/projectkorra/airbending/AirScooter.java index 25ee5e69..f507e2a4 100644 --- a/src/com/projectkorra/projectkorra/airbending/AirScooter.java +++ b/src/com/projectkorra/projectkorra/airbending/AirScooter.java @@ -1,5 +1,6 @@ package com.projectkorra.projectkorra.airbending; +import java.util.ArrayList; import java.util.Random; import org.bukkit.Location; @@ -12,28 +13,22 @@ import org.bukkit.util.Vector; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.WaterAbility; -import com.projectkorra.projectkorra.util.Attribute; -import com.projectkorra.projectkorra.util.Attribute.Attributable; import com.projectkorra.projectkorra.util.Flight; -public class AirScooter extends AirAbility implements Attributable{ +public class AirScooter extends AirAbility { private double speed; private double interval; private double radius; private long cooldown; private double maxHeightFromGround; - private static Attribute speedA; - private static Attribute intervalA; - private static Attribute radiusA; - private static Attribute cooldownA; - private static Attribute heightA; private Block floorblock; private Random random; - private double phi = 0; + private ArrayList angles; private boolean canFly; private boolean hadFly; + private double phi = 0; public AirScooter(Player player) { super(player); @@ -47,12 +42,13 @@ public class AirScooter extends AirAbility implements Attributable{ else if (bPlayer.isOnCooldown(this)) return; - this.speed = speedA.getModified(bPlayer); - this.interval = intervalA.getModified(bPlayer); - this.radius = radiusA.getModified(bPlayer); - this.cooldown = cooldownA.getModified(bPlayer); - this.maxHeightFromGround = heightA.getModified(bPlayer); + this.speed = getConfig().getDouble("Abilities.Air.AirScooter.Speed"); + this.interval = getConfig().getDouble("Abilities.Air.AirScooter.Interval"); + this.radius = getConfig().getDouble("Abilities.Air.AirScooter.Radius"); + this.cooldown = getConfig().getLong("Abilities.Air.AirScooter.Cooldown"); + this.maxHeightFromGround = getConfig().getDouble("Abilities.Air.AirScooter.MaxHeightFromGround"); this.random = new Random(); + this.angles = new ArrayList<>(); canFly = player.getAllowFlight(); hadFly = player.isFlying(); @@ -62,7 +58,11 @@ public class AirScooter extends AirAbility implements Attributable{ player.setSprinting(false); player.setSneaking(false); - + + for (int i = 0; i < 5; i++) { + angles.add((double) (60 * i)); + } + start(); } @@ -109,7 +109,7 @@ public class AirScooter extends AirAbility implements Attributable{ } Vector velocity = player.getEyeLocation().getDirection().clone().normalize(); - velocity = velocity.multiply(speed); + velocity = velocity.clone().normalize().multiply(speed); /* * checks the players speed and ends the move if they are going too slow */ @@ -125,10 +125,11 @@ public class AirScooter extends AirAbility implements Attributable{ * lowers the player based on their distance from the ground. */ double distance = player.getLocation().getY() - (double) floorblock.getY(); - if (distance > 2.355) { - velocity.setY(-0.15); - } else if (distance < 1.9) { - velocity.setY(0.15); + double dx = Math.abs(distance - 2.4); + if (distance > 2.75) { + velocity.setY(-.40 * dx * dx); + } else if (distance < 2) { + velocity.setY(.40 * dx * dx); } else { velocity.setY(0); } @@ -141,14 +142,17 @@ public class AirScooter extends AirAbility implements Attributable{ velocity.add(new Vector(0, 0.6, 0)); } - if (WaterAbility.isWater(player.getLocation().getBlock())) { - remove(); + Location loc = player.getLocation(); + if (!WaterAbility.isWater(player.getLocation().add(0, 2, 0).getBlock())) { + loc.setY((double) floorblock.getY() + 1.5); + } else { return; } player.setSprinting(false); player.removePotionEffect(PotionEffectType.SPEED); player.setVelocity(velocity); + if (random.nextInt(4) == 0) { playAirbendingSound(player.getLocation()); } @@ -164,10 +168,14 @@ public class AirScooter extends AirAbility implements Attributable{ player.setFlying(hadFly); bPlayer.addCooldown(this); } - + + /* + * The particles used for AirScooter phi = how many rings of particles the + * sphere has. theta = how dense the rings are. r = Radius of the sphere + */ private void spinScooter() { - Location origin = player.getLocation().clone(); - Location origin2 = player.getLocation().clone(); + Location origin = player.getLocation(); + Location origin2 = player.getLocation(); phi += Math.PI / 10 * 4; for (double theta = 0; theta <= 2 * Math.PI; theta += Math.PI / 10) { double r = 0.6; @@ -186,7 +194,7 @@ public class AirScooter extends AirAbility implements Attributable{ origin2.subtract(x, y, z); playAirbendingParticles(origin2, 1, 0F, 0F, 0F); origin2.add(x, y, z); -} + } } @Override @@ -262,13 +270,4 @@ public class AirScooter extends AirAbility implements Attributable{ public void setCooldown(long cooldown) { this.cooldown = cooldown; } - - @Override - public void registerAttributes() { - speedA = new Attribute(this, "speed", getConfig().getDouble("Abilities.Air.AirScooter.Speed")); - intervalA = new Attribute(this, "interval", getConfig().getDouble("Abilities.Air.AirScooter.Interval")); - radiusA = new Attribute(this, "radius", getConfig().getDouble("Abilities.Air.AirScooter.Radius")); - heightA = new Attribute(this, "height", getConfig().getDouble("Abilities.Air.AirScooter.MaxHeightFromGround")); - cooldownA = new Attribute(this, "cooldown", getConfig().getLong("Abilities.Air.AirScooter.Cooldown")); - } } diff --git a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java index 555624a9..3b6df4c7 100644 --- a/src/com/projectkorra/projectkorra/configuration/ConfigManager.java +++ b/src/com/projectkorra/projectkorra/configuration/ConfigManager.java @@ -556,8 +556,8 @@ public class ConfigManager { config.addDefault("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Entities", 4.5); config.addDefault("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Self", 4.0); - config.addDefault("Abilities.Avatar.AvatarState.Air.AirSpout.Height", 26); - config.addDefault("Abilities.Avatar.AvatarState.Air.AirSuction.Push", 3.5); + config.addDefault("Abilities.Avatar.AvatarState.AirSpout.Height", 26); + config.addDefault("Abilities.Avatar.AvatarState.AirSuction.Push", 3.5); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSwipe.Cooldown", 1000); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSwipe.Damage", 4.5); config.addDefault("Abilities.Avatar.AvatarState.Air.AirSwipe.Push", 1.0); diff --git a/src/com/projectkorra/projectkorra/util/Attribute.java b/src/com/projectkorra/projectkorra/util/Attribute.java deleted file mode 100644 index 3c3ce825..00000000 --- a/src/com/projectkorra/projectkorra/util/Attribute.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.projectkorra.projectkorra.util; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.projectkorra.projectkorra.BendingPlayer; -import com.projectkorra.projectkorra.ability.CoreAbility; - -public class Attribute { - - private static Map>> attributes = new HashMap<>(); - - public List> modifiers; - public CoreAbility ability; - public String name; - public TYPE value; - - public Attribute(CoreAbility ability, String name, TYPE value) { - this(ability, name, value, new ArrayList>()); - } - - public Attribute(CoreAbility ability, String name, TYPE value, List> modifiers) { - this.ability = ability; - this.name = name; - this.value = value; - if (!attributes.containsKey(ability)) { - attributes.put(ability, new HashMap>()); - } - attributes.get(ability).put(name.toLowerCase(), this); - this.modifiers = new ArrayList>(modifiers); - } - - public List> getModifiers() { - return modifiers; - } - - public void addModifier(AttributeModifier modifier) { - modifiers.add(modifier); - } - - public CoreAbility getAbility() { - return ability; - } - - public String getName() { - return name; - } - - public TYPE getDefault() { - return value; - } - - public TYPE getModified(BendingPlayer bPlayer) { - TYPE modified = value; - for (AttributeModifier modifier : modifiers) { - if (!modifier.canModify(bPlayer)) { - continue; - } - value = modifier.newValue(value); - } - - return modified; - } - - public static Attribute get(CoreAbility ability, String name) { - Map> map = attributes.containsKey(ability) ? attributes.get(ability) : new HashMap>(); - if (map.isEmpty()) { - return null; - } - if (map.containsKey(name.toLowerCase())) { - return map.get(name.toLowerCase()); - } - return null; - } - - public interface AttributeModifier { - public boolean canModify(BendingPlayer bPlayer); - public TYPE newValue(TYPE value); - } - - public interface Attributable { - - /** - * Registers the {@link Attribute} objects the ability has - */ - public void registerAttributes(); - } -} diff --git a/src/com/projectkorra/projectkorra/util/ClickType.java b/src/com/projectkorra/projectkorra/util/ClickType.java index 05dcc0d4..c1956345 100644 --- a/src/com/projectkorra/projectkorra/util/ClickType.java +++ b/src/com/projectkorra/projectkorra/util/ClickType.java @@ -30,11 +30,11 @@ public enum ClickType { */ RIGHT_CLICK_BLOCK, /** - * The shift key being released. + * The shift key being pressed. */ SHIFT_DOWN, /** - * The shift key being pressed. + * The shift key being released. */ SHIFT_UP; } diff --git a/src/com/projectkorra/projectkorra/util/attributes/AttributeModifiers.java b/src/com/projectkorra/projectkorra/util/attributes/AttributeModifiers.java deleted file mode 100644 index fd02a819..00000000 --- a/src/com/projectkorra/projectkorra/util/attributes/AttributeModifiers.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.projectkorra.projectkorra.util.attributes; - -import com.projectkorra.projectkorra.ability.CoreAbility; -import com.projectkorra.projectkorra.airbending.AirBlast; -import com.projectkorra.projectkorra.airbending.AirBurst; -import com.projectkorra.projectkorra.configuration.ConfigManager; -import com.projectkorra.projectkorra.util.Attribute; - -public class AttributeModifiers { - - public AttributeModifiers() { - load(); - } - - @SuppressWarnings("unchecked") - public void load() { - Attribute airBlastPushSelf = (Attribute) Attribute.get(CoreAbility.getAbility(AirBlast.class), "pushFactor"); - airBlastPushSelf.addModifier(new AvatarStateModifier() { - @Override - public Double newValue(Double value) { - return ConfigManager.getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Self"); - } - }); - - Attribute airBlastPushOthers = (Attribute) Attribute.get(CoreAbility.getAbility(AirBlast.class), "pushFactorForOthers"); - airBlastPushOthers.addModifier(new AvatarStateModifier() { - @Override - public Double newValue(Double value) { - return ConfigManager.getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBlast.Push.Entities"); - } - }); - - Attribute airBurstDamage = (Attribute) Attribute.get(CoreAbility.getAbility(AirBurst.class), "damage"); - airBurstDamage.addModifier(new AvatarStateModifier() { - @Override - public Double newValue(Double value) { - return ConfigManager.getConfig().getDouble("Abilities.Avatar.AvatarState.Air.AirBurst.Damage"); - } - }); - - Attribute airBurstChargetime = (Attribute) Attribute.get(CoreAbility.getAbility(AirBurst.class), "chargeTime"); - airBurstChargetime.addModifier(new AvatarStateModifier() { - @Override - public Long newValue(Long value) { - return ConfigManager.getConfig().getLong("Abilities.Avatar.AvatarState.Air.AirBurst.ChargeTime"); - } - }); - } -} diff --git a/src/com/projectkorra/projectkorra/util/attributes/AvatarStateModifier.java b/src/com/projectkorra/projectkorra/util/attributes/AvatarStateModifier.java deleted file mode 100644 index dc5c8254..00000000 --- a/src/com/projectkorra/projectkorra/util/attributes/AvatarStateModifier.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.projectkorra.projectkorra.util.attributes; - -import com.projectkorra.projectkorra.BendingPlayer; -import com.projectkorra.projectkorra.util.Attribute.AttributeModifier; - -public class AvatarStateModifier implements AttributeModifier{ - - @Override - public boolean canModify(BendingPlayer bPlayer) { - return bPlayer.isAvatarState(); - } - - @Override - public TYPE newValue(TYPE value) { - return value; - } - -}