TF-ProjectKorra/src/com/projectkorra/ProjectKorra/ConfigManager.java

259 lines
16 KiB
Java
Raw Normal View History

package com.projectkorra.ProjectKorra;
import java.util.ArrayList;
2014-06-24 22:39:33 +00:00
import org.bukkit.configuration.file.FileConfiguration;
2014-06-25 00:42:24 +00:00
import org.bukkit.entity.Player;
2014-06-24 22:39:33 +00:00
public class ConfigManager {
static ProjectKorra plugin;
2014-06-25 01:36:27 +00:00
public ConfigManager(ProjectKorra plugin) {
ConfigManager.plugin = plugin;
configCheck();
}
2014-06-25 01:36:27 +00:00
public static void configCheck() {
2014-06-25 01:36:27 +00:00
2014-06-24 22:39:33 +00:00
FileConfiguration config = ProjectKorra.plugin.getConfig();
2014-06-25 01:36:27 +00:00
ArrayList<String> earthbendable = new ArrayList<String>();
earthbendable.add("STONE");
earthbendable.add("COAL_ORE");
earthbendable.add("DIAMOND_ORE");
earthbendable.add("DIRT");
earthbendable.add("GOLD_ORE");
earthbendable.add("GRASS");
earthbendable.add("GRAVEL");
earthbendable.add("IRON_ORE");
earthbendable.add("LAPIS_ORE");
earthbendable.add("NETHERRACK");
earthbendable.add("REDSTONE_ORE");
earthbendable.add("SAND");
earthbendable.add("SANDSTONE");
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.GlobalCooldown", 500);
2014-06-13 23:41:52 +00:00
plugin.getConfig().addDefault("Properties.SeaLevel", 62);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.Air.CanBendWithWeapons", false);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.Water.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Water.NightFactor", 1.5);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.Earth.CanBendWithWeapons", true);
plugin.getConfig().addDefault("Properties.Earth.EarthbendableBlocks", earthbendable);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.Fire.CanBendWithWeapons", true);
2014-06-12 23:43:41 +00:00
plugin.getConfig().addDefault("Properties.Fire.DayFactor", 1.5);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Properties.Chi.CanBendWithWeapons", true);
2014-06-25 01:36:27 +00:00
2014-06-24 22:01:55 +00:00
plugin.getConfig().addDefault("Abilities.AvatarState.Enabled", true);
plugin.getConfig().addDefault("Abilities.AvatarState.Description", "The signature ability of the Avatar, this is a toggle. Click to activate to become "
2014-06-25 01:36:27 +00:00
+ "nearly unstoppable. While in the Avatar State, the user takes severely reduced damage from "
+ "all sources, regenerates health rapidly, and is granted extreme speed. Nearly all abilities "
+ "are incredibly amplified in this state. Additionally, AirShield and FireJet become toggle-able "
+ "abilities and last until you deactivate them or the Avatar State. Click again with the Avatar "
+ "State selected to deactivate it.");
2014-06-24 22:01:55 +00:00
plugin.getConfig().addDefault("Abilities.Air.Passive.Factor", 0.3);
plugin.getConfig().addDefault("Abilities.Air.Passive.Speed", 2);
plugin.getConfig().addDefault("Abilities.Air.Passive.Jump", 3);
2014-06-25 01:36:27 +00:00
2014-06-24 22:39:33 +00:00
config.addDefault("Abilities.Air.AirBlast.Enabled", true);
config.addDefault("Abilities.Air.AirBlast.Description", "AirBlast is the most fundamental bending technique of an airbender."
+ " To use, simply left-click in a direction. A gust of wind will be"
+ " created at your fingertips, launching anything in its path harmlessly back."
+ " A gust of air can extinguish fires on the ground or on a player, can cool lava, and "
+ "can flip levers and activate buttons. Additionally, tapping sneak will change the "
+ "origin of your next AirBlast to your targeted location.");
config.addDefault("Abilities.Air.AirBlast.Speed", 25);
config.addDefault("Abilities.Air.AirBlast.Range", 20);
config.addDefault("Abilities.Air.AirBlast.Radius", 2);
config.addDefault("Abilities.Air.AirBlast.Push", 3.5);
2014-06-25 01:36:27 +00:00
2014-06-26 03:01:53 +00:00
config.addDefault("Abilities.Air.AirBubble.Enabled", true);
config.addDefault("Abilities.Air.AirBubble.Description", "To use, the bender must merely have the ability selected. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Air.AirBubble.Radius", 7);
2014-06-26 03:12:42 +00:00
2014-06-25 00:42:24 +00:00
config.addDefault("Abilities.Air.AirBurst.Enabled", true);
config.addDefault("Abilities.Air.AirBurst.Description", "AirBurst is one of the most powerful abilities in the 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 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.");
2014-06-25 01:36:27 +00:00
2014-06-25 01:11:19 +00:00
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 "
+ "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.");
config.addDefault("Abilities.Air.AirScooter.Speed", .675);
2014-06-25 01:36:27 +00:00
2014-06-24 22:39:33 +00:00
plugin.getConfig().addDefault("Abilities.Air.Tornado.Enabled", true);
plugin.getConfig().addDefault("Abilities.Air.Tornado.Description", "To use, simply sneak (default: shift). "
+ "This will create a swirling vortex at the targeted location. "
+ "Any creature or object caught in the vortex will be launched up "
+ "and out in some random direction. If another player gets caught "
+ "in the vortex, the launching effect is minimal. Tornado can "
+ "also be used to transport the user. If the user gets caught in his/her "
+ "own tornado, his movements are much more manageable. Provided the user doesn't "
+ "fall out of the vortex, it will take him to a maximum height and move him in "
+ "the general direction he's looking. Skilled airbenders can scale anything "
+ "with this ability.");
2014-06-25 01:36:27 +00:00
2014-06-25 01:18:44 +00:00
config.addDefault("Abilities.Air.AirSpout.Enabled", true);
config.addDefault("Abilities.Air.AirSpout.Description", "This ability gives the airbender limited sustained levitation. It is a "
+ "toggle - click to activate and form a whirling spout of air "
+ "beneath you, lifting you up. You can bend other abilities while using AirSpout. "
+ "Click again to deactivate this ability.");
config.addDefault("Abilities.Air.AirSpout.Height", 20);
2014-06-25 01:36:27 +00:00
2014-06-24 22:39:33 +00:00
config.addDefault("Abilities.Air.Tornado.Radius", 10);
config.addDefault("Abilities.Air.Tornado.Height", 25);
config.addDefault("Abilities.Air.Tornado.Range", 25);
config.addDefault("Abilities.Air.Tornado.MobPushFactor", 1);
config.addDefault("Abilities.Air.Tornado.PlayerPushFactor", 1);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Abilities.Water.Passive.SwimSpeedFactor", 0.7);
2014-06-25 01:36:27 +00:00
2014-06-25 00:42:24 +00:00
config.addDefault("Abilities.Water.Bloodbending.Enabled", true);
config.addDefault("Abilities.Water.Bloodbending.Description", "This ability was made illegal for a reason. With this ability selected, sneak while "
+ "targetting something and you will bloodbend that target. Bloodbent targets cannot move, "
+ "bend or attack. You are free to control their actions by looking elsewhere - they will "
+ "be forced to move in that direction. Additionally, clicking while bloodbending will "
+ "launch that target off in the direction you're looking. "
+ "People who are capable of bloodbending are immune to your technique, and you are immune to theirs.");
config.addDefault("Abilities.Water.Bloodbending.ThrowFactor", 2);
config.addDefault("Abilities.Water.Bloodbending.Range", 10);
2014-06-25 01:36:27 +00:00
2014-06-26 03:01:53 +00:00
config.addDefault("Abilities.Water.OctopusForm.Enabled", true);
config.addDefault("Abilities.Water.OctopusForm.Description", "This ability allows the waterbender to manipulate a large quantity of water into a form resembling that of an octopus. "
+ "To use, click to select a water source. Then, hold sneak to channel this ability. "
+ "While channeling, the water will form itself around you and has a chance to block incoming attacks. "
+ "Additionally, you can click while channeling to attack things near you, dealing damage and knocking them back. "
+ "Releasing shift at any time will dissipate the form.");
2014-06-26 03:12:42 +00:00
2014-06-25 16:48:05 +00:00
config.addDefault("Abilities.Water.PhaseChange.Enabled", true);
config.addDefault("Abilities.Water.PhaseChange.Description", "To use, simply left-click. "
+ "Any water you are looking at within range will instantly freeze over into solid ice. "
+ "Provided you stay within range of the ice and do not unbind FreezeMelt, "
+ "that ice will not thaw. If, however, you do either of those the ice will instantly thaw. "
+ "If you sneak (default: shift), anything around where you are looking at will instantly melt. "
+ "Since this is a more favorable state for these things, they will never re-freeze unless they "
+ "would otherwise by nature or some other bending ability. Additionally, if you tap sneak while "
+ "targetting water with FreezeMelt, it will evaporate water around that block that is above "
+ "sea level. ");
config.addDefault("Abilities.Water.PhaseChange.Range", 20);
config.addDefault("Abilities.Water.PhaseChange.Radius", 5);
plugin.getConfig().addDefault("Abilities.Water.Plantbending.RegrowTime", 180000);
2014-06-25 01:36:27 +00:00
2014-06-26 03:01:53 +00:00
config.addDefault("Abilities.Water.WaterBubble.Enabled", true);
config.addDefault("Abilities.Water.WaterBubble.Description","To use, the bender must merely have the ability selected. All water around the user in a small bubble will vanish, replacing itself once the user either gets too far away or selects a different ability.");
config.addDefault("Abilities.Water.WaterBubble.Radius", 7);
2014-06-26 03:12:42 +00:00
2014-06-25 01:36:27 +00:00
config.addDefault("Abilities.Water.WaterSpout.Enabled", true);
config.addDefault("Abilities.Water.WaterSpout.Description", "To use this ability, click while over or in water. "
+ "You will spout water up from beneath you to experience controlled levitation. "
+ "This ability is a toggle, so you can activate it then use other abilities and it "
+ "will remain on. If you try to spout over an area with no water, snow or ice, "
+ "the spout will dissipate and you will fall. Click again with this ability selected to deactivate it.");
config.addDefault("Abilities.Water.WaterSpout.Height", 20);
2014-06-25 16:14:46 +00:00
plugin.getConfig().addDefault("Abilities.Earth.Passive.Duration", 2500);
2014-06-25 16:14:46 +00:00
2014-06-25 15:44:02 +00:00
config.addDefault("Abilities.Earth.Catapult.Enabled", true);
config.addDefault("Abilities.Earth.Catapult.Description", "To use, left-click while looking in the direction you want to be launched. "
+ "A pillar of earth will jut up from under you and launch you in that direction - "
+ "if and only if there is enough earth behind where you're looking to launch you. "
+ "Skillful use of this ability takes much time and work, and it does result in the "
+ "death of certain gung-ho earthbenders. If you plan to use this ability, be sure "
+ "you've read about your passive ability you innately have as an earthbender.");
config.addDefault("Abilities.Earth.Catapult.Length", 7);
config.addDefault("Abilities.Earth.Catapult.Speed", 12);
config.addDefault("Abilities.Earth.Catapult.Push", 5);
2014-06-25 01:36:27 +00:00
2014-06-25 16:14:46 +00:00
config.addDefault("Abilities.Earth.Collapse.Enabled", true);
config.addDefault("Abilities.Earth.Collapse.Description", " To use, simply left-click on an earthbendable block. "
+ "That block and the earthbendable blocks above it will be shoved "
+ "back into the earth below them, if they can. "
+ "This ability does have the capacity to trap something inside of it, "
+ "although it is incredibly difficult to do so. "
+ "Additionally, press sneak with this ability to affect an area around your targetted location - "
+ "all earth that can be moved downwards will be moved downwards. "
+ "This ability is especially risky or deadly in caves, depending on the "
+ "earthbender's goal and technique.");
config.addDefault("Abilities.Earth.Collapse.Range", 20);
config.addDefault("Abilities.Earth.Collapse.Radius", 7);
config.addDefault("Abilities.Earth.Collapse.Speed", 8);
2014-06-25 15:58:02 +00:00
config.addDefault("Abilities.Earth.RaiseEarth.Enabled", true);
config.addDefault("Abilities.Earth.RaiseEarth.Description", "To use, simply left-click on an earthbendable block. "
+ "A column of earth will shoot upwards from that location. "
+ "Anything in the way of the column will be brought up with it, "
+ "leaving talented benders the ability to trap brainless entities up there. "
+ "Additionally, simply sneak (default shift) looking at an earthbendable block. "
+ "A wall of earth will shoot upwards from that location. "
+ "Anything in the way of the wall will be brought up with it. ");
config.addDefault("Abilities.Earth.RaiseEarth.Column.Height", 6);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Range", 15);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Height", 6);
config.addDefault("Abilities.Earth.RaiseEarth.Wall.Width", 6);
2014-06-25 16:14:46 +00:00
2014-06-25 01:03:26 +00:00
config.addDefault("Abilities.Fire.FireJet.Enabled", true);
config.addDefault("Abilities.Fire.FireJet.Description", "This ability is used for a limited burst of flight for firebenders. Clicking with this "
+ "ability selected will launch you in the direction you're looking, granting you "
+ "controlled flight for a short time. This ability can be used mid-air to prevent falling "
+ "to your death, but on the ground it can only be used if standing on a block that's "
+ "ignitable (e.g. not snow or water).");
config.addDefault("Abilities.Fire.FireJet.Speed", 0.7);
config.addDefault("Abilities.Fire.FireJet.Duration", 1500);
config.addDefault("Abilities.Fire.FireJet.Cooldown", 6000);
2014-06-25 01:36:27 +00:00
2014-06-25 16:34:45 +00:00
config.addDefault("Abilities.Fire.HeatControl.Enabled", true);
config.addDefault("Abilities.Fire.HeatControl.Description", "While this ability is selected, the firebender becomes impervious "
+ "to fire damage and cannot be ignited. "
+ "If the user left-clicks with this ability, the targeted area will be "
+ "extinguished, although it will leave any creature burning engulfed in flames. "
+ "This ability can also cool lava. If this ability is used while targetting ice or snow, it"
+ " will instead melt blocks in that area. Finally, sneaking with this ability will cook any food in your hand.");
config.addDefault("Abilities.Fire.HeatControl.Extinguish.Range", 20);
config.addDefault("Abilities.Fire.HeatControl.Extinguish.Radius", 7);
config.addDefault("Abilities.Fire.HeatControl.Melt.Range", 15);
config.addDefault("Abilities.Fire.HeatControl.Melt.Radius", 5);
2014-06-26 03:12:42 +00:00
config.addDefault("Abilities.Fire.Illumination.Enabled", true);
config.addDefault("Abilities.Fire.Illumination.Description", "This ability gives firebenders a means of illuminating the area. It is a toggle - clicking "
+ "will create a torch that follows you around. The torch will only appear on objects that are "
+ "ignitable and can hold a torch (e.g. not leaves or ice). If you get too far away from the torch, "
+ "it will disappear, but will reappear when you get on another ignitable block. Clicking again "
+ "dismisses this torch.");
config.addDefault("Abilities.Fire.Illumination.Range", 5);
plugin.getConfig().addDefault("Abilities.Chi.Passive.FallReductionFactor", 0.5);
plugin.getConfig().addDefault("Abilities.Chi.Passive.Speed", 1);
plugin.getConfig().addDefault("Abilities.Chi.Passive.Jump", 2);
2014-06-25 01:36:27 +00:00
2014-06-25 00:53:49 +00:00
config.addDefault("Abilities.Chi.Paralyze.Enabled", true);
config.addDefault("Abilities.Chi.Paralyze.Description", "Paralyzes the target, making them unable to do anything for a short "
+ "period of time. This ability has a long cooldown.");
config.addDefault("Abilities.Chi.Paralyze.Cooldown", 15000);
config.addDefault("Abilities.Chi.Paralyze.Duration", 2000);
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Storage.engine", "sqlite");
2014-06-25 01:36:27 +00:00
plugin.getConfig().addDefault("Storage.MySQL.host", "localhost");
plugin.getConfig().addDefault("Storage.MySQL.port", 3306);
plugin.getConfig().addDefault("Storage.MySQL.pass", "");
plugin.getConfig().addDefault("Storage.MySQL.db", "minecraft");
plugin.getConfig().addDefault("Storage.MySQL.user", "root");
2014-06-25 01:36:27 +00:00
plugin.getConfig().options().copyDefaults(true);
plugin.saveConfig();
}
}