From 6c8ebd3b5d28940e7828bb232d8c21529395283c Mon Sep 17 00:00:00 2001 From: MistPhizzle Date: Tue, 29 Jul 2014 10:32:57 -0400 Subject: [PATCH] Add config options for AirBurst FallThreshold - Amount of blocks to fall to activate. PushFactor - Pretty self explanatory ChargeTime - Time in ms it takes to charge an AirBurst --- src/com/projectkorra/ProjectKorra/ConfigManager.java | 3 +++ .../projectkorra/ProjectKorra/airbending/AirBurst.java | 9 ++++++--- src/config.yml | 3 +++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/com/projectkorra/ProjectKorra/ConfigManager.java b/src/com/projectkorra/ProjectKorra/ConfigManager.java index 5d0f206a..49b88d68 100644 --- a/src/com/projectkorra/ProjectKorra/ConfigManager.java +++ b/src/com/projectkorra/ProjectKorra/ConfigManager.java @@ -127,6 +127,9 @@ public class ConfigManager { + "of air in front of you, or click to release the burst in a sphere around you. " + "Additionally, having this ability selected when you land on the ground from a " + "large enough fall will create a burst of air around you."); + config.addDefault("Abilities.Air.AirBurst.FallThreshold", 10); + config.addDefault("Abilities.Air.AirBurst.PushFactor", 1.5); + config.addDefault("Abilities.Air.AirBurst.ChargeTime", 1750); config.addDefault("Abilities.Air.AirScooter.Enabled", true); config.addDefault("Abilities.Air.AirScooter.Description", "AirScooter is a fast means of transportation. To use, sprint, jump then click with " diff --git a/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java b/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java index f4005c52..d90ebffd 100644 --- a/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java +++ b/src/com/projectkorra/ProjectKorra/airbending/AirBurst.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.concurrent.ConcurrentHashMap; import org.bukkit.Location; +import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.util.Vector; @@ -17,14 +18,16 @@ public class AirBurst { private static ConcurrentHashMap instances = new ConcurrentHashMap(); private static ConcurrentHashMap cooldowns = new ConcurrentHashMap(); - private static double threshold = 10; - private static double pushfactor = 1.5; + static FileConfiguration config = ProjectKorra.plugin.getConfig(); + + private static double threshold = config.getDouble("Abilities.Air.AirBurst.FallThreshold"); + private static double pushfactor = config.getDouble("Abilities.Air.AirBurst.PushFactor"); private static double deltheta = 10; private static double delphi = 10; private Player player; private long starttime; - private long chargetime = 1750; + private long chargetime = config.getLong("Abilities.Air.AirBurst.ChargeTime"); private boolean charged = false; private ArrayList affectedentities = new ArrayList(); diff --git a/src/config.yml b/src/config.yml index 68f424e2..55cadc98 100644 --- a/src/config.yml +++ b/src/config.yml @@ -103,6 +103,9 @@ Abilities: AirBurst: Enabled: true Description: "AirBurst is one of the most powerful abilities in an airbender's arsenal. To use, press and hold sneak to charge your burst. Once charged, you can either release sneak to launch a cone-shaped burst of air in front of you, or click to release theb urst in a sphere around you. Additionally, having this ability selected when you land on the ground from a large enough fall will create a burst of air around you." + FallThreshold: 10 + PushFactor: 1.5 + ChargeTime: 1750 AirScooter: Enabled: true Description: "AirScooter is a fast means of transportation. To use, sprint, jump then click with this ability selected. YOu will hop on a scooter of air and be propelled forward in the direction you're looking (you don't need to press anything). This ability can be used to levitate above liquids, but it cannot go up steep slopes. Any other actions will deactivate this ability."