6
6
7
7
namespace VanillaTweaks
8
8
{
9
- public static class Config
10
- {
11
- public static bool GladiatorArmorTweak = true ;
12
- public static bool ObsidianArmorTweak = true ;
13
- public static bool MeteorArmorTweak = true ;
14
- public static bool RainArmorTweak = true ;
15
- public static bool HammerTweaks = true ;
16
- public static bool NightsEdgeAutoswing = true ;
17
- public static bool TrueSwordsAutoswing = true ;
18
- public static bool SwatHelmetTweak = true ;
19
- public static bool SkullTweak = true ;
20
- public static bool FishBowlTweak = true ;
21
- public static bool SandstoneRename = true ;
22
- public static bool CobaltShieldRename = true ;
23
- public static bool BoneBlockFix = true ;
24
- public static bool GoldCritterDropTweak = true ;
25
-
26
- static string ConfigPath = Path . Combine ( Main . SavePath , "Mod Configs" , "Vanilla Tweaks.json" ) ;
27
-
28
- static string OldConfigFolderPath = Path . Combine ( Main . SavePath , "Mod Configs" , "Vanilla Tweaks" ) ;
29
- static string OldConfigPath = Path . Combine ( OldConfigFolderPath , "config.json" ) ;
30
- static string OldConfigVersionPath = Path . Combine ( OldConfigFolderPath , "config.version" ) ;
31
-
32
- static readonly Preferences Configuration = new Preferences ( ConfigPath ) ;
33
-
34
- public static void Load ( )
35
- {
9
+ public static class Config
10
+ {
11
+ public static bool GladiatorArmorTweak = true ;
12
+ public static bool ObsidianArmorTweak = true ;
13
+ public static bool MeteorArmorTweak = true ;
14
+ public static bool RainArmorTweak = true ;
15
+ public static bool HammerTweaks = true ;
16
+ public static bool NightsEdgeAutoswing = true ;
17
+ public static bool TrueSwordsAutoswing = true ;
18
+ public static bool SwatHelmetTweak = true ;
19
+ public static bool SkullTweak = true ;
20
+ public static bool FishBowlTweak = true ;
21
+ public static bool SandstoneRename = true ;
22
+ public static bool CobaltShieldRename = true ;
23
+ public static bool BoneBlockFix = true ;
24
+ public static bool GoldCritterDropTweak = true ;
25
+ public static float ExtractSpeedMultipltier = 5f ;
26
+
27
+ static string ConfigPath = Path . Combine ( Main . SavePath , "Mod Configs" , "Vanilla Tweaks.json" ) ;
28
+
29
+ static string OldConfigFolderPath = Path . Combine ( Main . SavePath , "Mod Configs" , "Vanilla Tweaks" ) ;
30
+ static string OldConfigPath = Path . Combine ( OldConfigFolderPath , "config.json" ) ;
31
+ static string OldConfigVersionPath = Path . Combine ( OldConfigFolderPath , "config.version" ) ;
32
+
33
+ static readonly Preferences Configuration = new Preferences ( ConfigPath ) ;
34
+
35
+ public static void Load ( )
36
+ {
36
37
if ( Directory . Exists ( OldConfigFolderPath ) )
37
38
{
38
39
if ( File . Exists ( OldConfigPath ) )
@@ -53,54 +54,56 @@ public static void Load()
53
54
VanillaTweaks . Log ( "Old config folder still cotains some files/directories. They will not get deleted." ) ;
54
55
}
55
56
}
56
- if ( ! ReadConfig ( ) )
57
- {
58
- VanillaTweaks . Log ( "Failed to read config file! Recreating config..." ) ;
59
- SaveConfig ( ) ;
60
- }
61
- }
62
-
63
- static bool ReadConfig ( )
64
- {
65
- if ( Configuration . Load ( ) )
66
- {
67
- Configuration . Get ( "GladiatorArmorTweak" , ref GladiatorArmorTweak ) ;
68
- Configuration . Get ( "ObsidianArmorTweak" , ref ObsidianArmorTweak ) ;
69
- Configuration . Get ( "MeteorArmorTweak" , ref MeteorArmorTweak ) ;
70
- Configuration . Get ( "HammerTweaks" , ref HammerTweaks ) ;
71
- Configuration . Get ( "NightsEdgeAutoswing" , ref NightsEdgeAutoswing ) ;
72
- Configuration . Get ( "TrueSwordsAutoswing" , ref TrueSwordsAutoswing ) ;
73
- Configuration . Get ( "SwatHelmetTweak" , ref SwatHelmetTweak ) ;
74
- Configuration . Get ( "SkullTweak" , ref SkullTweak ) ;
75
- Configuration . Get ( "FishBowlTweak" , ref FishBowlTweak ) ;
76
- Configuration . Get ( "SandstoneRename" , ref SandstoneRename ) ;
77
- Configuration . Get ( "CobaltShieldRename" , ref CobaltShieldRename ) ;
78
- Configuration . Get ( "BoneBlockFix" , ref BoneBlockFix ) ;
79
- Configuration . Get ( "SwatHelmetTweak" , ref SwatHelmetTweak ) ;
80
- Configuration . Get ( "GoldCritterDropTweak" , ref GoldCritterDropTweak ) ;
81
- return true ;
82
- }
83
- return false ;
84
- }
85
-
86
- static void SaveConfig ( )
87
- {
88
- Configuration . Clear ( ) ;
89
- Configuration . Put ( "GladiatorArmorTweak" , GladiatorArmorTweak ) ;
90
- Configuration . Put ( "ObsidianArmorTweak" , ObsidianArmorTweak ) ;
91
- Configuration . Put ( "MeteorArmorTweak" , MeteorArmorTweak ) ;
92
- Configuration . Put ( "HammerTweaks" , HammerTweaks ) ;
93
- Configuration . Put ( "NightsEdgeAutoswing" , NightsEdgeAutoswing ) ;
94
- Configuration . Put ( "TrueSwordsAutoswing" , TrueSwordsAutoswing ) ;
95
- Configuration . Put ( "SwatHelmetTweak" , SwatHelmetTweak ) ;
96
- Configuration . Put ( "SkullTweak" , SkullTweak ) ;
97
- Configuration . Put ( "FishBowlTweak" , FishBowlTweak ) ;
98
- Configuration . Put ( "SandstoneRename" , SandstoneRename ) ;
99
- Configuration . Put ( "CobaltShieldRename" , CobaltShieldRename ) ;
100
- Configuration . Put ( "BoneBlockFix" , BoneBlockFix ) ;
101
- Configuration . Put ( "SwatHelmetTweak" , SwatHelmetTweak ) ;
102
- Configuration . Put ( "GoldCritterDropTweak" , GoldCritterDropTweak ) ;
103
- Configuration . Save ( ) ;
104
- }
105
- }
57
+ if ( ! ReadConfig ( ) )
58
+ {
59
+ VanillaTweaks . Log ( "Failed to read config file! Recreating config..." ) ;
60
+ }
61
+ SaveConfig ( ) ;
62
+ }
63
+
64
+ static bool ReadConfig ( )
65
+ {
66
+ if ( Configuration . Load ( ) )
67
+ {
68
+ Configuration . Get ( "GladiatorArmorTweak" , ref GladiatorArmorTweak ) ;
69
+ Configuration . Get ( "ObsidianArmorTweak" , ref ObsidianArmorTweak ) ;
70
+ Configuration . Get ( "MeteorArmorTweak" , ref MeteorArmorTweak ) ;
71
+ Configuration . Get ( "HammerTweaks" , ref HammerTweaks ) ;
72
+ Configuration . Get ( "NightsEdgeAutoswing" , ref NightsEdgeAutoswing ) ;
73
+ Configuration . Get ( "TrueSwordsAutoswing" , ref TrueSwordsAutoswing ) ;
74
+ Configuration . Get ( "SwatHelmetTweak" , ref SwatHelmetTweak ) ;
75
+ Configuration . Get ( "SkullTweak" , ref SkullTweak ) ;
76
+ Configuration . Get ( "FishBowlTweak" , ref FishBowlTweak ) ;
77
+ Configuration . Get ( "SandstoneRename" , ref SandstoneRename ) ;
78
+ Configuration . Get ( "CobaltShieldRename" , ref CobaltShieldRename ) ;
79
+ Configuration . Get ( "BoneBlockFix" , ref BoneBlockFix ) ;
80
+ Configuration . Get ( "SwatHelmetTweak" , ref SwatHelmetTweak ) ;
81
+ Configuration . Get ( "GoldCritterDropTweak" , ref GoldCritterDropTweak ) ;
82
+ Configuration . Get ( "ExtractSpeedMulitplier" , ref ExtractSpeedMultipltier ) ;
83
+ return true ;
84
+ }
85
+ return false ;
86
+ }
87
+
88
+ static void SaveConfig ( )
89
+ {
90
+ Configuration . Clear ( ) ;
91
+ Configuration . Put ( "GladiatorArmorTweak" , GladiatorArmorTweak ) ;
92
+ Configuration . Put ( "ObsidianArmorTweak" , ObsidianArmorTweak ) ;
93
+ Configuration . Put ( "MeteorArmorTweak" , MeteorArmorTweak ) ;
94
+ Configuration . Put ( "HammerTweaks" , HammerTweaks ) ;
95
+ Configuration . Put ( "NightsEdgeAutoswing" , NightsEdgeAutoswing ) ;
96
+ Configuration . Put ( "TrueSwordsAutoswing" , TrueSwordsAutoswing ) ;
97
+ Configuration . Put ( "SwatHelmetTweak" , SwatHelmetTweak ) ;
98
+ Configuration . Put ( "SkullTweak" , SkullTweak ) ;
99
+ Configuration . Put ( "FishBowlTweak" , FishBowlTweak ) ;
100
+ Configuration . Put ( "SandstoneRename" , SandstoneRename ) ;
101
+ Configuration . Put ( "CobaltShieldRename" , CobaltShieldRename ) ;
102
+ Configuration . Put ( "BoneBlockFix" , BoneBlockFix ) ;
103
+ Configuration . Put ( "SwatHelmetTweak" , SwatHelmetTweak ) ;
104
+ Configuration . Put ( "GoldCritterDropTweak" , GoldCritterDropTweak ) ;
105
+ Configuration . Put ( "ExtractSpeedMulitplier" , ExtractSpeedMultipltier ) ;
106
+ Configuration . Save ( ) ;
107
+ }
108
+ }
106
109
}
0 commit comments