package com.lothrazar.samsmagic;

import net.minecraftforge.common.config.Configuration;

public class ConfigSpells
{ 
	private Configuration instance;
	private String category = "";
	public int deposit;
	public int chesttransp;
	public int ghost;
	public int jump;
	public int phase;
	public int slowfall;
	public int waterwalk;
	public int haste;
	
	public Configuration instance()
	{
		return instance;
	}
	
	public ConfigSpells(Configuration c)
	{
		instance = c; 
		instance.load();
 
		category = ModSpells.MODID;
		instance.addCustomCategoryComment(category, 
				"The number is the EXP cost of the spell.  Set to -1 to disable the spell.   ");
		
		deposit = instance.get(category,"deposit",  5).getInt();
		chesttransp = instance.get(category,"chest_transport", 5).getInt();

		ghost = instance.get(category,"ghost",   50).getInt();

		jump = instance.get(category,"jump",  10).getInt();

		//pearl = instance.get(category,"pearl", 5).getInt();
		phase = instance.get(category,"phase",  5).getInt();
		slowfall = instance.get(category,"slowfall",  15).getInt();
		waterwalk = instance.get(category,"waterwalk",  15).getInt();

		//endereye = instance.get(category,"endereye", 50).getInt();
		haste = instance.get(category,"haste",  20).getInt();
		
		//category = "misc";
		
		//experience_bottle_return = instance.getBoolean("experience_bottle_return",category, true,
		//		"Experience bottles in survival mode return an empty glass bottle to you (if used on a block).");  
	
		category = "effect_ids";

		instance.addCustomCategoryComment(category, 
				"IDs are only exposed to avoid conflicts with other mods.  Messing with these might break the game.   ");
		
		potionIdWaterwalk = instance.get(category,"waterwalk_id", 40).getInt();
		  
		potionIdSlowfall = instance.get(category,"slowfall_id", 41).getInt();
		  
		//potionIdFlying = instance.get(category,"flying_id", 42).getInt();
		
		//potionIdLavawalk = instance.get(category,"lavawalk_id", 43).getInt();
 
		potionIdFrozen = instance.get(category,"frost_id", 43).getInt();
 
		category = "effect_tweaks";
		
		slowfallSpeed = instance.getFloat("slowfall_speed",category, 0.41F,0.1F,1F,
    			"This factor affects how much the slowfall effect slows down the entity.");
 
		//TODO: Spell Configs
		//EntitySnowballBolt.secondsFrozenOnHit = instance.getInt("frost_duration_on_hit",category, 25,1,600,
    	//		"When something hit by one of these snowballs, it gets the snow effect for this many seconds.");
		
		//String csv = instance.getString("spell_piston.ignored",category, "minecraft:cactus,minecraft:piston_head,minecraft:piston_extension,minecraft:lit_furnace,minecraft:melon_stem,minecraft:pumpkin_stem,minecraft:wheat,samscontent:beetroot_crop,wooden_door,minecraft:spruce_door,minecraft:birch_door,minecraft:jungle_door,minecraft:acacia_door,minecraft:dark_oak_door,minecraft:iron_door,minecraft:bedrock,minecraft:tripwire,minecraft:tripwire_hook,minecraft:stone_button,minecraft:wooden_button,minecraft:stone_pressure_plate,minecraft:wooden_pressure_plate,minecraft:heavy_weighted_pressure_plate,minecraft:light_weighted_pressure_plate,minecraft:redstone_wire,minecraft:mob_spawner,minecraft:ladder",
    	//		"List of ignored blocks that will not be moved.");
		//UtilPistonSpell.seIgnoreBlocksFromString(csv);
		
		
		
		if(instance.hasChanged()){ instance.save(); }
 
	}
	
	//public boolean experience_bottle_return;
 
	public int potionIdWaterwalk;
	public int potionIdSlowfall;
	//public int potionIdFlying;
	public float slowfallSpeed; 
	//public int potionIdLavawalk;
	  
	public int potionIdFrozen;  
}

@@ -344,16 +344,109 @@
 aste;%0A%09%0A
+%09public int potionIdWaterwalk;%0A%09public int potionIdSlowfall;%0A%09public float slowfallSpeed; %0A%09%0A
 %09public 
@@ -870,17 +870,16 @@
 tInt();%0A
-%0A
 %09%09ghost 
@@ -927,17 +927,16 @@
 tInt();%0A
-%0A
 %09%09jump =
@@ -984,65 +984,8 @@
 t();
-%0A%0A%09%09//pearl = instance.get(category,%22pearl%22, 5).getInt();
 %0A%09%09p
@@ -1019,24 +1019,25 @@
 y,%22phase%22,  
+2
 5).getInt();
@@ -1170,353 +1170,61 @@
 %0A%0A%09%09
-//endereye = instance.get(category,%22endereye%22, 50).getInt();%0A%09%09haste = instance.get(category,%22haste%22,  20).getInt();%0A%09%09%0A%09%09//category = %22misc%22;%0A%09%09%0A%09%09//experience_bottle_return = instance.getBoolean(%22experience_bottle_return%22,category, true,%0A%09%09//%09%09%22Experience bottles in survival mode return an empty glass bottle to you (if used on a block).%22);  
+haste = instance.get(category,%22haste%22,  20).getInt();
 %0A%09%0A%09
@@ -1566,229 +1566,8 @@
 );%0A%09
-%09  %0A%09%09//potionIdFlying = instance.get(category,%22flying_id%22, 42).getInt();%0A%09%09%0A%09%09//potionIdLavawalk = instance.get(category,%22lavawalk_id%22, 43).getInt();%0A %0A%09%09potionIdFrozen = instance.get(category,%22frost_id%22, 43).getInt();%0A 
 %0A%09%09c
@@ -1763,32 +1763,8 @@
 ;%0A %0A
-%09%09//TODO: Spell Configs%0A
 %09%09//
@@ -1973,1120 +1973,60 @@
 %22);%0A
-%09%09%0A%09%09//String csv = instance.getString(%22spell_piston.ignored%22,category, %22minecraft:cactus,minecraft:piston_head,minecraft:piston_extension,minecraft:lit_furnace,minecraft:melon_stem,minecraft:pumpkin_stem,minecraft:wheat,samscontent:beetroot_crop,wooden_door,minecraft:spruce_door,minecraft:birch_door,minecraft:jungle_door,minecraft:acacia_door,minecraft:dark_oak_door,minecraft:iron_door,minecraft:bedrock,minecraft:tripwire,minecraft:tripwire_hook,minecraft:stone_button,minecraft:wooden_button,minecraft:stone_pressure_plate,minecraft:wooden_pressure_plate,minecraft:heavy_weighted_pressure_plate,minecraft:light_weighted_pressure_plate,minecraft:redstone_wire,minecraft:mob_spawner,minecraft:ladder%22,%0A    %09//%09%09%22List of ignored blocks that will not be moved.%22);%0A%09%09//UtilPistonSpell.seIgnoreBlocksFromString(csv);%0A%09%09%0A%09%09%0A%09%09%0A%09%09if(instance.hasChanged())%7B instance.save(); %7D%0A %0A%09%7D%0A%09%0A%09//public boolean experience_bottle_return;%0A %0A%09public int potionIdWaterwalk;%0A%09public int potionIdSlowfall;%0A%09//public int potionIdFlying;%0A%09public float slowfallSpeed; %0A%09//public int potionIdLavawalk;%0A%09  %0A%09public int potionIdFrozen;  
+%0A%09%09if(instance.hasChanged())%7B instance.save(); %7D%0A %0A%09%7D
 %0A%7D%0A

remove old/deprecated flags from config file