package net.silentchaos512.scalinghealth.config;

import java.io.File;
import java.util.List;

import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.config.IConfigElement;
import net.silentchaos512.scalinghealth.ScalingHealth;

public class ConfigScalingHealth {

  public static boolean ALLOW_PEACEFUL_EXTRA_HEALTH = true;
  public static boolean ALLOW_HOSTILE_EXTRA_HEALTH = true;
  public static int PLAYER_STARTING_HEALTH = 20;
  public static int PLAYER_HEALTH_MAX = 0;
  public static double DIFFICULTY_MAX = 250;
  public static double DIFFICULTY_DEFAULT = 0;
  public static int HOURS_TO_MAX_DIFFICULTY = 48;
  public static double DIFFICULTY_PER_TICK = DIFFICULTY_MAX / (HOURS_TO_MAX_DIFFICULTY * 72000);
  public static float DIFFICULTY_GENERIC_HEALTH_MULTIPLIER = 0.5F;
  public static float DIFFICULTY_PEACEFUL_HEALTH_MULTIPLIER = 0.25F;
  public static boolean ENABLE_BONUS_HEALTH_REGEN = true;
  public static float BLIGHT_CHANCE_MULTIPLIER = 0.0625F;
  public static float HEART_DROP_CHANCE = 0.01F;
  public static boolean CHANGE_HEART_RENDERING = false; // TODO: Change?
  public static boolean RENDER_DIFFICULTY_METER = true; // TODO: Change?
  public static int PACKET_DELAY = 20;
  public static boolean LOSE_HEALTH_ON_DEATH = true;

  public static int HEARTS_DROPPED_BY_BOSS_MIN = 3;
  public static int HEARTS_DROPPED_BY_BOSS_MAX = 6;

  public static int BLIGHT_AMP_SPEED = 8;
  public static int BLIGHT_AMP_STRENGTH = 2;

  static final String splitter = Configuration.CATEGORY_SPLITTER;
  public static final String CAT_MAIN = "main";

  private static Configuration c;

  public static void init(File file) {

    c = new Configuration(file);
    load();
  }

  public static void load() {

    try {
      // TODO
    } catch (Exception ex) {
      ScalingHealth.logHelper.severe("Could not load configuration file!");
    }
  }

  public static void save() {

    if (c.hasChanged())
      c.save();
  }

  public static ConfigCategory getCategory(String str) {

    return c.getCategory(str);
  }

  public static Configuration getConfiguration() {

    return c;
  }

  public static List<IConfigElement> getConfigElements() {

    return new ConfigElement(getCategory(CAT_MAIN)).getChildElements();
  }
}

@@ -406,16 +406,28 @@
 alth %7B%0A%0A
+  // Client%0A
   public
@@ -446,284 +446,415 @@
 ean 
-ALLOW_PEACEFUL_EXTRA_HEALTH = true;%0A  public static boolean ALLOW_HOSTILE_EXTRA_HEALTH = true;%0A  public static int PLAYER_STARTING_HEALTH = 20;%0A  public static int PLAYER_HEALTH_MAX = 0;%0A  public static double DIFFICULTY_MAX = 250;%0A  public static double DIFFICULTY_DEFAULT
+CHANGE_HEART_RENDERING = false; // TODO: Change?%0A  public static boolean RENDER_DIFFICULTY_METER = true; // TODO: Change?%0A%0A  // Player Health%0A  public static int PLAYER_STARTING_HEALTH = 20;%0A  public static int PLAYER_HEALTH_MAX = 0;%0A  public static boolean LOSE_HEALTH_ON_DEATH = true;%0A  // Regen%0A  public static boolean ENABLE_BONUS_HEALTH_REGEN = true;%0A  public static int BONUS_HEALTH_REGEN_MIN_FOOD
  = 
+1
 0;%0A 
@@ -876,36 +876,100 @@
 int 
-HOURS_TO_MAX_DIFFICULT
+BONUS_HEALTH_REGEN_MAX_FOOD = 20;%0A  public static int BONUS_HEALTH_REGEN_INITIAL_DELA
 Y = 4
-8
+00
 ;%0A  
@@ -986,87 +986,179 @@
 tic 
-double DIFFICULTY_PER_TICK = DIFFICULTY_MAX / (HOURS_TO_MAX_DIFFICULTY * 72000)
+int BONUS_HEALTH_REGEN_DELAY = 100; %0A%0A  // Mob Health%0A  public static boolean ALLOW_PEACEFUL_EXTRA_HEALTH = true;%0A  public static boolean ALLOW_HOSTILE_EXTRA_HEALTH = true
 ;%0A  
@@ -1286,24 +1286,36 @@
 IER = 0.25F;
+%0A%0A  // Items
 %0A  public st
@@ -1323,106 +1323,91 @@
 tic 
-boolean ENABLE_BONUS_HEALTH_REGEN = true;%0A  public static float BLIGHT_CHANCE_MULTIPLIER = 0.0625F
+float HEART_DROP_CHANCE = 0.01F;%0A  public static int HEARTS_DROPPED_BY_BOSS_MIN = 3
 ;%0A  
@@ -1424,384 +1424,516 @@
 tic 
-floa
+in
 t HEART
+S
 _DROP
-_CHANCE = 0.01F;%0A  public static boolean CHANGE_HEART_RENDERING = false; // TODO: Change?%0A  public static boolean RENDER_DIFFICULTY_METER = true; // TODO: Change?%0A  public static int PACKET_DELAY = 20;%0A  public static boolean LOSE_HEALTH_ON_DEATH = true;%0A%0A  public static int HEARTS_DROPPED_BY_BOSS_MIN = 3;%0A  public static int HEARTS_DROPPED_BY_BOSS_MAX = 6;%0A
+PED_BY_BOSS_MAX = 6;%0A%0A  // Difficulty%0A  public static double DIFFICULTY_MAX = 250;%0A  public static double DIFFICULTY_DEFAULT = 0;%0A  public static int HOURS_TO_MAX_DIFFICULTY = 48; // Not actually loaded, just to make calc below clear.%0A  // Difficult Life's DIFFICULTY_PER_TICK... is actually per second -.- Mine is per tick.%0A  public static double DIFFICULTY_PER_TICK = DIFFICULTY_MAX / (HOURS_TO_MAX_DIFFICULTY * 72000);%0A%0A  // Blights%0A  public static float BLIGHT_CHANCE_MULTIPLIER = 0.0625F;
 %0A  p
@@ -2017,16 +2017,69 @@
 H = 2;%0A%0A
+  // Network%0A  public static int PACKET_DELAY = 20;%0A%0A
   static

Reorganize configs