Advertisement
Cool_boy21

config

May 10th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 11.76 KB | None | 0 0
  1. package me.choco.arrows.utils;
  2.  
  3. import org.bukkit.configuration.file.FileConfiguration;
  4.  
  5. import me.choco.arrows.AlchemicalArrows;
  6.  
  7. /**
  8.  * An easy-access configuration class holding all configured values
  9.  *
  10.  * @author Parker Hawke - 2008Choco
  11.  */
  12. public class ConfigOption {
  13.    
  14.     public static boolean CHECK_FOR_UPDATES;
  15.     public static boolean METRICS_ENABLED;
  16.     public static boolean CUSTOM_DEATH_MESSAGES;
  17.    
  18.     // Skeleton configuration options
  19.     public static int SKELETON_SHOOT_PERCENTAGE;
  20.     public static int SKELETON_LOOT_PERCENTAGE;
  21.    
  22.     // Arrow configuration options
  23.     public static int AIR_CRAFTS;
  24.     public static boolean AIR_ALLOW_INFINITY;
  25.     public static boolean AIR_SKELETONS_CAN_SHOOT;
  26.     public static double AIR_SKELETON_LOOT_WEIGHT;
  27.     public static String AIR_DISPLAY_NAME;
  28.    
  29.     public static int EARTH_CRAFTS;
  30.     public static boolean EARTH_ALLOW_INFINITY;
  31.     public static boolean EARTH_SKELETONS_CAN_SHOOT;
  32.     public static double EARTH_SKELETON_LOOT_WEIGHT;
  33.     public static String EARTH_DISPLAY_NAME;
  34.    
  35.     public static int MAGIC_CRAFTS;
  36.     public static boolean MAGIC_ALLOW_INFINITY;
  37.     public static boolean MAGIC_SKELETONS_CAN_SHOOT;
  38.     public static double MAGIC_SKELETON_LOOT_WEIGHT;
  39.     public static String MAGIC_DISPLAY_NAME;
  40.    
  41.     public static int ENDER_CRAFTS;
  42.     public static boolean ENDER_ALLOW_INFINITY;
  43.     public static boolean ENDER_SKELETONS_CAN_SHOOT;
  44.     public static double ENDER_SKELETON_LOOT_WEIGHT;
  45.     public static String ENDER_DISPLAY_NAME;
  46.    
  47.     public static int LIFE_CRAFTS;
  48.     public static boolean LIFE_ALLOW_INFINITY;
  49.     public static boolean LIFE_SKELETONS_CAN_SHOOT;
  50.     public static double LIFE_SKELETON_LOOT_WEIGHT;
  51.     public static String LIFE_DISPLAY_NAME;
  52.    
  53.     public static int DEATH_CRAFTS;
  54.     public static boolean DEATH_ALLOW_INFINITY;
  55.     public static boolean DEATH_SKELETONS_CAN_SHOOT;
  56.     public static double DEATH_SKELETON_LOOT_WEIGHT;
  57.     public static boolean DEATH_INSTANT_DEATH_POSSIBLE;
  58.     public static int DEATH_INSTANT_DEATH_PERCENT_CHANCE;
  59.     public static String DEATH_DISPLAY_NAME;
  60.    
  61.     public static int LIGHT_CRAFTS;
  62.     public static boolean LIGHT_ALLOW_INFINITY;
  63.     public static boolean LIGHT_SKELETONS_CAN_SHOOT;
  64.     public static double LIGHT_SKELETON_LOOT_WEIGHT;
  65.     public static boolean LIGHT_STRIKES_LIGHTNING;
  66.     public static String LIGHT_DISPLAY_NAME;
  67.    
  68.     public static int DARKNESS_CRAFTS;
  69.     public static boolean DARKNESS_ALLOW_INFINITY;
  70.     public static boolean DARKNESS_SKELETONS_CAN_SHOOT;
  71.     public static double DARKNESS_SKELETON_LOOT_WEIGHT;
  72.     public static String DARKNESS_DISPLAY_NAME;
  73.    
  74.     public static int FIRE_CRAFTS;
  75.     public static boolean FIRE_ALLOW_INFINITY;
  76.     public static boolean FIRE_SKELETONS_CAN_SHOOT;
  77.     public static double FIRE_SKELETON_LOOT_WEIGHT;
  78.     public static String FIRE_DISPLAY_NAME;
  79.    
  80.     public static int FROST_CRAFTS;
  81.     public static boolean FROST_ALLOW_INFINITY;
  82.     public static boolean FROST_SKELETONS_CAN_SHOOT;
  83.     public static double FROST_SKELETON_LOOT_WEIGHT;
  84.     public static String FROST_DISPLAY_NAME;
  85.    
  86.     public static int WATER_CRAFTS;
  87.     public static boolean WATER_ALLOW_INFINITY;
  88.     public static boolean WATER_SKELETONS_CAN_SHOOT;
  89.     public static double WATER_SKELETON_LOOT_WEIGHT;
  90.     public static String WATER_DISPLAY_NAME;
  91.    
  92.     public static int NECROTIC_CRAFTS;
  93.     public static boolean NECROTIC_ALLOW_INFINITY;
  94.     public static boolean NECROTIC_SKELETONS_CAN_SHOOT;
  95.     public static double NECROTIC_SKELETON_LOOT_WEIGHT;
  96.     public static String NECROTIC_DISPLAY_NAME;
  97.    
  98.     public static int CONFUSION_CRAFTS;
  99.     public static boolean CONFUSION_ALLOW_INFINITY;
  100.     public static boolean CONFUSION_SKELETONS_CAN_SHOOT;
  101.     public static double CONFUSION_SKELETON_LOOT_WEIGHT;
  102.     public static String CONFUSION_DISPLAY_NAME;
  103.    
  104.     public static int MAGNETIC_CRAFTS;
  105.     public static boolean MAGNETIC_ALLOW_INFINITY;
  106.     public static boolean MAGNETIC_SKELETONS_CAN_SHOOT;
  107.     public static double MAGNETIC_SKELETON_LOOT_WEIGHT;
  108.     public static String MAGNETIC_DISPLAY_NAME;
  109.    
  110.     public static int GRAPPLE_CRAFTS;
  111.     public static boolean GRAPPLE_ALLOW_INFINITY;
  112.     public static boolean GRAPPLE_SKELETONS_CAN_SHOOT;
  113.     public static double GRAPPLE_SKELETON_LOOT_WEIGHT;
  114.     public static double GRAPPLE_GRAPPLE_FORCE;
  115.     public static String GRAPPLE_DISPLAY_NAME;
  116.    
  117.     /**
  118.      * Load all values from the main configuration file to the fields. All
  119.      * fields are null until this method is invoked at least once.
  120.      *
  121.      * @param plugin - An instance of AlchemicalArrows to retrieve the config file
  122.      */
  123.     public static void loadConfigurationValues(AlchemicalArrows plugin){
  124.         FileConfiguration config = plugin.getConfig();
  125.        
  126.         CHECK_FOR_UPDATES = config.getBoolean("CheckForUpdates", true);
  127.         METRICS_ENABLED = config.getBoolean("MetricsEnabled", true);
  128.         CUSTOM_DEATH_MESSAGES = config.getBoolean("CustomDeathMessages", true);
  129.  
  130.         SKELETON_SHOOT_PERCENTAGE = config.getInt("Skeletons.SkeletonShootPercentage", 10);
  131.         SKELETON_LOOT_PERCENTAGE = config.getInt("Skeletons.SkeletonLootPercentage", 15);
  132.        
  133.         AIR_CRAFTS = config.getInt("Arrows.AirArrow.Crafts", 8);
  134.         AIR_ALLOW_INFINITY = config.getBoolean("Arrows.AirArrow.AllowInfinity", false);
  135.         AIR_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.AirArrow.SkeletonsCanShoot", true);
  136.         AIR_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.AirArrow.SkeletonLootWeight", 6.66);
  137.         AIR_DISPLAY_NAME = config.getString("Arrows.AirArrow.DisplayName", "Air Arrow");
  138.        
  139.         EARTH_CRAFTS = config.getInt("Arrows.EarthArrow.Crafts", 8);
  140.         EARTH_ALLOW_INFINITY = config.getBoolean("Arrows.EarthArrow.AllowInfinity", false);
  141.         EARTH_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.EarthArrow.SkeletonsCanShoot", true);
  142.         EARTH_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.EarthArrow.SkeletonLootWeight", 6.66);
  143.         EARTH_DISPLAY_NAME = config.getString("Arrows.EarthArrow.DisplayName", "Earth Arrow");
  144.        
  145.         MAGIC_CRAFTS = config.getInt("Arrows.MagicArrow.Crafts", 8);
  146.         MAGIC_ALLOW_INFINITY = config.getBoolean("Arrows.MagicArrow.AllowInfinity", false);
  147.         MAGIC_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.MagicArrow.SkeletonsCanShoot", true);
  148.         MAGIC_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.MagicArrow.SkeletonLootWeight", 6.66);
  149.         MAGIC_DISPLAY_NAME = config.getString("Arrows.MagicArrow.DisplayName", "Magic Arrow");
  150.        
  151.         ENDER_CRAFTS = config.getInt("Arrows.EnderArrow.Crafts", 8);
  152.         ENDER_ALLOW_INFINITY = config.getBoolean("Arrows.EnderArrow.AllowInfinity", false);
  153.         ENDER_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.EnderArrow.SkeletonsCanShoot", true);
  154.         ENDER_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.EnderArrow.SkeletonLootWeight", 6.66);
  155.         ENDER_DISPLAY_NAME = config.getString("Arrows.EnderArrow.DisplayName", "Ender Arrow");
  156.        
  157.         LIFE_CRAFTS = config.getInt("Arrows.LifeArrow.Crafts", 8);
  158.         LIFE_ALLOW_INFINITY = config.getBoolean("Arrows.LifeArrow.AllowInfinity", false);
  159.         LIFE_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.LifeArrow.SkeletonsCanShoot", true);
  160.         LIFE_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.LifeArrow.SkeletonLootWeight", 6.66);
  161.         LIFE_DISPLAY_NAME = config.getString("Arrows.LifeArrow.DisplayName", "Life Arrow");
  162.        
  163.         DEATH_CRAFTS = config.getInt("Arrows.DeathArrow.Crafts", 8);
  164.         DEATH_ALLOW_INFINITY = config.getBoolean("Arrows.DeathArrow.AllowInfinity", false);
  165.         DEATH_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.DeathArrow.SkeletonsCanShoot", false);
  166.         DEATH_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.DeathArrow.SkeletonLootWeight", 6.66);
  167.         DEATH_INSTANT_DEATH_POSSIBLE = config.getBoolean("Arrows.DeathArrow.InstantDeathPossible");
  168.         DEATH_INSTANT_DEATH_PERCENT_CHANCE = config.getInt("Arrows.DeathArrow.InstantDeathPercentChance");
  169.         DEATH_DISPLAY_NAME = config.getString("Arrows.DeathArrow.DisplayName", "Death Arrow");
  170.        
  171.         LIGHT_CRAFTS = config.getInt("Arrows.LightArrow.Crafts", 8);
  172.         LIGHT_ALLOW_INFINITY = config.getBoolean("Arrows.LightArrow.AllowInfinity", false);
  173.         LIGHT_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.LightArrow.SkeletonsCanShoot", true);
  174.         LIGHT_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.LightArrow.SkeletonLootWeight", 6.66);
  175.         LIGHT_STRIKES_LIGHTNING = config.getBoolean("Arrows.LightArrow.StrikesLightning");
  176.         LIGHT_DISPLAY_NAME = config.getString("Arrows.LightArrow.DisplayName", "Light Arrow");
  177.        
  178.         DARKNESS_CRAFTS = config.getInt("Arrows.DarknessArrow.Crafts", 8);
  179.         DARKNESS_ALLOW_INFINITY = config.getBoolean("Arrows.DarknessArrow.AllowInfinity", false);
  180.         DARKNESS_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.DarknessArrow.SkeletonsCanShoot", true);
  181.         DARKNESS_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.DarknessArrow.SkeletonLootWeight", 6.66);
  182.         DARKNESS_DISPLAY_NAME = config.getString("Arrows.DarknessArrow.DisplayName", "Darkness Arrow");
  183.        
  184.         FIRE_CRAFTS = config.getInt("Arrows.FireArrow.Crafts", 8);
  185.         FIRE_ALLOW_INFINITY = config.getBoolean("Arrows.FireArrow.AllowInfinity", false);
  186.         FIRE_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.FireArrow.SkeletonsCanShoot", true);
  187.         FIRE_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.FireArrow.SkeletonLootWeight", 6.66);
  188.         FIRE_DISPLAY_NAME = config.getString("Arrows.FireArrow.DisplayName", "Fire Arrow");
  189.        
  190.         FROST_CRAFTS = config.getInt("Arrows.FrostArrow.Crafts", 8);
  191.         FROST_ALLOW_INFINITY = config.getBoolean("Arrows.FrostArrow.AllowInfinity", false);
  192.         FROST_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.FrostArrow.SkeletonsCanShoot", true);
  193.         FROST_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.FrostArrow.SkeletonLootWeight", 6.66);
  194.         FROST_DISPLAY_NAME = config.getString("Arrows.FrostArrow.DisplayName", "Frost Arrow");
  195.        
  196.         WATER_CRAFTS = config.getInt("Arrows.WaterArrow.Crafts", 8);
  197.         WATER_ALLOW_INFINITY = config.getBoolean("Arrows.WaterArrow.AllowInfinity", false);
  198.         WATER_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.WaterArrow.SkeletonsCanShoot", true);
  199.         WATER_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.WaterArrow.SkeletonLootWeight", 6.66);
  200.         WATER_DISPLAY_NAME = config.getString("Arrows.WaterArrow.DisplayName", "Water Arrow");
  201.        
  202.         NECROTIC_CRAFTS = config.getInt("Arrows.NecroticArrow.Crafts", 8);
  203.         NECROTIC_ALLOW_INFINITY = config.getBoolean("Arrows.NecroticArrow.AllowInfinity", false);
  204.         NECROTIC_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.NecroticArrow.SkeletonsCanShoot", true);
  205.         NECROTIC_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.NecroticArrow.SkeletonLootWeight", 6.66);
  206.         NECROTIC_DISPLAY_NAME = config.getString("Arrows.NecroticArrow.DisplayName", "Necrotic Arrow");
  207.        
  208.         CONFUSION_CRAFTS = config.getInt("Arrows.ConfusionArrow.Crafts", 8);
  209.         CONFUSION_ALLOW_INFINITY = config.getBoolean("Arrows.ConfusionArrow.AllowInfinity", false);
  210.         CONFUSION_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.ConfusionArrow.SkeletonsCanShoot", true);
  211.         CONFUSION_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.ConfusionArrow.SkeletonLootWeight", 6.66);
  212.         CONFUSION_DISPLAY_NAME = config.getString("Arrows.ConfusionArrow.DisplayName", "Confusion Arrow");
  213.        
  214.         MAGNETIC_CRAFTS = config.getInt("Arrows.MagneticArrow.Crafts", 8);
  215.         MAGNETIC_ALLOW_INFINITY = config.getBoolean("Arrows.MagneticArrow.AllowInfinity", false);
  216.         MAGNETIC_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.MagneticArrow.SkeletonsCanShoot", true);
  217.         MAGNETIC_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.MagneticArrow.SkeletonLootWeight", 6.66);
  218.         MAGNETIC_DISPLAY_NAME = config.getString("Arrows.MagneticArrow.DisplayName", "Magnetic Arrow");
  219.        
  220.         GRAPPLE_CRAFTS = config.getInt("Arrows.GrappleArrow.Crafts", 8);
  221.         GRAPPLE_ALLOW_INFINITY = config.getBoolean("Arrows.GrappleArrow.AllowInfinity", false);
  222.         GRAPPLE_SKELETONS_CAN_SHOOT = config.getBoolean("Arrows.GrappleArrow.SkeletonsCanShoot", true);
  223.         GRAPPLE_SKELETON_LOOT_WEIGHT = config.getDouble("Arrows.GrappleArrow.SkeletonLootWeight", 6.66);
  224.         GRAPPLE_GRAPPLE_FORCE = config.getDouble("Arrows.GrappleArrow.GrappleForce");
  225.         GRAPPLE_DISPLAY_NAME = config.getString("Arrows.GrappleArrow.DisplayName", "Grapple Arrow");
  226.     }
  227. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement