Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.wazup.kitbattle;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.HashMap;
- import java.util.Iterator;
- import java.util.List;
- import org.bukkit.ChatColor;
- import org.bukkit.configuration.ConfigurationSection;
- import org.bukkit.configuration.file.FileConfiguration;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class Config
- {
- private main plugin;
- boolean UUID;
- int StartingCoins;
- boolean DoPlayersDropItemsOnDeath;
- boolean CanPlayersPickItemsOnGround;
- boolean CanPlayersDropItemsOnGround;
- boolean DoPlayersLoseHunger;
- int EarnedCoinsPerKill;
- ArrayList<String> defaultKits;
- ArrayList<Integer> possibleExp;
- ArrayList<String> allowedCommands;
- String ChallengeKit;
- int ChallengeDuration;
- boolean BroadcastRankUp;
- boolean BungeeMode;
- boolean MapShuffle;
- int ShuffleEveryInMinutes;
- ArrayList<Integer> TimeShownBeforeShuffle;
- int HighestTimeShownBeforeShuffle;
- boolean PurchaseableKitsArePermanent;
- boolean ShowRankInChat;
- String RanksPrefix;
- int StartingAmountOfKitUnlockers;
- ArrayList<String> commandsExecutedForChallengeWinner;
- ArrayList<String> commandsExecutedForChallengeLoser;
- boolean SendDeathMessageToEveryone;
- double SpongeBoostUpwards;
- double SpongeFallProtection;
- boolean FallDamageEnabled;
- boolean SendKillstreaksToEveryone;
- boolean useMySQL;
- public Config(main parammain)
- {
- this.plugin = parammain;
- }
- HashMap<Integer, List<String>> Killstreaks = new HashMap();
- int UpdateTopSignsEveryInMinutes;
- int StatsLoadDelay;
- String tableprefix;
- String mysqlhost;
- String mysqlport;
- String mysqldatabase;
- String mysqlusername;
- String mysqlpassword;
- public void loadConfig()
- {
- FileConfiguration localFileConfiguration = this.plugin.getConfig();
- this.UUID = localFileConfiguration.getBoolean("use-UUID");
- this.StartingCoins = localFileConfiguration.getInt("Starting-Coins");
- this.DoPlayersDropItemsOnDeath = localFileConfiguration.getBoolean("Do-Players-Drop-Items-On-Death");
- this.CanPlayersPickItemsOnGround = localFileConfiguration.getBoolean("Can-Players-Pick-Items-On-Ground");
- this.CanPlayersDropItemsOnGround = localFileConfiguration.getBoolean("Can-Players-Drop-Items-On-Ground");
- this.DoPlayersLoseHunger = localFileConfiguration.getBoolean("Do-Players-Lose-Hunger");
- this.EarnedCoinsPerKill = localFileConfiguration.getInt("Earned-Coins-Per-Kill");
- this.defaultKits = new ArrayList();
- this.defaultKits.addAll(localFileConfiguration.getStringList("Default-Kits"));
- this.possibleExp = new ArrayList();
- for (int i = localFileConfiguration.getInt("Minimum-Exp-Per-Kill"); i < localFileConfiguration.getInt("Maximum-Exp-Per-Kill") + 1; i++) {
- this.possibleExp.add(Integer.valueOf(i));
- }
- this.allowedCommands = new ArrayList();
- for (String str1 : localFileConfiguration.getStringList("Allowed-Commands")) {
- this.allowedCommands.add(str1.toLowerCase());
- }
- this.StatsLoadDelay = localFileConfiguration.getInt("Stats-Load-Delay");
- this.ChallengeDuration = localFileConfiguration.getInt("Challenge-Duratiaon");
- this.ChallengeKit = localFileConfiguration.getString("Challenge-Kit").toLowerCase();
- this.BroadcastRankUp = localFileConfiguration.getBoolean("Broadcast-Rank-Up");
- this.BungeeMode = localFileConfiguration.getBoolean("Bungee-Mode");
- this.MapShuffle = localFileConfiguration.getBoolean("Map-Shuffle");
- this.ShuffleEveryInMinutes = localFileConfiguration.getInt("Shuffle-Every-In-Minutes");
- this.TimeShownBeforeShuffle = new ArrayList();
- for (??? = localFileConfiguration.getIntegerList("Time-Shown-Before-Shuffle").iterator(); ???.hasNext();)
- {
- int j = ((Integer)???.next()).intValue();
- this.TimeShownBeforeShuffle.add(Integer.valueOf(j));
- if (j > this.HighestTimeShownBeforeShuffle) {
- this.HighestTimeShownBeforeShuffle = j;
- }
- }
- this.PurchaseableKitsArePermanent = localFileConfiguration.getBoolean("Purchaseable-Kits-Are-Permanent");
- this.ShowRankInChat = localFileConfiguration.getBoolean("Show-Rank-In-Chat");
- this.RanksPrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Ranks-Prefix"));
- this.StartingAmountOfKitUnlockers = localFileConfiguration.getInt("Starting-Amount-Of-Kit-Unlockers");
- this.commandsExecutedForChallengeWinner = new ArrayList(localFileConfiguration.getStringList("Commands-Executed-When-Player-Win-Challenge"));
- this.commandsExecutedForChallengeLoser = new ArrayList(localFileConfiguration.getStringList("Commands-Executed-When-Player-Lose-Challenge"));
- this.SendDeathMessageToEveryone = localFileConfiguration.getBoolean("Send-Death-Message-To-Everyone");
- this.SpongeBoostUpwards = localFileConfiguration.getDouble("Sponge-Boost-Upwards");
- this.SpongeFallProtection = (this.SpongeBoostUpwards * this.SpongeBoostUpwards * 3.0D);
- this.FallDamageEnabled = localFileConfiguration.getBoolean("Fall-Damage-Enabled");
- if (localFileConfiguration.getConfigurationSection("Killstreaks") == null)
- {
- localFileConfiguration.set("Killstreaks.3.Commands-Executed", Arrays.asList(new String[] { "kb coins add %player% 20" }));
- localFileConfiguration.set("Killstreaks.5.Commands-Executed", Arrays.asList(new String[] { "kb coins add %player% 30" }));
- localFileConfiguration.set("Killstreaks.10.Commands-Executed", Arrays.asList(new String[] { "kb coins add %player% 50" }));
- localFileConfiguration.set("Killstreaks.20.Commands-Executed", Arrays.asList(new String[] { "kb coins add %player% 100" }));
- localFileConfiguration.set("Killstreaks.30.Commands-Executed", Arrays.asList(new String[] { "kb coins add %player% 200" }));
- this.plugin.saveConfig();
- }
- if (localFileConfiguration.getBoolean("Killstreaks-Enabled")) {
- for (String str2 : localFileConfiguration.getConfigurationSection("Killstreaks").getKeys(false)) {
- this.Killstreaks.put(Integer.valueOf(str2), localFileConfiguration.getStringList("Killstreaks." + str2 + ".Commands-Executed"));
- }
- }
- this.SendKillstreaksToEveryone = localFileConfiguration.getBoolean("Send-Killstreaks-To-Everyone");
- this.UpdateTopSignsEveryInMinutes = localFileConfiguration.getInt("Update-Top-Signs-Every-In-Minutes");
- this.useMySQL = localFileConfiguration.getBoolean("use-mysql");
- this.tableprefix = localFileConfiguration.getString("table-prefix");
- this.mysqlhost = localFileConfiguration.getString("mysql-host");
- this.mysqlport = localFileConfiguration.getString("mysql-port");
- this.mysqldatabase = localFileConfiguration.getString("mysql-database");
- this.mysqlusername = localFileConfiguration.getString("mysql-username");
- this.mysqlpassword = localFileConfiguration.getString("mysql-password");
- }
- int HadesCooldown = 30;
- int HadesAmountOfDogs = 3;
- int HadesDogsLastFor = 10;
- int ThorCooldown = 10;
- int ThorLightningDamage = 4;
- int ThorStrikeRadius = 5;
- int StomperStompRadius = 5;
- int StomperMaxFallDamage = 4;
- int StomperMaxDamageDealtWhenStompedWhileShifting = 4;
- int SpidermanCooldown = 15;
- int SpidermanWebsLastFor = 200;
- int PrisonerCooldown = 60;
- int PrisonerPrisonLastsFor = 100;
- int ClimberCooldown = 20;
- int ClimberTimeUntilChickenDisappear = 100;
- int DragonCooldown = 30;
- int DragonAmountOfBursts = 3;
- int DragonDamageDealt = 4;
- int DragonFireLastsFor = 100;
- int DragonFireRange = 10;
- int PhantomCooldown = 45;
- int PhantomFlightLastsFor = 5;
- int TimelordCooldown = 45;
- int TimelordFreezeRadius = 7;
- int TimelordFreezeTime = 200;
- int BurrowerCooldown = 60;
- int BurrowerRoomLastsFor = 160;
- int ZenCooldown = 60;
- int ZenMaxRange = 60;
- int ViperPoisonChance = 5;
- PotionEffect poisonEffect = new PotionEffect(PotionEffectType.POISON, 200, 0);
- int MonkCooldown = 45;
- int HulkCooldown = 45;
- int HulkDamageDealt = 10;
- int HulkDamageRadius = 10;
- int RiderCooldown = 45;
- int RiderHorseLastsFor = 200;
- int SummonerCooldown = 70;
- int SummonerGolemLastsFor = 400;
- int SuicidalCooldown = 20;
- public void loadAbilities()
- {
- FileConfiguration localFileConfiguration = this.plugin.fileManager.AbilitiesConfig;
- this.HadesCooldown = localFileConfiguration.getInt("Abilities.Hades.Cooldown");
- this.HadesAmountOfDogs = localFileConfiguration.getInt("Abilities.Hades.Amount-Of-Dogs");
- this.HadesDogsLastFor = (localFileConfiguration.getInt("Abilities.Hades.Dogs-Last-For") * 20);
- this.ThorCooldown = localFileConfiguration.getInt("Abilities.Thor.Cooldown");
- this.ThorLightningDamage = (localFileConfiguration.getInt("Abilities.Thor.Lightning-Damage") * 2);
- this.ThorStrikeRadius = localFileConfiguration.getInt("Abilities.Thor.Strike-Radius");
- this.StomperStompRadius = localFileConfiguration.getInt("Abilities.Stomper.Stomp-Radius");
- this.StomperMaxFallDamage = (localFileConfiguration.getInt("Abilities.Stomper.Max-Fall-Damage") * 2);
- this.StomperMaxDamageDealtWhenStompedWhileShifting = (localFileConfiguration.getInt("Abilities.Stomper.Max-Damage-Dealt-When-Stomped-While-Shifting") * 2);
- this.SpidermanCooldown = localFileConfiguration.getInt("Abilities.Spiderman.Cooldown");
- this.SpidermanWebsLastFor = (localFileConfiguration.getInt("Abilities.Spiderman.Webs-Last-For") * 20);
- this.PrisonerCooldown = localFileConfiguration.getInt("Abilities.Prisoner.Cooldown");
- this.PrisonerPrisonLastsFor = (localFileConfiguration.getInt("Abilities.Prisoner.Prison-Lasts-For") * 20);
- this.ClimberCooldown = localFileConfiguration.getInt("Abilities.Climber.Cooldown");
- this.ClimberTimeUntilChickenDisappear = (localFileConfiguration.getInt("Abilities.Climber.Time-Until-Chicken-Disappear") * 20);
- this.DragonCooldown = localFileConfiguration.getInt("Abilities.Dragon.Cooldown");
- this.DragonAmountOfBursts = localFileConfiguration.getInt("Abilities.Dragon.Amount-Of-Bursts");
- this.DragonDamageDealt = (localFileConfiguration.getInt("Abilities.Dragon.Damage-Dealt") * 2);
- this.DragonFireLastsFor = (localFileConfiguration.getInt("Abilities.Dragon.Fire-Lasts-For") * 20);
- this.DragonFireRange = localFileConfiguration.getInt("Abilities.Dragon.Fire-Range");
- this.PhantomCooldown = localFileConfiguration.getInt("Abilities.Phantom.Cooldown");
- this.PhantomFlightLastsFor = localFileConfiguration.getInt("Abilities.Phantom.Flight-Lasts-For");
- this.TimelordCooldown = localFileConfiguration.getInt("Abilities.Timelord.Cooldown");
- this.TimelordFreezeRadius = localFileConfiguration.getInt("Abilities.Timelord.Freeze-Radius");
- this.TimelordFreezeTime = (localFileConfiguration.getInt("Abilities.Timelord.Freeze-Time") * 20);
- this.BurrowerCooldown = localFileConfiguration.getInt("Abilities.Burrower.Cooldown");
- this.BurrowerRoomLastsFor = (localFileConfiguration.getInt("Abilities.Burrower.Room-Lasts-For") * 20);
- this.ZenCooldown = localFileConfiguration.getInt("Abilities.Zen.Cooldown");
- this.ZenMaxRange = localFileConfiguration.getInt("Abilities.Zen.Max-Range");
- this.ViperPoisonChance = Integer.valueOf(localFileConfiguration.getString("Abilities.Viper.Poison-Chance").replace("%", "")).intValue();
- this.poisonEffect = new PotionEffect(PotionEffectType.POISON, localFileConfiguration.getInt("Abilities.Viper.Poison-Lasts-For") * 20, localFileConfiguration.getInt("Abilities.Viper.Poison-Level") - 1);
- this.MonkCooldown = localFileConfiguration.getInt("Abilities.Monk.Cooldown");
- this.HulkCooldown = localFileConfiguration.getInt("Abilities.Hulk.Cooldown");
- this.HulkDamageDealt = (localFileConfiguration.getInt("Abilities.Hulk.Damage-Dealt") * 2);
- this.HulkDamageRadius = localFileConfiguration.getInt("Abilities.Hulk.Damage-Radius");
- this.RiderCooldown = localFileConfiguration.getInt("Abilities.Rider.Cooldown");
- this.RiderHorseLastsFor = (localFileConfiguration.getInt("Abilities.Rider.Horse-Lasts-For") * 20);
- this.SummonerCooldown = localFileConfiguration.getInt("Abilities.Summoner.Cooldown");
- this.SummonerGolemLastsFor = (localFileConfiguration.getInt("Abilities.Summoner.Golem-Lasts-For") * 20);
- this.SuicidalCooldown = localFileConfiguration.getInt("Abilities.Suicidal.Cooldown");
- }
- String SignsPrefix = ChatColor.DARK_AQUA + "[" + ChatColor.AQUA + "KB" + ChatColor.DARK_AQUA + "]";
- String JoinPrefix = ChatColor.AQUA + "Join";
- String LeavePrefix = ChatColor.AQUA + "Leave";
- String SoupPrefix = ChatColor.AQUA + "Soup";
- String StatsPrefix = ChatColor.AQUA + "Stats";
- ChatColor JoinLine3Color = ChatColor.BLACK;
- public void loadSignPrefixes()
- {
- FileConfiguration localFileConfiguration = this.plugin.fileManager.SignsConfig;
- this.SignsPrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Signs-Prefix"));
- this.JoinPrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Join-Prefix"));
- this.LeavePrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Leave-Prefix"));
- this.SoupPrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Soup-Prefix"));
- this.StatsPrefix = ChatColor.translateAlternateColorCodes('&', localFileConfiguration.getString("Stats-Prefix"));
- this.JoinLine3Color = ChatColor.getByChar(localFileConfiguration.getString("Join-Line-3-Color").replace("&", ""));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement