summaryrefslogtreecommitdiff
path: root/src/main/java/lance5057/tDefense/TD_Config.java
blob: 46f301dca433122c7fcc50c174a430566c82f72d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
package lance5057.tDefense;

import net.minecraftforge.common.config.Configuration;
import scala.Int;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;

public class TD_Config
{
	public boolean	debug;
	public boolean	ArmorAddon;
	public boolean	transparency;
	public boolean	mossEnabled;
	public boolean	mossHard;

	static int		count	= 18;
	public int		AeonsteelMatID;
	public int		QueensGoldMatID;
	public int		DogbeariumMatID;
	public int		RedMintMatID;
	public int		GreenMintMatID;

	public int		SoulBoundID;
	public int		DazeID;
	public int		RainbowID;
	public int		XPBoostID;
	public int		ShearFortuneID;

	public int[]	CrestFeathersID;
	public int[]	CrestMirrorsID;
	public int[]	CrestLegendsID;
	public int[]	CrestBladesID;
	public int[]	CrestGluttonyID;
	public int[]	CrestPitchID;
	public int[]	CrestThornsID;
	public int[]	CrestSanguisugaID;
	public int[]	CrestWindsID;
	public int[]	CrestRetributionID;
	public int[]	CrestLightID;

	//public int		JokeInsultID;
	public int		JokePyrotechID;
	//public int		JokeCompensateID;

	public int		SoulSteveID;

	public int		ArmorProtectionID;
	public int		ArmorFireProtectionID;
	public int		ArmorBlastProtectionID;
	public int		ArmorProjectileProtectionID;
	public int		ArmorFeatherfallID;
	public int		ArmorGlowstepID;
	public int		ArmorFrostwalkerID;
	public int		ArmorFirewalkerID;
	public int		ArmorDepthstriderID;
	public int		ArmorRebreatherID;
	public int		ArmorNightvisionID;
	public int		ArmorAntiBlindnessID;
	public int		ArmorPumpkinID;
	public int		ArmorDodgeID;
	public int		ArmorThornsID;
	public int		ArmorAbsorptionID;
	public int		ArmorJumpboostID;
	public int		ArmorSpeedID;
	public int		ArmorHighstepID;
	public int		ArmorKnockbackResistID;

	public int		MaterialIndex;

	public boolean	MineAndBladeAddon;

	public boolean	BotaniaAddon;
	public int		CorpseIvyModID;
	public int		ManaRepairModID;
	public int		TerraCoreModID;
	public int		ArmorPixieCoreModID;
	public int		ArmorManaDiscountModID;

	public boolean	ThaumcraftAddon;
	public int		RevealingModID;
	public int		VisDiscountModID;
	public int		CapsModID;
	//public int		SpellbindModID;

	public boolean	BloodMagicAddon;
	public int		SuppingModID;
	public int		BloodOathModID;
	public int		ScabbingModID;
	public int		DivinationModID;

	public TD_Config(FMLPreInitializationEvent e)
	{
		final Configuration config = new Configuration(
				e.getSuggestedConfigurationFile());

		config.load();

		debug = config.getBoolean("Should debug mode be enabled?", "Debug Mode", false, null);
		ArmorAddon = config.getBoolean("Should the armor addon be enabled?", "Armor Addon", true, null);
		transparency = config.getBoolean("Should Transparent Textures be enabled?", "General Settings", true, "May help fps if disabled");
		mossEnabled = config.getBoolean("Should the moss recipe be enabled?", "General Settings", true, null);
		mossHard = config.getBoolean("Should the moss recipe be hard?", "General Settings", true, null);

		MaterialIndex = config.getInt("Material Index", "Highest material ID", 206, 30, Int.MaxValue(), "TDefense - 206 MFR - 1001 ExtraTIC - 1024");

		AeonsteelMatID = config.getInt("Aeonsteel Material ID", "Material Configs", 201, 30, Int.MaxValue(), null);
		QueensGoldMatID = config.getInt("QueensGold Material ID", "Material Configs", 202, 30, Int.MaxValue(), null);
		DogbeariumMatID = config.getInt("Dogbearium Material ID", "Material Configs", 203, 30, Int.MaxValue(), null);
		RedMintMatID = config.getInt("RedMint Material ID", "Material Configs", 204, 30, Int.MaxValue(), null);
		GreenMintMatID = config.getInt("GreenMint Material ID", "Material Configs", 205, 30, Int.MaxValue(), null);

		DazeID = config.getInt("Daze ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);
		SoulBoundID = config.getInt("Soulbound ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);
		RainbowID = config.getInt("Rainbow ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);
		XPBoostID = config.getInt("XPBoost ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);
		ShearFortuneID = config.getInt("Fortune for Shears ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);

		CrestFeathersID = ConfigCrest(config, "Feathers");
		CrestMirrorsID = ConfigCrest(config, "Mirrors");
		CrestLegendsID = ConfigCrest(config, "Legends");
		CrestBladesID = ConfigCrest(config, "Blades");
		CrestGluttonyID = ConfigCrest(config, "Gluttony");
		CrestPitchID = ConfigCrest(config, "Pitch");
		CrestThornsID = ConfigCrest(config, "Thorns");
		CrestSanguisugaID = ConfigCrest(config, "Sanguisuga");
		CrestWindsID = ConfigCrest(config, "Winds");
		CrestRetributionID = ConfigCrest(config, "Retribution");
		CrestLightID = ConfigCrest(config, "Light");

		SoulSteveID = config.getInt("Soulstone Steve ID", "Modifier Configs", count++, 18, Int.MaxValue(), null);

		ArmorProtectionID = config.getInt("Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorFireProtectionID = config.getInt("Fire Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorBlastProtectionID = config.getInt("Blast Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorProjectileProtectionID = config.getInt("Projectile Protection ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorFeatherfallID = config.getInt("Featherfall ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorGlowstepID = config.getInt("Glowstep ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorFrostwalkerID = config.getInt("Frostwalker ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorFirewalkerID = config.getInt("Firewalker ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorDepthstriderID = config.getInt("Depthstrider ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorRebreatherID = config.getInt("Rebreather ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorNightvisionID = config.getInt("Nightvision ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorAntiBlindnessID = config.getInt("Anti Blindness ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorPumpkinID = config.getInt("Pumpkin ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorDodgeID = config.getInt("Dodge ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorThornsID = config.getInt("Thorns ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorAbsorptionID = config.getInt("Absorbtion ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorJumpboostID = config.getInt("Jump Boost ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorSpeedID = config.getInt("Speed ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorHighstepID = config.getInt("High Step ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);
		ArmorKnockbackResistID = config.getInt("Knockback Resistance ID", "Armor Modifier Configs", count++, 18, Int.MaxValue(), null);

		MineAndBladeAddon = config.getBoolean("Enable Mine and Blade Addon", "Integration", true, "");

		BotaniaAddon = config.getBoolean("Enable Botania Addon", "Integration", true, "");
		CorpseIvyModID = config.getInt("Corpse Drinker Ivy Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null);
		ManaRepairModID = config.getInt("Mana Repair Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null);
		TerraCoreModID = config.getInt("Terra Core Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null);
		ArmorPixieCoreModID = config.getInt("Elementium Core Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null);
		ArmorManaDiscountModID = config.getInt("Mana Embroidery Modifier ID", "Botania Addon", count++, 18, Int.MaxValue(), null);

		ThaumcraftAddon = config.getBoolean("Enable Thaumcraft Addon", "Integration", true, "Requires Thaumcraft to use");
		RevealingModID = config.getInt("Revealing Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null);
		VisDiscountModID = config.getInt("Vis Discount Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null);
		CapsModID = config.getInt("Cap Repair Modifier ID", "Thaumcraft Addon", count++, 18, Int.MaxValue(), null);
		//SpellbindModID = config.getIntInt("Spellbinding Modifier ID", "Thaumcraft Addon", 73, 0, Integer.MAX_VALUE, "");

		BloodMagicAddon = config.getBoolean("Enable BloodMagic Addon", "Integration", true, "Requires BloodMagic to use");
		DivinationModID = config.getInt("Divination Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null);
		SuppingModID = config.getInt("Supping Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null);
		BloodOathModID = config.getInt("Blood Oath Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null);
		ScabbingModID = config.getInt("Scabbing Modifier ID", "BloodMagic Addon", count++, 18, Int.MaxValue(), null);

		//JokeInsultID = config.getInt("Insult ID", "Joke Modifier Configs", count++, 18, Int.MaxValue(), null);
		JokePyrotechID = config.getInt("Pyrotech ID", "Joke Modifier Configs", count++, 18, Int.MaxValue(), null);

		config.save();
	}

	private int[] ConfigCrest(Configuration config, String name)
	{
		final int[] crest = new int[TinkersDefense.colors.length];

		for(int i = 0; i < TinkersDefense.colors.length; i++)
		{
			crest[i] = config.getInt("Crest of " + name + " (" + TinkersDefense.colors[i] + ") ID", "Shield Modifier Configs", count++, 18, Int.MaxValue(), null);
		}

		return crest;
	}
}