diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/BlazeConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/BlazeConfig.java new file mode 100644 index 00000000..1e3102af --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/BlazeConfig.java @@ -0,0 +1,38 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class BlazeConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final int Arc = 0; + public final double Range = 0; + public final double Speed = 0; + + public final RingConfig RingConfig = new RingConfig(); + + public static class RingConfig { + + public final long Cooldown = 0; + public final int Range = 0; + public final double Angle = 0; + + public final int AvatarState_Range = 0; + + } + + public BlazeConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "Blaze"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/CombustionConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/CombustionConfig.java new file mode 100644 index 00000000..597c3143 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/CombustionConfig.java @@ -0,0 +1,29 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class CombustionConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final double Damage = 0; + public final double Range = 0; + public final double Radius = 0; + public final double Speed = 0; + public final float ExplosivePower = 0; + public final boolean BreakBlocks = true; + + public CombustionConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "Combustion"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBlastConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBlastConfig.java new file mode 100644 index 00000000..2789d56a --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBlastConfig.java @@ -0,0 +1,50 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireBlastConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final boolean Dissipate = true; + public final double Damage = 0; + public final double Range = 0; + public final double Speed = 0; + public final double CollisionRadius = 0; + public final double FireTicks = 0; + public final double Knockback = 0; + + public final ChargedConfig ChargedConfig = new ChargedConfig(); + + public static class ChargedConfig { + + public final long Cooldown = 0; + public final long ChargeTime = 0; + public final boolean Dissipate = true; + public final boolean DamageBlocks = true; + public final double CollisionRadius = 0; + public final double Damage = 0; + public final double Range = 0; + public final double DamageRadius = 0; + public final double ExplosionRadius = 0; + public final double FireTicks = 0; + + public final long AvatarState_ChargeTime = 0; + public final double AvatarState_Damage = 0; + + } + + public FireBlastConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireBlast"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBurstConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBurstConfig.java new file mode 100644 index 00000000..559bfbb4 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireBurstConfig.java @@ -0,0 +1,34 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireBurstConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long ChargeTime = 0; + public final boolean Ignite = true; + public final double Damage = 0; + public final double Range = 0; + public final double AngleTheta = 0; + public final double AnglePhi = 0; + public final double ParticlesPercentage = 0; + + public final long AvatarState_Cooldown = 0; + public final long AvatarState_ChargeTime = 0; + public final double AvatarState_Damage = 0; + + public FireBurstConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireBurst"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireJetConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireJetConfig.java new file mode 100644 index 00000000..d2d9537d --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireJetConfig.java @@ -0,0 +1,28 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireJetConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Speed = 0; + public final boolean ShowGliding = true; + + public final boolean AvatarState_Toggle = true; + + public FireJetConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireJet"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireKickConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireKickConfig.java new file mode 100644 index 00000000..8645eff2 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireKickConfig.java @@ -0,0 +1,29 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireKickConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final double Damage = 0; + public final double Range = 0; + public final double Speed = 0; + + public final double AvatarState_Damage = 0; + public final double AvatarState_Range = 0; + + public FireKickConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireKick"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire", "Combos" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireManipulationConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireManipulationConfig.java new file mode 100644 index 00000000..deb8dca2 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireManipulationConfig.java @@ -0,0 +1,45 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireManipulationConfig extends AbilityConfig { + + public final StreamConfig StreamConfig = new StreamConfig(); + + public final ShieldConfig ShieldConfig = new ShieldConfig(); + + public static class StreamConfig { + + public final long Cooldown = 0; + public final double Range = 0; + public final double Damage = 0; + public final double Speed = 0; + public final int Particles = 0; + + } + + public static class ShieldConfig { + + public final long Cooldown = 0; + public final long MaxDuration = 0; + public final double Range = 0; + public final double Damage = 0; + public final int Particles = 0; + + } + + public FireManipulationConfig() { + super(false, "", ""); + } + + @Override + public String getName() { + return "FireManipulation"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireShieldConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireShieldConfig.java new file mode 100644 index 00000000..f898aef5 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireShieldConfig.java @@ -0,0 +1,43 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireShieldConfig extends AbilityConfig { + + public final DiscConfig DiscConfig = new DiscConfig(); + + public final ShieldConfig ShieldConfig = new ShieldConfig(); + + public static class DiscConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Radius = 0; + public final double FireTicks = 0; + + } + + public static class ShieldConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Radius = 0; + public final double FireTicks = 0; + + } + + public FireShieldConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireShield"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireSpinConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireSpinConfig.java new file mode 100644 index 00000000..f878fc18 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireSpinConfig.java @@ -0,0 +1,31 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireSpinConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final double Damage = 0; + public final double Range = 0; + public final double Speed = 0; + public final double Knockback = 0; + + public final double AvatarState_Damage = 0; + public final double AvatarState_Range = 0; + public final double AvatarState_Knockback = 0; + + public FireSpinConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireSpin"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire", "Combos" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireWheelConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireWheelConfig.java new file mode 100644 index 00000000..171a23d6 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/FireWheelConfig.java @@ -0,0 +1,34 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class FireWheelConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final double Damage = 0; + public final double Range = 0; + public final double Speed = 0; + public final double FireTicks = 0; + public final int Height = 0; + + public final double AvatarState_Damage = 0; + public final double AvatarState_Range = 0; + public final double AvatarState_Speed = 0; + public final double AvatarState_FireTicks = 0; + public final int AvatarState_Height = 0; + + public FireWheelConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "FireWheel"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire", "Combos" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/HeatControlConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/HeatControlConfig.java new file mode 100644 index 00000000..d4fa1773 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/HeatControlConfig.java @@ -0,0 +1,58 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class HeatControlConfig extends AbilityConfig { + + public final CookConfig CookConfig = new CookConfig(); + + public final ExtinguishConfig ExtinguishConfig = new ExtinguishConfig(); + + public final MeltConfig MeltConfig = new MeltConfig(); + + public final SolidifyConfig SolidifyConfig = new SolidifyConfig(); + + public static class CookConfig { + + public final long Interval = 0; + + } + + public static class ExtinguishConfig { + + public final long Cooldown = 0; + public final double Radius = 0; + + } + + public static class MeltConfig { + + public final double Range = 0; + public final double Radius = 0; + + } + + public static class SolidifyConfig { + + public final double MaxRadius = 0; + public final double Range = 0; + public final boolean Revert = true; + public final long RevertTime = 0; + + } + + public HeatControlConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "HeatControl"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/IlluminationConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/IlluminationConfig.java new file mode 100644 index 00000000..3e769065 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/IlluminationConfig.java @@ -0,0 +1,26 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class IlluminationConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final double Range = 0; + public final byte LightThreshold = 0; + public final boolean Passive = true; + + public IlluminationConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "Illumination"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlastConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlastConfig.java new file mode 100644 index 00000000..3165c27c --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlastConfig.java @@ -0,0 +1,25 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class JetBlastConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Speed = 0; + + public JetBlastConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "JetBlast"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire", "Combos" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlazeConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlazeConfig.java new file mode 100644 index 00000000..1865d3a4 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/JetBlazeConfig.java @@ -0,0 +1,30 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class JetBlazeConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Damage = 0; + public final double Speed = 0; + public final double FireTicks = 0; + + public final double AvatarState_Damage = 0; + public final double AvatarState_FireTicks = 0; + + public JetBlazeConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "JetBlaze"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire", "Combos" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/LightningConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/LightningConfig.java new file mode 100644 index 00000000..3dfc0279 --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/LightningConfig.java @@ -0,0 +1,42 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class LightningConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long ChargeTime = 0; + public final double Damage = 0; + public final double Range = 0; + public final boolean SelfHitWater = true; + public final boolean SelfHitClose = true; + public final boolean ArcOnIce = true; + public final double MaxArcAngle = 0; + public final double SubArcChance = 0; + public final double ChainArcRange = 0; + public final double ChainArcChance = 0; + public final double WaterArcRange = 0; + public final double StunChance = 0; + public final long StunDuration = 0; + public final int MaxChainArcs = 0; + public final int WaterArcs = 0; + + public final long AvatarState_Cooldown = 0; + public final long AvatarState_ChargeTime = 0; + public final double AvatarState_Damage = 0; + + public LightningConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "Lightning"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/WallOfFireConfig.java b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/WallOfFireConfig.java new file mode 100644 index 00000000..2c88742a --- /dev/null +++ b/src/com/projectkorra/projectkorra/configuration/better/configs/abilities/fire/WallOfFireConfig.java @@ -0,0 +1,38 @@ +package com.projectkorra.projectkorra.configuration.better.configs.abilities.fire; + +import com.projectkorra.projectkorra.configuration.better.configs.abilities.AbilityConfig; + +public class WallOfFireConfig extends AbilityConfig { + + public final long Cooldown = 0; + public final long Duration = 0; + public final double Damage = 0; + public final long DamageInterval = 0; + public final int Height = 0; + public final int Width = 0; + public final int Range = 0; + public final long Interval = 0; + public final double MaxAngle = 0; + public final double FireTicks = 0; + + public final long AvatarState_Duration = 0; + public final double AvatarState_Damage = 0; + public final int AvatarState_Height = 0; + public final int AvatarState_Width = 0; + public final double AvatarState_FireTicks = 0; + + public WallOfFireConfig() { + super(true, "", ""); + } + + @Override + public String getName() { + return "WallOfFire"; + } + + @Override + public String[] getParents() { + return new String[] { "Abilities", "Fire" }; + } + +} \ No newline at end of file diff --git a/src/com/projectkorra/projectkorra/firebending/Blaze.java b/src/com/projectkorra/projectkorra/firebending/Blaze.java index 280f85bb..35eac4d7 100644 --- a/src/com/projectkorra/projectkorra/firebending/Blaze.java +++ b/src/com/projectkorra/projectkorra/firebending/Blaze.java @@ -7,8 +7,9 @@ import org.bukkit.util.Vector; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; import com.projectkorra.projectkorra.avatar.AvatarState; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.BlazeConfig; -public class Blaze extends FireAbility { +public class Blaze extends FireAbility { @Attribute("Arc") private int arc; @@ -19,13 +20,13 @@ public class Blaze extends FireAbility { @Attribute(Attribute.SPEED) private double speed; - public Blaze(final Player player) { - super(player); + public Blaze(final BlazeConfig config, final Player player) { + super(config, player); this.speed = 2; - this.cooldown = getConfig().getLong("Abilities.Fire.Blaze.Cooldown"); - this.arc = getConfig().getInt("Abilities.Fire.Blaze.Arc"); - this.range = getConfig().getDouble("Abilities.Fire.Blaze.Range"); + this.cooldown = config.Cooldown; + this.arc = config.Arc; + this.range = config.Range; if (!this.bPlayer.canBend(this) || this.bPlayer.isOnCooldown("BlazeArc")) { return; @@ -50,7 +51,7 @@ public class Blaze extends FireAbility { direction.setX(vx); direction.setZ(vz); - new BlazeArc(player, location, direction, this.range); + new BlazeArc(config, player, location, direction, this.range); } this.start(); diff --git a/src/com/projectkorra/projectkorra/firebending/BlazeArc.java b/src/com/projectkorra/projectkorra/firebending/BlazeArc.java index 94184f74..52575471 100644 --- a/src/com/projectkorra/projectkorra/firebending/BlazeArc.java +++ b/src/com/projectkorra/projectkorra/firebending/BlazeArc.java @@ -16,9 +16,10 @@ import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.BlazeConfig; import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth; -public class BlazeArc extends FireAbility { +public class BlazeArc extends FireAbility { private static final long DISSIPATE_REMOVE_TIME = 400; private static final Map IGNITED_BLOCKS = new ConcurrentHashMap<>(); @@ -35,10 +36,10 @@ public class BlazeArc extends FireAbility { private Location location; private Vector direction; - public BlazeArc(final Player player, final Location location, final Vector direction, final double range) { - super(player); + public BlazeArc(final BlazeConfig config, final Player player, final Location location, final Vector direction, final double range) { + super(config, player); this.range = this.getDayFactor(range); - this.speed = getConfig().getLong("Abilities.Fire.Blaze.Speed"); + this.speed = config.Speed; this.interval = (long) (1000. / this.speed); this.origin = location.clone(); this.location = this.origin.clone(); diff --git a/src/com/projectkorra/projectkorra/firebending/BlazeRing.java b/src/com/projectkorra/projectkorra/firebending/BlazeRing.java index 648a4248..db83b427 100644 --- a/src/com/projectkorra/projectkorra/firebending/BlazeRing.java +++ b/src/com/projectkorra/projectkorra/firebending/BlazeRing.java @@ -6,8 +6,9 @@ import org.bukkit.util.Vector; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.BlazeConfig; -public class BlazeRing extends FireAbility { +public class BlazeRing extends FireAbility { @Attribute(Attribute.RANGE) private int range; @@ -16,16 +17,16 @@ public class BlazeRing extends FireAbility { private double angleIncrement; private Location location; - public BlazeRing(final Player player) { - super(player); + public BlazeRing(final BlazeConfig config, final Player player) { + super(config, player); - 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.range = config.RingConfig.Range; + this.angleIncrement = config.RingConfig.Angle; + this.cooldown = config.RingConfig.Cooldown; this.location = player.getLocation(); if (this.bPlayer.isAvatarState()) { - this.range = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.Blaze.Ring.Range"); + this.range = config.RingConfig.AvatarState_Range; } if (!this.bPlayer.canBend(this) || this.bPlayer.isOnCooldown("BlazeRing")) { return; @@ -45,7 +46,7 @@ public class BlazeRing extends FireAbility { direction.setX(vx); direction.setZ(vz); - new BlazeArc(player, this.location, direction, this.range); + new BlazeArc(config, player, this.location, direction, this.range); } this.start(); diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlast.java b/src/com/projectkorra/projectkorra/firebending/FireBlast.java index 60cf74d6..b4b543f6 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlast.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlast.java @@ -22,12 +22,14 @@ import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.attribute.Attribute; import com.projectkorra.projectkorra.avatar.AvatarState; import com.projectkorra.projectkorra.command.Commands; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireBlastConfig; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireBurstConfig; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.waterbending.plant.PlantRegrowth; -public class FireBlast extends FireAbility { +public class FireBlast extends FireAbility { private static final int MAX_TICKS = 10000; @@ -60,8 +62,8 @@ public class FireBlast extends FireAbility { private Vector direction; private List safeBlocks; - public FireBlast(final Location location, final Vector direction, final Player player, final int damage, final List safeBlocks) { - super(player); + public FireBlast(final FireBlastConfig config, final Location location, final Vector direction, final Player player, final double damage, final List safeBlocks) { + super(config, player); if (location.getBlock().isLiquid()) { return; @@ -69,7 +71,6 @@ public class FireBlast extends FireAbility { this.setFields(); this.safeBlocks = safeBlocks; - this.damage = damage; this.location = location.clone(); this.origin = location.clone(); @@ -80,8 +81,8 @@ public class FireBlast extends FireAbility { this.start(); } - public FireBlast(final Player player) { - super(player); + public FireBlast(final FireBlastConfig config, final Player player) { + super(config, player); if (this.bPlayer.isOnCooldown("FireBlast")) { return; @@ -90,8 +91,7 @@ public class FireBlast extends FireAbility { } this.setFields(); - this.isFireBurst = false; - this.damage = this.getDayFactor(getConfig().getDouble("Abilities.Fire.FireBlast.Damage")); + this.damage = this.getDayFactor(config.Damage); this.safeBlocks = new ArrayList<>(); this.range = this.getDayFactor(this.range); this.location = player.getEyeLocation(); @@ -104,19 +104,21 @@ public class FireBlast extends FireAbility { } private void setFields() { - this.isFireBurst = true; + this.isFireBurst = false; this.powerFurnace = true; this.showParticles = true; - this.fireBurstIgnite = getConfig().getBoolean("Abilities.Fire.FireBurst.Ignite"); - 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.knockback = getConfig().getDouble("Abilities.Fire.FireBlast.Knockback"); - this.flameRadius = getConfig().getDouble("Abilities.Fire.FireBlast.FlameParticleRadius"); - this.smokeRadius = getConfig().getDouble("Abilities.Fire.FireBlast.SmokeParticleRadius"); + + this.fireBurstIgnite = false; + this.dissipate = config.Dissipate; + this.cooldown = config.Cooldown; + this.range = config.Range; + this.speed = config.Speed; + this.collisionRadius = config.CollisionRadius; + this.fireTicks = config.FireTicks; + this.knockback = config.Knockback; + this.flameRadius = config.FlameParticleRadius; + this.smokeRadius = config.SmokeParticleRadius; + this.random = new Random(); } @@ -421,8 +423,12 @@ public class FireBlast extends FireAbility { return this.isFireBurst; } - public void setFireBurst(final boolean isFireBurst) { - this.isFireBurst = isFireBurst; + public void setFireBurst(final FireBurstConfig config) { + this.isFireBurst = config != null; + + if (config != null) { + this.fireBurstIgnite = config.Ignite; + } } } diff --git a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java index 3702a830..eabb24fe 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBlastCharged.java @@ -22,10 +22,11 @@ import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; import com.projectkorra.projectkorra.avatar.AvatarState; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireBlastConfig; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; -public class FireBlastCharged extends FireAbility { +public class FireBlastCharged extends FireAbility { private static final Map EXPLOSIONS = new ConcurrentHashMap<>(); @@ -56,8 +57,8 @@ public class FireBlastCharged extends FireAbility { private Location location; private Vector direction; - public FireBlastCharged(final Player player) { - super(player); + public FireBlastCharged(final FireBlastConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBend(this) || hasAbility(player, FireBlastCharged.class)) { return; @@ -65,18 +66,18 @@ public class FireBlastCharged extends FireAbility { this.charged = false; this.launched = false; - this.canDamageBlocks = getConfig().getBoolean("Abilities.Fire.FireBlast.Charged.DamageBlocks"); - this.dissipate = getConfig().getBoolean("Abilities.Fire.FireBlast.Dissipate"); - this.chargeTime = getConfig().getLong("Abilities.Fire.FireBlast.Charged.ChargeTime"); - this.cooldown = getConfig().getLong("Abilities.Fire.FireBlast.Charged.Cooldown"); + this.canDamageBlocks = config.ChargedConfig.DamageBlocks; + this.dissipate = config.ChargedConfig.Dissipate; + this.chargeTime = config.ChargedConfig.ChargeTime; + this.cooldown = config.ChargedConfig.Cooldown; this.time = System.currentTimeMillis(); this.interval = 25; - 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"); - this.explosionRadius = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.ExplosionRadius"); - this.fireTicks = getConfig().getDouble("Abilities.Fire.FireBlast.Charged.FireTicks"); + this.collisionRadius = config.ChargedConfig.CollisionRadius; + this.maxDamage = config.ChargedConfig.Damage; + this.range = config.ChargedConfig.Range; + this.damageRadius = config.ChargedConfig.DamageRadius; + this.explosionRadius = config.ChargedConfig.ExplosionRadius; + this.fireTicks = config.ChargedConfig.FireTicks; this.innerRadius = this.damageRadius / 2; if (isDay(player.getWorld())) { @@ -85,8 +86,8 @@ public class FireBlastCharged extends FireAbility { this.range = this.getDayFactor(this.range); } if (this.bPlayer.isAvatarState()) { - this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBlast.Charged.ChargeTime"); - this.maxDamage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireBlast.Charged.Damage"); + this.chargeTime = config.ChargedConfig.AvatarState_ChargeTime; + this.maxDamage = config.ChargedConfig.AvatarState_ChargeTime; } if (!player.getEyeLocation().getBlock().isLiquid()) { diff --git a/src/com/projectkorra/projectkorra/firebending/FireBurst.java b/src/com/projectkorra/projectkorra/firebending/FireBurst.java index e9b2cfb8..b7d068e5 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireBurst.java +++ b/src/com/projectkorra/projectkorra/firebending/FireBurst.java @@ -14,17 +14,20 @@ import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireBlastConfig; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireBurstConfig; -public class FireBurst extends FireAbility { +public class FireBurst extends FireAbility { @Attribute("Charged") private boolean charged; @Attribute(Attribute.DAMAGE) - private int damage; + private double damage; @Attribute(Attribute.CHARGE_DURATION) private long chargeTime; @Attribute(Attribute.RANGE) - private long range; + private double range; @Attribute(Attribute.COOLDOWN) private long cooldown; private double angleTheta; @@ -32,17 +35,17 @@ public class FireBurst extends FireAbility { private double particlesPercentage; private ArrayList blasts; - public FireBurst(final Player player) { - super(player); + public FireBurst(final FireBurstConfig config, final Player player) { + super(config, player); this.charged = false; - 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 = 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.damage = config.Damage; + this.chargeTime = config.ChargeTime; + this.range = config.Range; + this.cooldown = config.Cooldown; + this.angleTheta = config.AngleTheta; + this.anglePhi = config.AnglePhi; + this.particlesPercentage = config.ParticlesPercentage; this.blasts = new ArrayList<>(); if (!this.bPlayer.canBend(this) || hasAbility(player, FireBurst.class)) { @@ -53,9 +56,9 @@ public class FireBurst extends FireAbility { this.chargeTime /= getDayFactor(); } if (this.bPlayer.isAvatarState()) { - this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage"); - this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.FireBurst.Damage"); - this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.FireBurst.Cooldown"); + this.chargeTime = config.AvatarState_ChargeTime; + this.damage = config.AvatarState_Damage; + this.cooldown = config.AvatarState_Cooldown; } this.start(); @@ -90,8 +93,9 @@ public class FireBurst extends FireAbility { final Vector direction = new Vector(x, z, y); if (direction.angle(vector) <= angle) { - final FireBlast fblast = new FireBlast(location, direction.normalize(), this.player, this.damage, safeBlocks); + final FireBlast fblast = new FireBlast(ConfigManager.getConfig(FireBlastConfig.class), location, direction.normalize(), this.player, this.damage, safeBlocks); fblast.setRange(this.range); + fblast.setFireBurst(config); } } } @@ -159,10 +163,11 @@ public class FireBurst extends FireAbility { z = r * Math.cos(rtheta); final Vector direction = new Vector(x, z, y); - final FireBlast fblast = new FireBlast(location, direction.normalize(), this.player, this.damage, safeblocks); + final FireBlast fblast = new FireBlast(ConfigManager.getConfig(FireBlastConfig.class), location, direction.normalize(), this.player, this.damage, safeblocks); fblast.setRange(this.range); fblast.setShowParticles(false); + fblast.setFireBurst(config); this.blasts.add(fblast); } } @@ -205,11 +210,11 @@ public class FireBurst extends FireAbility { this.charged = charged; } - public int getDamage() { + public double getDamage() { return this.damage; } - public void setDamage(final int damage) { + public void setDamage(final double damage) { this.damage = damage; } @@ -221,11 +226,11 @@ public class FireBurst extends FireAbility { this.chargeTime = chargeTime; } - public long getRange() { + public double getRange() { return this.range; } - public void setRange(final long range) { + public void setRange(final double range) { this.range = range; } diff --git a/src/com/projectkorra/projectkorra/firebending/FireJet.java b/src/com/projectkorra/projectkorra/firebending/FireJet.java index 0f492483..1e75300b 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireJet.java +++ b/src/com/projectkorra/projectkorra/firebending/FireJet.java @@ -14,9 +14,10 @@ import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.airbending.AirSpout; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireJetConfig; import com.projectkorra.projectkorra.util.ParticleEffect; -public class FireJet extends FireAbility { +public class FireJet extends FireAbility { @Attribute("AvatarStateToggle") private boolean avatarStateToggled; @@ -31,8 +32,8 @@ public class FireJet extends FireAbility { private Boolean previousGlidingState; private Boolean showGliding; - public FireJet(final Player player) { - super(player); + public FireJet(final FireJetConfig config, final Player player) { + super(config, player); final FireJet oldJet = getAbility(player, FireJet.class); if (oldJet != null) { @@ -47,11 +48,11 @@ public class FireJet extends FireAbility { abil.remove(); } - this.avatarStateToggled = getConfig().getBoolean("Abilities.Avatar.AvatarState.Fire.FireJet.IsAvatarStateToggle"); - this.duration = getConfig().getLong("Abilities.Fire.FireJet.Duration"); - this.speed = getConfig().getDouble("Abilities.Fire.FireJet.Speed"); - this.cooldown = getConfig().getLong("Abilities.Fire.FireJet.Cooldown"); - this.showGliding = getConfig().getBoolean("Abilities.Fire.FireJet.ShowGliding"); + this.avatarStateToggled = config.AvatarState_Toggle; + this.duration = config.Duration; + this.speed = config.Speed; + this.cooldown = config.Cooldown; + this.showGliding = config.ShowGliding; this.random = new Random(); this.speed = this.getDayFactor(this.speed); diff --git a/src/com/projectkorra/projectkorra/firebending/FireManipulation.java b/src/com/projectkorra/projectkorra/firebending/FireManipulation.java index 63d63a57..22f34bba 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireManipulation.java +++ b/src/com/projectkorra/projectkorra/firebending/FireManipulation.java @@ -14,10 +14,11 @@ import org.bukkit.util.Vector; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.FireAbility; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireManipulationConfig; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; -public class FireManipulation extends FireAbility { +public class FireManipulation extends FireAbility { public static enum FireManipulationType { SHIFT, CLICK; @@ -49,8 +50,8 @@ public class FireManipulation extends FireAbility { private Location origin; private Location focalPoint; - public FireManipulation(final Player player, final FireManipulationType fireManipulationType) { - super(player); + public FireManipulation(final FireManipulationConfig config, final Player player, final FireManipulationType fireManipulationType) { + super(config, player); if (!this.bPlayer.canBend(this)) { return; } @@ -62,17 +63,17 @@ public class FireManipulation extends FireAbility { public void setFields() { if (this.fireManipulationType == FireManipulationType.SHIFT) { - this.streamCooldown = getConfig().getLong("Abilities.Fire.FireManipulation.Stream.Cooldown"); - this.streamRange = getConfig().getDouble("Abilities.Fire.FireManipulation.Stream.Range"); - this.streamDamage = getConfig().getDouble("Abilities.Fire.FireManipulation.Stream.Damage"); - this.streamSpeed = getConfig().getDouble("Abilities.Fire.FireManipulation.Stream.Speed"); - this.streamParticles = getConfig().getInt("Abilities.Fire.FireManipulation.Stream.Particles"); + this.streamCooldown = config.StreamConfig.Cooldown; + this.streamRange = config.StreamConfig.Range; + this.streamDamage = config.StreamConfig.Damage; + this.streamSpeed = config.StreamConfig.Speed; + this.streamParticles = config.StreamConfig.Particles; - this.shieldCooldown = getConfig().getLong("Abilities.Fire.FireManipulation.Shield.Cooldown"); - this.shieldRange = getConfig().getDouble("Abilities.Fire.FireManipulation.Shield.Range"); - this.shieldDamage = getConfig().getDouble("Abilities.Fire.FireManipulation.Shield.Damage"); - this.shieldParticles = getConfig().getInt("Abilities.Fire.FireManipulation.Shield.Particles"); - this.maxDuration = getConfig().getLong("Abilities.Fire.FireManipulation.Shield.MaxDuration"); + this.shieldCooldown = config.ShieldConfig.Cooldown; + this.shieldRange = config.ShieldConfig.Range; + this.shieldDamage = config.ShieldConfig.Damage; + this.shieldParticles = config.ShieldConfig.Particles; + this.maxDuration = config.ShieldConfig.MaxDuration; this.points = new ConcurrentHashMap<>(); } else if (this.fireManipulationType == FireManipulationType.CLICK) { diff --git a/src/com/projectkorra/projectkorra/firebending/FireShield.java b/src/com/projectkorra/projectkorra/firebending/FireShield.java index 1c7ddc0c..8e9dfc10 100644 --- a/src/com/projectkorra/projectkorra/firebending/FireShield.java +++ b/src/com/projectkorra/projectkorra/firebending/FireShield.java @@ -16,10 +16,11 @@ import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireShieldConfig; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.util.ParticleEffect; -public class FireShield extends FireAbility { +public class FireShield extends FireAbility { private boolean shield; @Attribute("IgniteEntities") @@ -44,23 +45,23 @@ public class FireShield extends FireAbility { private Random random; private int increment = 20; - public FireShield(final Player player) { - this(player, false); + public FireShield(final FireShieldConfig config, final Player player) { + this(config, player, false); } - public FireShield(final Player player, final boolean shield) { - super(player); + public FireShield(final FireShieldConfig config, final Player player, final boolean shield) { + super(config, player); this.shield = shield; this.ignite = true; - this.discCooldown = getConfig().getLong("Abilities.Fire.FireShield.Disc.Cooldown"); - this.discDuration = getConfig().getLong("Abilities.Fire.FireShield.Disc.Duration"); - this.discRadius = getConfig().getDouble("Abilities.Fire.FireShield.Disc.Radius"); - this.discFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Disc.FireTicks"); - this.shieldCooldown = getConfig().getLong("Abilities.Fire.FireShield.Shield.Cooldown"); - this.shieldDuration = getConfig().getLong("Abilities.Fire.FireShield.Shield.Duration"); - this.shieldRadius = getConfig().getDouble("Abilities.Fire.FireShield.Shield.Radius"); - this.shieldFireTicks = getConfig().getDouble("Abilities.Fire.FireShield.Shield.FireTicks"); + this.discCooldown = config.DiscConfig.Cooldown; + this.discDuration = config.DiscConfig.Duration; + this.discRadius = config.DiscConfig.Radius; + this.discFireTicks = config.DiscConfig.FireTicks; + this.shieldCooldown = config.ShieldConfig.Cooldown; + this.shieldDuration = config.ShieldConfig.Duration; + this.shieldRadius = config.ShieldConfig.Radius; + this.shieldFireTicks = config.ShieldConfig.FireTicks; this.random = new Random(); if (hasAbility(player, FireShield.class) || this.bPlayer.isOnCooldown("FireShield")) { diff --git a/src/com/projectkorra/projectkorra/firebending/HeatControl.java b/src/com/projectkorra/projectkorra/firebending/HeatControl.java index 6cbf61b8..91832791 100644 --- a/src/com/projectkorra/projectkorra/firebending/HeatControl.java +++ b/src/com/projectkorra/projectkorra/firebending/HeatControl.java @@ -26,6 +26,9 @@ import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.HeatControlConfig; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.water.PhaseChangeConfig; import com.projectkorra.projectkorra.earthbending.lava.LavaFlow; import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.TempBlock; @@ -37,7 +40,7 @@ import com.projectkorra.projectkorra.waterbending.combo.IceWave; import com.projectkorra.projectkorra.waterbending.ice.PhaseChange; import com.projectkorra.projectkorra.waterbending.multiabilities.WaterArmsSpear; -public class HeatControl extends FireAbility { +public class HeatControl extends FireAbility { public enum HeatControlType { COOK, EXTINGUISH, MELT, SOLIDIFY @@ -80,8 +83,8 @@ public class HeatControl extends FireAbility { private Location solidifyLocation; private Random randy; - public HeatControl(final Player player, final HeatControlType heatControlType) { - super(player); + public HeatControl(final HeatControlConfig config, final Player player, final HeatControlType heatControlType) { + super(config, player); this.heatControlType = heatControlType; this.setFields(); @@ -89,7 +92,7 @@ public class HeatControl extends FireAbility { if (this.heatControlType == HeatControlType.COOK) { if (!isCookable(player.getInventory().getItemInMainHand().getType())) { this.remove(); - new HeatControl(player, HeatControlType.SOLIDIFY); + new HeatControl(config, player, HeatControlType.SOLIDIFY); return; } this.start(); @@ -116,7 +119,7 @@ public class HeatControl extends FireAbility { return; } else if (getLavaBlock(player, this.solidifyRange) == null) { this.remove(); - new HeatControl(player, HeatControlType.EXTINGUISH); + new HeatControl(config, player, HeatControlType.EXTINGUISH); return; } @@ -129,24 +132,24 @@ public class HeatControl extends FireAbility { public void setFields() { if (this.heatControlType == HeatControlType.COOK) { this.cookTime = System.currentTimeMillis(); - this.cookInterval = getConfig().getLong("Abilities.Fire.HeatControl.Cook.Interval"); + this.cookInterval = config.CookConfig.Interval; } else if (this.heatControlType == HeatControlType.EXTINGUISH) { - this.extinguishCooldown = getConfig().getLong("Abilities.Fire.HeatControl.Extinguish.Cooldown"); - this.extinguishRadius = getConfig().getLong("Abilities.Fire.HeatControl.Extinguish.Radius"); + this.extinguishCooldown = config.ExtinguishConfig.Cooldown; + this.extinguishRadius = config.ExtinguishConfig.Radius; this.extinguishRadius = this.getDayFactor(this.extinguishRadius); } else if (this.heatControlType == HeatControlType.MELT) { - this.meltRange = getConfig().getDouble("Abilities.Fire.HeatControl.Melt.Range"); - this.meltRadius = getConfig().getDouble("Abilities.Fire.HeatControl.Melt.Radius"); + this.meltRange = config.MeltConfig.Range; + this.meltRadius = config.MeltConfig.Radius; this.meltRange = this.getDayFactor(this.meltRange); this.meltRadius = this.getDayFactor(this.meltRadius); } else if (this.heatControlType == HeatControlType.SOLIDIFY) { this.solidifyRadius = 1; this.solidifyDelay = 50; this.solidifyLastBlockTime = 0; - this.solidifyMaxRadius = getConfig().getDouble("Abilities.Fire.HeatControl.Solidify.MaxRadius"); - this.solidifyRange = getConfig().getDouble("Abilities.Fire.HeatControl.Solidify.Range"); - this.solidifyRevert = getConfig().getBoolean("Abilities.Fire.HeatControl.Solidify.Revert"); - this.solidifyRevertTime = getConfig().getLong("Abilities.Fire.HeatControl.Solidify.RevertTime"); + this.solidifyMaxRadius = config.SolidifyConfig.MaxRadius; + this.solidifyRange = config.SolidifyConfig.Range; + this.solidifyRevert = config.SolidifyConfig.Revert; + this.solidifyRevertTime = config.SolidifyConfig.RevertTime; this.randy = new Random(); } } @@ -319,7 +322,7 @@ public class HeatControl extends FireAbility { if (TempBlock.isTempBlock(block)) { final TempBlock tb = TempBlock.get(block); if (PhaseChange.getFrozenBlocksMap().containsKey(tb)) { - new PhaseChange(player, PhaseChange.PhaseChangeType.MELT).melt(tb.getBlock()); + new PhaseChange(ConfigManager.getConfig(PhaseChangeConfig.class), player, PhaseChange.PhaseChangeType.MELT).melt(tb.getBlock()); } } diff --git a/src/com/projectkorra/projectkorra/firebending/Illumination.java b/src/com/projectkorra/projectkorra/firebending/Illumination.java index c7314a81..279d4298 100644 --- a/src/com/projectkorra/projectkorra/firebending/Illumination.java +++ b/src/com/projectkorra/projectkorra/firebending/Illumination.java @@ -14,9 +14,10 @@ import com.projectkorra.projectkorra.Element; import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.IlluminationConfig; import com.projectkorra.projectkorra.util.TempBlock; -public class Illumination extends FireAbility { +public class Illumination extends FireAbility { private static final Map BLOCKS = new ConcurrentHashMap<>(); @@ -25,17 +26,17 @@ public class Illumination extends FireAbility { private long cooldown; @Attribute(Attribute.RANGE) private double range; - private int lightThreshold; + private byte lightThreshold; private Material normalType; private TempBlock block; - private int oldLevel; + private byte oldLevel; - public Illumination(final Player player) { - super(player); + public Illumination(final IlluminationConfig config, final Player player) { + super(config, player); - this.range = this.getDayFactor(getConfig().getDouble("Abilities.Fire.Illumination.Range")); - this.cooldown = getConfig().getLong("Abilities.Fire.Illumination.Cooldown"); - this.lightThreshold = getConfig().getInt("Abilities.Fire.Illumination.LightThreshold"); + this.range = this.getDayFactor(config.Range); + this.cooldown = config.Cooldown; + this.lightThreshold = config.LightThreshold; final Illumination oldIllumination = getAbility(player, Illumination.class); if (oldIllumination != null) { diff --git a/src/com/projectkorra/projectkorra/firebending/WallOfFire.java b/src/com/projectkorra/projectkorra/firebending/WallOfFire.java index d73935de..60aa751d 100644 --- a/src/com/projectkorra/projectkorra/firebending/WallOfFire.java +++ b/src/com/projectkorra/projectkorra/firebending/WallOfFire.java @@ -15,12 +15,13 @@ import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ability.AirAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.WallOfFireConfig; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; import com.projectkorra.projectkorra.util.TempBlock; -public class WallOfFire extends FireAbility { +public class WallOfFire extends FireAbility { private boolean active; private int damageTick; @@ -47,20 +48,20 @@ public class WallOfFire extends FireAbility { private Location origin; private List blocks; - public WallOfFire(final Player player) { - super(player); + public WallOfFire(final WallOfFireConfig config, final Player player) { + super(config, player); this.active = true; - 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().getDouble("Abilities.Fire.WallOfFire.Damage"); - this.cooldown = getConfig().getLong("Abilities.Fire.WallOfFire.Cooldown"); - 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.maxAngle = config.MaxAngle; + this.interval = config.Interval; + this.range = config.Range; + this.height = config.Height; + this.width = config.Width; + this.damage = config.Damage; + this.cooldown = config.Cooldown; + this.damageInterval = config.DamageInterval; + this.duration = config.Duration; + this.fireTicks = config.FireTicks; this.random = new Random(); this.blocks = new ArrayList<>(); @@ -80,11 +81,11 @@ public class WallOfFire extends FireAbility { } if (this.bPlayer.isAvatarState()) { - this.width = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.WallOfFire.Width"); - this.height = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.WallOfFire.Height"); - this.duration = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.WallOfFire.Duration"); - this.damage = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.WallOfFire.Damage"); - this.fireTicks = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.WallOfFire.FireTicks"); + this.width = config.AvatarState_Width; + this.height = config.AvatarState_Height; + this.duration = config.AvatarState_Duration; + this.damage = config.AvatarState_Damage; + this.fireTicks = config.AvatarState_FireTicks; } this.time = System.currentTimeMillis(); diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireComboStream.java b/src/com/projectkorra/projectkorra/firebending/combo/FireComboStream.java index dd11a98c..0c0d4108 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireComboStream.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireComboStream.java @@ -28,6 +28,7 @@ import com.projectkorra.projectkorra.util.ParticleEffect; * stream for all their progress methods. If someone else was reliant on that, * they can use this ability instead. */ +@SuppressWarnings("rawtypes") public class FireComboStream extends BukkitRunnable { private boolean useNewParticles; private boolean cancelled; diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java b/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java index eb055423..879387f1 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireKick.java @@ -17,9 +17,11 @@ import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireKickConfig; import com.projectkorra.projectkorra.util.ClickType; -public class FireKick extends FireAbility implements ComboAbility { +public class FireKick extends FireAbility implements ComboAbility { @Attribute(Attribute.COOLDOWN) private long cooldown; @@ -34,8 +36,8 @@ public class FireKick extends FireAbility implements ComboAbility { private ArrayList affectedEntities; private ArrayList tasks; - public FireKick(final Player player) { - super(player); + public FireKick(final FireKickConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { return; @@ -44,15 +46,15 @@ public class FireKick extends FireAbility implements ComboAbility { this.affectedEntities = new ArrayList<>(); this.tasks = new ArrayList<>(); - this.damage = getConfig().getDouble("Abilities.Fire.FireKick.Damage"); - this.range = getConfig().getDouble("Abilities.Fire.FireKick.Range"); - this.cooldown = getConfig().getLong("Abilities.Fire.FireKick.Cooldown"); - this.speed = getConfig().getLong("Abilities.Fire.FireKick.Speed"); + this.damage = config.Damage; + this.range = config.Range; + this.cooldown = config.Cooldown; + this.speed = config.Speed; if (this.bPlayer.isAvatarState()) { this.cooldown = 0; - this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireKick.Damage"); - this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireKick.Range"); + this.damage = config.AvatarState_Damage; + this.range = config.AvatarState_Range; } this.start(); @@ -185,7 +187,7 @@ public class FireKick extends FireAbility implements ComboAbility { @Override public Object createNewComboInstance(final Player player) { - return new FireKick(player); + return new FireKick(ConfigManager.getConfig(FireKickConfig.class), player); } @Override diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java b/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java index 34cbe014..85641ebb 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireSpin.java @@ -18,9 +18,11 @@ import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireSpinConfig; import com.projectkorra.projectkorra.util.ClickType; -public class FireSpin extends FireAbility implements ComboAbility { +public class FireSpin extends FireAbility implements ComboAbility { @Attribute(Attribute.COOLDOWN) private long cooldown; @@ -36,8 +38,8 @@ public class FireSpin extends FireAbility implements ComboAbility { private ArrayList affectedEntities; private ArrayList tasks; - public FireSpin(final Player player) { - super(player); + public FireSpin(final FireSpinConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBendIgnoreBindsCooldowns(this)) { return; @@ -50,17 +52,17 @@ public class FireSpin extends FireAbility implements ComboAbility { this.affectedEntities = new ArrayList<>(); this.tasks = new ArrayList<>(); - this.damage = getConfig().getDouble("Abilities.Fire.FireSpin.Damage"); - this.range = getConfig().getDouble("Abilities.Fire.FireSpin.Range"); - this.cooldown = getConfig().getLong("Abilities.Fire.FireSpin.Cooldown"); - this.knockback = getConfig().getDouble("Abilities.Fire.FireSpin.Knockback"); - this.speed = getConfig().getDouble("Abilities.Fire.FireSpin.Speed"); + this.damage = config.Damage; + this.range = config.Range; + this.cooldown = config.Cooldown; + this.knockback = config.Knockback; + this.speed = config.Speed; if (this.bPlayer.isAvatarState()) { this.cooldown = 0; - this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireSpin.Damage"); - this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireSpin.Range"); - this.knockback = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireSpin.Knockback"); + this.damage = config.AvatarState_Damage; + this.range = config.AvatarState_Range; + this.knockback = config.AvatarState_Knockback; } this.start(); @@ -162,7 +164,7 @@ public class FireSpin extends FireAbility implements ComboAbility { @Override public Object createNewComboInstance(final Player player) { - return new FireSpin(player); + return new FireSpin(ConfigManager.getConfig(FireSpinConfig.class), player); } @Override diff --git a/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java b/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java index fcbbda38..db0ef9be 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/FireWheel.java @@ -18,12 +18,14 @@ import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.FireWheelConfig; import com.projectkorra.projectkorra.firebending.util.FireDamageTimer; import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; -public class FireWheel extends FireAbility implements ComboAbility { +public class FireWheel extends FireAbility implements ComboAbility { private Location origin; private Location location; @@ -43,20 +45,20 @@ public class FireWheel extends FireAbility implements ComboAbility { private double damage; private ArrayList affectedEntities; - public FireWheel(final Player player) { - super(player); + public FireWheel(final FireWheelConfig config, final Player player) { + super(config, player); if (this.bPlayer.isOnCooldown("FireWheel") && !this.bPlayer.isAvatarState()) { this.remove(); return; } - this.damage = getConfig().getDouble("Abilities.Fire.FireWheel.Damage"); - this.range = getConfig().getDouble("Abilities.Fire.FireWheel.Range"); - this.speed = getConfig().getDouble("Abilities.Fire.FireWheel.Speed"); - this.cooldown = getConfig().getLong("Abilities.Fire.FireWheel.Cooldown"); - this.fireTicks = getConfig().getDouble("Abilities.Fire.FireWheel.FireTicks"); - this.height = getConfig().getInt("Abilities.Fire.FireWheel.Height"); + this.damage = config.Damage; + this.range = config.Range; + this.speed = config.Speed; + this.cooldown = config.Cooldown; + this.fireTicks = config.FireTicks; + this.height = config.Height; this.bPlayer.addCooldown(this); this.affectedEntities = new ArrayList(); @@ -73,11 +75,11 @@ public class FireWheel extends FireAbility implements ComboAbility { if (this.bPlayer.isAvatarState()) { this.cooldown = 0; - this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireWheel.Damage"); - this.range = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireWheel.Range"); - this.speed = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireWheel.Speed"); - this.fireTicks = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.FireWheel.FireTicks"); - this.height = getConfig().getInt("Abilities.Avatar.AvatarState.Fire.FireWheel.Height"); + this.damage = config.AvatarState_Damage; + this.range = config.AvatarState_Range; + this.speed = config.AvatarState_Speed; + this.fireTicks = config.AvatarState_FireTicks; + this.height = config.AvatarState_Height; } this.radius = this.height - 1; @@ -88,7 +90,7 @@ public class FireWheel extends FireAbility implements ComboAbility { @Override public Object createNewComboInstance(final Player player) { - return new FireWheel(player); + return new FireWheel(ConfigManager.getConfig(FireWheelConfig.class), player); } @Override diff --git a/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java b/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java index 3642ef7d..ea9547ec 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/JetBlast.java @@ -11,11 +11,13 @@ import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.JetBlastConfig; import com.projectkorra.projectkorra.firebending.FireJet; import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ParticleEffect; -public class JetBlast extends FireAbility implements ComboAbility { +public class JetBlast extends FireAbility implements ComboAbility { private boolean firstTime; private long time; @@ -27,8 +29,8 @@ public class JetBlast extends FireAbility implements ComboAbility { @Attribute(Attribute.DURATION) private long duration; - public JetBlast(final Player player) { - super(player); + public JetBlast(final JetBlastConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBendIgnoreBinds(this)) { return; @@ -38,9 +40,9 @@ public class JetBlast extends FireAbility implements ComboAbility { this.time = System.currentTimeMillis(); this.tasks = new ArrayList<>(); - this.speed = getConfig().getDouble("Abilities.Fire.JetBlast.Speed"); - this.cooldown = getConfig().getLong("Abilities.Fire.JetBlast.Cooldown"); - this.duration = getConfig().getLong("Abilities.Fire.JetBlast.Duration"); + this.speed = config.Speed; + this.cooldown = config.Cooldown; + this.duration = config.Duration; if (this.bPlayer.isAvatarState()) { this.cooldown = 0; @@ -51,7 +53,7 @@ public class JetBlast extends FireAbility implements ComboAbility { @Override public Object createNewComboInstance(final Player player) { - return new JetBlast(player); + return new JetBlast(ConfigManager.getConfig(JetBlastConfig.class), player); } @Override diff --git a/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java b/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java index f860aa7a..65b96fd3 100644 --- a/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java +++ b/src/com/projectkorra/projectkorra/firebending/combo/JetBlaze.java @@ -13,11 +13,13 @@ import com.projectkorra.projectkorra.ability.ComboAbility; import com.projectkorra.projectkorra.ability.FireAbility; import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformation; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.JetBlazeConfig; import com.projectkorra.projectkorra.firebending.FireJet; import com.projectkorra.projectkorra.util.ClickType; import com.projectkorra.projectkorra.util.ParticleEffect; -public class JetBlaze extends FireAbility implements ComboAbility { +public class JetBlaze extends FireAbility implements ComboAbility { private boolean firstTime; private int progressCounter; @@ -36,8 +38,8 @@ public class JetBlaze extends FireAbility implements ComboAbility { @Attribute(Attribute.DURATION) private long duration; - public JetBlaze(final Player player) { - super(player); + public JetBlaze(final JetBlazeConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBendIgnoreBinds(this)) { return; @@ -48,16 +50,16 @@ public class JetBlaze extends FireAbility implements ComboAbility { this.affectedEntities = new ArrayList<>(); this.tasks = new ArrayList<>(); - this.damage = getConfig().getDouble("Abilities.Fire.JetBlaze.Damage"); - this.duration = getConfig().getLong("Abilities.Fire.JetBlaze.Duration"); - this.speed = getConfig().getDouble("Abilities.Fire.JetBlaze.Speed"); - this.cooldown = getConfig().getLong("Abilities.Fire.JetBlaze.Cooldown"); - this.fireTicks = getConfig().getDouble("Abilities.Fire.JetBlaze.FireTicks"); + this.damage = config.Damage; + this.duration = config.Duration; + this.speed = config.Speed; + this.cooldown = config.Cooldown; + this.fireTicks = config.FireTicks; if (this.bPlayer.isAvatarState()) { this.cooldown = 0; - this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.JetBlaze.Damage"); - this.fireTicks = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.JetBlaze.FireTicks"); + this.damage = config.AvatarState_Damage; + this.fireTicks = config.AvatarState_FireTicks; } this.start(); @@ -65,7 +67,7 @@ public class JetBlaze extends FireAbility implements ComboAbility { @Override public Object createNewComboInstance(final Player player) { - return new JetBlaze(player); + return new JetBlaze(ConfigManager.getConfig(JetBlazeConfig.class), player); } @Override diff --git a/src/com/projectkorra/projectkorra/firebending/combustion/Combustion.java b/src/com/projectkorra/projectkorra/firebending/combustion/Combustion.java index 000884ef..026ec18a 100644 --- a/src/com/projectkorra/projectkorra/firebending/combustion/Combustion.java +++ b/src/com/projectkorra/projectkorra/firebending/combustion/Combustion.java @@ -15,10 +15,11 @@ import com.projectkorra.projectkorra.ability.ElementalAbility; import com.projectkorra.projectkorra.ability.util.Collision; import com.projectkorra.projectkorra.attribute.Attribute; import com.projectkorra.projectkorra.avatar.AvatarState; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.CombustionConfig; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.ParticleEffect; -public class Combustion extends CombustionAbility { +public class Combustion extends CombustionAbility { private static final int MAX_TICKS = 10000; @@ -41,21 +42,21 @@ public class Combustion extends CombustionAbility { private Location origin; private Vector direction; - public Combustion(final Player player) { - super(player); + public Combustion(final CombustionConfig config, final Player player) { + super(config, player); if (hasAbility(player, Combustion.class) || !this.bPlayer.canBend(this)) { return; } this.ticks = 0; - this.breakBlocks = getConfig().getBoolean("Abilities.Fire.Combustion.BreakBlocks"); - this.explosivePower = (float) getConfig().getDouble("Abilities.Fire.Combustion.ExplosivePower"); - this.cooldown = getConfig().getLong("Abilities.Fire.Combustion.Cooldown"); - this.damage = getConfig().getDouble("Abilities.Fire.Combustion.Damage"); - this.radius = getConfig().getDouble("Abilities.Fire.Combustion.Radius"); - this.speed = getConfig().getDouble("Abilities.Fire.Combustion.Speed"); - this.range = getConfig().getDouble("Abilities.Fire.Combustion.Range"); + this.breakBlocks = config.BreakBlocks; + this.explosivePower = config.ExplosivePower; + this.cooldown = config.Cooldown; + this.damage = config.Damage; + this.radius = config.Radius; + this.speed = config.Speed; + this.range = config.Range; this.origin = player.getEyeLocation(); this.direction = player.getEyeLocation().getDirection().normalize(); this.location = this.origin.clone(); diff --git a/src/com/projectkorra/projectkorra/firebending/lightning/Lightning.java b/src/com/projectkorra/projectkorra/firebending/lightning/Lightning.java index ed0c15d7..255961c1 100644 --- a/src/com/projectkorra/projectkorra/firebending/lightning/Lightning.java +++ b/src/com/projectkorra/projectkorra/firebending/lightning/Lightning.java @@ -16,10 +16,11 @@ import com.projectkorra.projectkorra.GeneralMethods; import com.projectkorra.projectkorra.ProjectKorra; import com.projectkorra.projectkorra.ability.LightningAbility; import com.projectkorra.projectkorra.attribute.Attribute; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.LightningConfig; import com.projectkorra.projectkorra.util.DamageHandler; import com.projectkorra.projectkorra.util.MovementHandler; -public class Lightning extends LightningAbility { +public class Lightning extends LightningAbility { public static enum State { START, STRIKE, MAINBOLT @@ -39,7 +40,7 @@ public class Lightning extends LightningAbility { @Attribute(Attribute.RANGE) private double range; @Attribute(Attribute.CHARGE_DURATION) - private double chargeTime; + private long chargeTime; @Attribute("SubArcChance") private double subArcChance; @Attribute(Attribute.DAMAGE) @@ -55,7 +56,7 @@ public class Lightning extends LightningAbility { @Attribute("StunChance") private double stunChance; @Attribute("Stun" + Attribute.DURATION) - private double stunDuration; + private long stunDuration; @Attribute("MaxArcAngle") private double maxArcAngle; private double particleRotation; @@ -70,8 +71,8 @@ public class Lightning extends LightningAbility { private ArrayList tasks; private ArrayList locations; - public Lightning(final Player player) { - super(player); + public Lightning(final LightningConfig config, final Player player) { + super(config, player); if (!this.bPlayer.canBend(this)) { return; @@ -92,22 +93,22 @@ public class Lightning extends LightningAbility { this.tasks = new ArrayList<>(); this.locations = new ArrayList<>(); - this.selfHitWater = getConfig().getBoolean("Abilities.Fire.Lightning.SelfHitWater"); - this.selfHitClose = getConfig().getBoolean("Abilities.Fire.Lightning.SelfHitClose"); - this.arcOnIce = getConfig().getBoolean("Abilities.Fire.Lightning.ArcOnIce"); - this.range = getConfig().getDouble("Abilities.Fire.Lightning.Range"); - this.damage = getConfig().getDouble("Abilities.Fire.Lightning.Damage"); - this.maxArcAngle = getConfig().getDouble("Abilities.Fire.Lightning.MaxArcAngle"); - this.subArcChance = getConfig().getDouble("Abilities.Fire.Lightning.SubArcChance"); - this.chainRange = getConfig().getDouble("Abilities.Fire.Lightning.ChainArcRange"); - this.chainArcChance = getConfig().getDouble("Abilities.Fire.Lightning.ChainArcChance"); - this.waterArcRange = getConfig().getDouble("Abilities.Fire.Lightning.WaterArcRange"); - this.stunChance = getConfig().getDouble("Abilities.Fire.Lightning.StunChance"); - this.stunDuration = getConfig().getDouble("Abilities.Fire.Lightning.StunDuration"); - this.maxChainArcs = getConfig().getInt("Abilities.Fire.Lightning.MaxChainArcs"); - this.waterArcs = getConfig().getInt("Abilities.Fire.Lightning.WaterArcs"); - this.chargeTime = getConfig().getLong("Abilities.Fire.Lightning.ChargeTime"); - this.cooldown = getConfig().getLong("Abilities.Fire.Lightning.Cooldown"); + this.selfHitWater = config.SelfHitWater; + this.selfHitClose = config.SelfHitClose; + this.arcOnIce = config.ArcOnIce; + this.range = config.Range; + this.damage = config.Damage; + this.maxArcAngle = config.MaxArcAngle; + this.subArcChance = config.SubArcChance; + this.chainRange = config.ChainArcRange; + this.chainArcChance = config.ChainArcChance; + this.waterArcRange = config.WaterArcRange; + this.stunChance = config.StunChance; + this.stunDuration = config.StunDuration; + this.maxChainArcs = config.MaxChainArcs; + this.waterArcs = config.WaterArcs; + this.chargeTime = config.ChargeTime; + this.cooldown = config.Cooldown; this.range = this.getDayFactor(this.range); this.subArcChance = this.getDayFactor(this.subArcChance); @@ -117,12 +118,12 @@ public class Lightning extends LightningAbility { this.chainRange = this.getDayFactor(this.chainRange); this.waterArcRange = this.getDayFactor(this.waterArcRange); this.stunChance = this.getDayFactor(this.stunChance); - this.stunDuration = this.getDayFactor(this.stunDuration); + this.stunDuration = (long) this.getDayFactor(this.stunDuration); if (this.bPlayer.isAvatarState()) { - this.chargeTime = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.ChargeTime"); - this.cooldown = getConfig().getLong("Abilities.Avatar.AvatarState.Fire.Lightning.Cooldown"); - this.damage = getConfig().getDouble("Abilities.Avatar.AvatarState.Fire.Lightning.Damage"); + this.chargeTime = config.AvatarState_ChargeTime; + this.cooldown = config.AvatarState_Cooldown; + this.damage = config.AvatarState_Damage; } this.start(); } @@ -139,7 +140,7 @@ public class Lightning extends LightningAbility { if (Math.random() <= this.stunChance) { final MovementHandler mh = new MovementHandler(lent, this); - mh.stopWithDuration((long) this.stunDuration, Element.LIGHTNING.getColor() + "* Electrocuted *"); + mh.stopWithDuration(this.stunDuration, Element.LIGHTNING.getColor() + "* Electrocuted *"); } } @@ -702,11 +703,11 @@ public class Lightning extends LightningAbility { this.range = range; } - public double getChargeTime() { + public long getChargeTime() { return this.chargeTime; } - public void setChargeTime(final double chargeTime) { + public void setChargeTime(final long chargeTime) { this.chargeTime = chargeTime; } @@ -766,11 +767,11 @@ public class Lightning extends LightningAbility { this.stunChance = stunChance; } - public double getStunDuration() { + public long getStunDuration() { return this.stunDuration; } - public void setStunDuration(final double stunDuration) { + public void setStunDuration(final long stunDuration) { this.stunDuration = stunDuration; } diff --git a/src/com/projectkorra/projectkorra/firebending/passive/FirePassive.java b/src/com/projectkorra/projectkorra/firebending/passive/FirePassive.java index 8e567fd8..ff4dc7ff 100644 --- a/src/com/projectkorra/projectkorra/firebending/passive/FirePassive.java +++ b/src/com/projectkorra/projectkorra/firebending/passive/FirePassive.java @@ -5,21 +5,24 @@ import org.bukkit.entity.Player; import com.projectkorra.projectkorra.BendingPlayer; import com.projectkorra.projectkorra.ability.CoreAbility; import com.projectkorra.projectkorra.command.Commands; -import com.projectkorra.projectkorra.configuration.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.ConfigManager; +import com.projectkorra.projectkorra.configuration.better.configs.abilities.fire.IlluminationConfig; +import com.projectkorra.projectkorra.configuration.better.configs.properties.GeneralPropertiesConfig; import com.projectkorra.projectkorra.earthbending.Tremorsense; import com.projectkorra.projectkorra.firebending.Illumination; public class FirePassive { public static void handle(final Player player) { - if (Commands.isToggledForAll && ConfigManager.defaultConfig.get().getBoolean("Properties.TogglePassivesWithAllBending")) { + if (Commands.isToggledForAll && ConfigManager.getConfig(GeneralPropertiesConfig.class).TogglePassivesWithAllBending) { return; } final BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player); if (bPlayer != null && bPlayer.canBendPassive(CoreAbility.getAbility(Illumination.class)) && bPlayer.canUsePassive(CoreAbility.getAbility(Illumination.class))) { - if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) && !CoreAbility.hasAbility(player, Tremorsense.class) && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) { + IlluminationConfig config = ConfigManager.getConfig(IlluminationConfig.class); + if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) && !CoreAbility.hasAbility(player, Tremorsense.class) && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && config.Passive) { if (bPlayer.isIlluminating()) { - new Illumination(player); + new Illumination(config, player); } } }