summaryrefslogtreecommitdiff
path: root/YWD/src/main/java/fyresmodjam/misc/ConfigData.java
blob: 0d7a3281e8e16153e95b6b3ec287c6ff8c37358c (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
package fyresmodjam.misc;

import org.lwjgl.input.Keyboard;

import net.minecraftforge.common.config.Configuration;

public class ConfigData {
	/*
	 * Starting ID for achievements
	 */
	public static int achievementID = 2500;

	/*
	 * Keybindings
	 */
	public static int	examineKey	= Keyboard.KEY_X;
	public static int	blessingKey	= Keyboard.KEY_K;

	/*
	 * World generation settings
	 */
	// Pillars
	public static int	pillarGenChance		= 75;
	public static int	maxPillarsPerChunk	= 3;
	public static boolean	spawnRandomPillars	= true;
	// Towers
	public static int	towerGenChance	= 225;
	public static boolean	spawnTowers	= true;
	// Traps
	public static int	trapGenChance		= 300;
	public static boolean	spawnTraps		= true;
	public static boolean	trapsBelowGroundOnly	= false;
	// Mushrooms
	public static int mushroomReplaceChance = 15;

	/*
	 * Statistic tracking
	 */
	public static boolean	enableWeaponKillStats	= true;
	public static boolean	enableMobKillStats	= true;
	public static boolean	enableCraftingStats	= true;

	/*
	 * Blessing/Mark parameters
	 */
	public static final double RETALIATION_CHANCE = 0.05;

	/*
	 * Misc. Toggles
	 */
	public static boolean	pillarGlow			= true;
	public static boolean	disableDisadvantages		= false;
	public static boolean	versionChecking			= true;
	public static boolean	showAllPillarsInCreative	= false;
	public static void loadFromConfig(Configuration config) {
		pillarGlow = config
				.get(Configuration.CATEGORY_GENERAL,
						"pillar_glow",
						pillarGlow)
				.getBoolean(pillarGlow);
	
		pillarGenChance = config
				.get(Configuration.CATEGORY_GENERAL,
						"pillar_gen_difficulty",
						pillarGenChance)
				.getInt();
		maxPillarsPerChunk = config.get(
				Configuration.CATEGORY_GENERAL,
				"max_pillars_per_chunk",
				maxPillarsPerChunk).getInt();
		towerGenChance = config
				.get(Configuration.CATEGORY_GENERAL,
						"tower_gen_difficulty",
						towerGenChance)
				.getInt();
		trapGenChance = config
				.get(Configuration.CATEGORY_GENERAL,
						"trap_gen_difficulty",
						trapGenChance)
				.getInt();
		mushroomReplaceChance = config.get(
				Configuration.CATEGORY_GENERAL,
				"mushroom_replace_difficulty",
				mushroomReplaceChance).getInt();
	
		spawnTraps = !(config
				.get(Configuration.CATEGORY_GENERAL,
						"disable_traps",
						!spawnTraps)
				.getBoolean(!spawnTraps));
		spawnTowers = config
				.get(Configuration.CATEGORY_GENERAL,
						"spawn_towers",
						spawnTowers)
				.getBoolean(spawnTowers);
		spawnRandomPillars = config.get(
				Configuration.CATEGORY_GENERAL,
				"spawn_random_pillars",
				spawnRandomPillars)
				.getBoolean(spawnRandomPillars);
		disableDisadvantages = config.get(
				Configuration.CATEGORY_GENERAL,
				"disable_disadvantages",
				disableDisadvantages)
				.getBoolean(disableDisadvantages);
		versionChecking = config
				.get(Configuration.CATEGORY_GENERAL,
						"version_checking",
						versionChecking)
				.getBoolean(versionChecking);
	
		showAllPillarsInCreative = config.get(
				Configuration.CATEGORY_GENERAL,
				"show_all_pillars_in_creative",
				showAllPillarsInCreative)
				.getBoolean(showAllPillarsInCreative);
	
		enableMobKillStats = config.get(
				Configuration.CATEGORY_GENERAL,
				"enable_mob_kill_stats",
				enableMobKillStats)
				.getBoolean(enableMobKillStats);
		enableWeaponKillStats = config.get(
				Configuration.CATEGORY_GENERAL,
				"enable_weapon_kill_stats",
				enableWeaponKillStats)
				.getBoolean(enableWeaponKillStats);
		enableCraftingStats = config.get(
				Configuration.CATEGORY_GENERAL,
				"enable_crafting_stats",
				enableCraftingStats)
				.getBoolean(enableCraftingStats);
	
		trapsBelowGroundOnly = config.get(
				Configuration.CATEGORY_GENERAL,
				"traps_below_ground_only",
				trapsBelowGroundOnly)
				.getBoolean(trapsBelowGroundOnly);
	}
}