diff --git a/Dev Builds/Korra.jar b/Dev Builds/Korra.jar index 238d1647..ebefa8a1 100644 Binary files a/Dev Builds/Korra.jar and b/Dev Builds/Korra.jar differ diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index 48babf6c..2aa47621 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -144,6 +144,7 @@ public class ConfigManager { + "This wind will deflect all projectiles and will prevent any creature from " + "entering it for as long as its maintained."); config.addDefault("Abilities.Air.AirShield.Radius", 7); + config.addDefault("Abilities.Air.AirShield.IsAvatarStateToggle", true); config.addDefault("Abilities.Air.AirSpout.Enabled", true); config.addDefault("Abilities.Air.AirSpout.Description", "This ability gives the airbender limited sustained levitation. It is a " @@ -385,6 +386,7 @@ public class ConfigManager { config.addDefault("Abilities.Fire.FireJet.Speed", 0.7); config.addDefault("Abilities.Fire.FireJet.Duration", 1500); config.addDefault("Abilities.Fire.FireJet.Cooldown", 6000); + config.addDefault("Abilities.Fire.FireJet.IsAvatarStateToggle", true); config.addDefault("Abilities.Fire.FireShield.Enabled", true); config.addDefault("Abilities.Fire.FireShield.Description", "FireShield is a basic defensive ability. " diff --git a/src/com/projectkorra/ProjectKorra/PKListener.java b/src/com/projectkorra/ProjectKorra/PKListener.java index 8ad7f987..fe7b19a9 100644 --- a/src/com/projectkorra/ProjectKorra/PKListener.java +++ b/src/com/projectkorra/ProjectKorra/PKListener.java @@ -499,9 +499,7 @@ public class PKListener implements Listener { String abil = Methods.getBoundAbility(player); if (abil == null) return; if (Methods.canBend(player.getName(), abil)) { - if (abil.equalsIgnoreCase("AvatarState")) { - new AvatarState(player); - } + if (Methods.isAirAbility(abil)) { if (Methods.isWeapon(player.getItemInHand().getType()) && !plugin.getConfig().getBoolean("Properties.Air.CanBendWithWeapons")) { @@ -635,6 +633,10 @@ public class PKListener implements Listener { // } } + + if (abil.equalsIgnoreCase("AvatarState")) { + new AvatarState(player); + } } } diff --git a/src/com/projectkorra/ProjectKorra/airbending/AirShield.java b/src/com/projectkorra/ProjectKorra/airbending/AirShield.java index 6d6a1ffe..c2a1d2af 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/AirShield.java +++ b/src/com/projectkorra/ProjectKorra/airbending/AirShield.java @@ -21,6 +21,7 @@ public class AirShield { private static double maxradius = ProjectKorra.plugin.getConfig().getDouble("Abilities.Air.AirShield.Radius"); private static int numberOfStreams = (int) (.75 * (double) maxradius); + private static boolean isToggle = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Air.AirShield.IsAvatarStateToggle"); private double radius = 2; @@ -31,7 +32,7 @@ public class AirShield { public AirShield(Player player) { if (AvatarState.isAvatarState(player) - && instances.containsKey(player.getEntityId())) { + && instances.containsKey(player.getEntityId()) && isToggle) { instances.remove(player.getEntityId()); return; } @@ -141,11 +142,27 @@ public class AirShield { instances.remove(player.getEntityId()); return false; } - if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player - .isSneaking())) && !AvatarState.isAvatarState(player)) { - instances.remove(player.getEntityId()); - return false; + + if (isToggle) { + if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player + .isSneaking())) && !AvatarState.isAvatarState(player)) { + instances.remove(player.getEntityId()); + return false; + } + } else { + if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player + .isSneaking()))) { + instances.remove(player.getEntityId()); + return false; + } } + + // + // if (((!Methods.getBoundAbility(player).equalsIgnoreCase("AirShield")) || (!player + // .isSneaking()))) { + // instances.remove(player.getEntityId()); + // return false; + // } rotateShield(); return true; } diff --git a/src/com/projectkorra/ProjectKorra/firebending/FireJet.java b/src/com/projectkorra/ProjectKorra/firebending/FireJet.java index cd228e23..dedef201 100644 --- a/src/com/projectkorra/ProjectKorra/firebending/FireJet.java +++ b/src/com/projectkorra/ProjectKorra/firebending/FireJet.java @@ -21,6 +21,7 @@ public class FireJet { public static ConcurrentHashMap cooldowns = new ConcurrentHashMap(); private static final double defaultfactor = ProjectKorra.plugin.getConfig().getDouble("Abilities.Fire.FireJet.Speed"); private static final long defaultduration = ProjectKorra.plugin.getConfig().getLong("Abilities.Fire.FireJet.Duration"); + private static boolean isToggle = ProjectKorra.plugin.getConfig().getBoolean("Abilities.Fire.FireJet.IsAvatarStateToggle"); // private static final long cooldown = ConfigManager.fireJetCooldown; // private static ConcurrentHashMap timers = new @@ -88,14 +89,14 @@ public class FireJet { } if ((Methods.isWater(player.getLocation().getBlock()) || System .currentTimeMillis() > time + duration) - && !AvatarState.isAvatarState(player)) { + && (!AvatarState.isAvatarState(player) || !isToggle)) { // player.setAllowFlight(canfly); instances.remove(player); } else { player.getWorld().playEffect(player.getLocation(), Effect.MOBSPAWNER_FLAMES, 1); double timefactor; - if (AvatarState.isAvatarState(player)) { + if (AvatarState.isAvatarState(player) && isToggle) { timefactor = 1; } else { timefactor = 1 - ((double) (System.currentTimeMillis() - time)) diff --git a/src/config.yml b/src/config.yml index 535c9cbf..7ebbe24d 100644 --- a/src/config.yml +++ b/src/config.yml @@ -99,6 +99,7 @@ Abilities: Enabled: true Description: "Air Shield is one of the most powerful defensive techniques in existence. To use, simply sneak (default: shift). This will create a whirlwind of air around the user, with a small pocket of safe space in the center. This wind will deflect all projectiles and will prevent any creature from entering it for as long as its maintained." Radius: 7 + IsAvatarStateToggle: true AirSpout: Enabled: true Description: "This ability gives the airbender limited sustained levitation. It is a toggle - click to activate and form a whirling spout of air beneath you, lifting you up. You can bend other abilities while using AirSpout. Click again to deactivate this ability." @@ -276,6 +277,7 @@ Abilities: Speed: 0.7 Duration: 1500 Cooldown: 6000 + IsAvatarStateToggle: true FireShield: Enabled: true Description: "FireShield is a basic defensive ability. Clicking with this ability selected will create a small disc of fire in front of you, which will block most attacks and bending. Alternatively, pressing and holding sneak creates a very small shield of fire, blocking most attacks. Creatures that contact this fire are ignited." diff --git a/src/plugin.yml b/src/plugin.yml index 19fe1b94..0877fb37 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: ProjectKorra author: ProjectKorra -version: 1.2.0 BETA 2 +version: 1.2.0 BETA 3 main: com.projectkorra.ProjectKorra.ProjectKorra commands: projectkorra: