Advertisement
Guest User

Untitled

a guest
May 13th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.12 KB | None | 0 0
  1. public class Config
  2. {
  3.  
  4.     private static final String ANTI_LAG_BOOLEAN = "settings.antilag";
  5.  
  6.     private static final String DATABASE_HOST = "database.hostname";
  7.  
  8.     private static final String DATABASE_PORT = "database.port";
  9.  
  10.     private static final String DATABASE_DB = "database.db";
  11.  
  12.     private static final String DATABASE_USERNAME = "database.username";
  13.  
  14.     private static final String DATABASE_PASSWORD = "database.password";
  15.  
  16.     private static final String ARROW_COST_FLAME = "arrow.flame";
  17.     private static final String ARROW_COST_SNOW = "arrow.snow";
  18.     private static final String ARROW_COST_LOVE = "arrow.love";
  19.     private static final String ARROW_COST_ANGRY = "arrow.angry";
  20.     private static final String ARROW_COST_musical = "arrow.musical";
  21.     private static final String ARROW_COST_magic = "arrow.magic";
  22.     private static final String ARROW_COST_sticky = "arrow.sticky";
  23.  
  24.     private static final String PARTICLE_COST_PHENIX = "particle.phenix";
  25.     private static final String PARTICLE_COST_ESKIMO = "particle.Eskimo";
  26.     private static final String PARTICLE_COST_BLAZING = "particle.blazing";
  27.     private static final String PARTICLE_COST_FLARE = "particle.flare";
  28.     private static final String PARTICLE_COST_CHAMPION = "particle.champion";
  29.     private static final String PARTICLE_COST_ARMAGEDDON = "particle.armageddon";
  30.  
  31.     private File configFile;
  32.     private FileConfiguration config;
  33.  
  34.     public void onEnable ()
  35.     {
  36.         configFile = new File(NobleCore.getInstance().getDataFolder(), "mainConfig.yml");
  37.         if (!configFile.exists())
  38.         {
  39.             configFile.getParentFile().mkdirs();
  40.             FileUtils.copy(NobleCore.getInstance().getResource("mainConfig.yml"), configFile);
  41.         }
  42.  
  43.         config = new YamlConfiguration();
  44.  
  45.         try
  46.         {
  47.             config.load(configFile);
  48.         }
  49.         catch (FileNotFoundException e)
  50.         {
  51.             e.printStackTrace();
  52.         }
  53.         catch (IOException e)
  54.         {
  55.             e.printStackTrace();
  56.         }
  57.         catch (InvalidConfigurationException e)
  58.         {
  59.             e.printStackTrace();
  60.         }
  61.     }
  62.  
  63.     public void onDisable ()
  64.     {
  65.  
  66.     }
  67.  
  68.     public String getDBHostName ()
  69.     {
  70.         return config.getString(DATABASE_HOST);
  71.     }
  72.  
  73.     public String getDBDatabase ()
  74.     {
  75.         return config.getString(DATABASE_DB);
  76.     }
  77.  
  78.     public String getDBPort ()
  79.     {
  80.         return config.getString(DATABASE_PORT);
  81.     }
  82.  
  83.     public String getDBUsername ()
  84.     {
  85.         return config.getString(DATABASE_USERNAME);
  86.     }
  87.  
  88.     public String getDBPassword ()
  89.     {
  90.         return config.getString(DATABASE_PASSWORD);
  91.     }
  92.  
  93.     public int getArrowFlameCost ()
  94.     {
  95.         return config.getInt(ARROW_COST_FLAME);
  96.     }
  97.  
  98.     public int getArrowSnowCost ()
  99.     {
  100.         return config.getInt(ARROW_COST_SNOW);
  101.     }
  102.  
  103.     public int getArrowLoveCost ()
  104.     {
  105.         return config.getInt(ARROW_COST_LOVE);
  106.     }
  107.  
  108.     public int getArrowAngryCost ()
  109.     {
  110.         return config.getInt(ARROW_COST_ANGRY);
  111.     }
  112.  
  113.     public int getArrowMusicalCost ()
  114.     {
  115.         return config.getInt(ARROW_COST_musical);
  116.     }
  117.  
  118.     public int getArrowMagicCost ()
  119.     {
  120.         return config.getInt(ARROW_COST_magic);
  121.     }
  122.  
  123.     public int getArrowStickyCost ()
  124.     {
  125.         return config.getInt(ARROW_COST_sticky);
  126.     }
  127.  
  128.     public int getPhenixCost ()
  129.     {
  130.         return config.getInt(PARTICLE_COST_PHENIX);
  131.     }
  132.  
  133.     public int getEskimoCost ()
  134.     {
  135.         return config.getInt(PARTICLE_COST_ESKIMO);
  136.     }
  137.  
  138.     public int getBlazingCost ()
  139.     {
  140.         return config.getInt(PARTICLE_COST_BLAZING);
  141.     }
  142.  
  143.     public int getFlareCost ()
  144.     {
  145.         return config.getInt(PARTICLE_COST_FLARE);
  146.     }
  147.  
  148.     public int getChampionCost ()
  149.     {
  150.         return config.getInt(PARTICLE_COST_CHAMPION);
  151.     }
  152.  
  153.     public int getArmageddonCost ()
  154.     {
  155.         return config.getInt(PARTICLE_COST_ARMAGEDDON);
  156.     }
  157.  
  158.     public boolean getAntiLagBoolean ()
  159.     {
  160.         return config.getBoolean(ANTI_LAG_BOOLEAN);
  161.     }
  162. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement