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
|
package gtPlusPlus.preloader.asm;
import cpw.mods.fml.common.FMLLog;
import java.io.File;
import java.util.ArrayList;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import org.apache.logging.log4j.Level;
public class AsmConfig {
public static boolean loaded;
public static Configuration config;
public static boolean enableTiConFluidLighting;
public static boolean enableGtTooltipFix;
public static boolean enableGtNbtFix;
public static boolean enableGtCharcoalPitFix;
public static boolean enableChunkDebugging;
public static boolean enableCofhPatch;
public static boolean enableGcFuelChanges;
public static boolean enableRcFlowFix;
public static int maxRailcraftTankProcessVolume;
public static int maxRailcraftFluidLoaderFlow;
public static int maxRailcraftFluidUnloaderFlow;
public static boolean enableRcItemDupeFix;
public static boolean enableTcAspectSafety;
public static boolean enabledLwjglKeybindingFix;
public static boolean enabledFixEntitySetHealth;
public static boolean disableAllLogging;
public AsmConfig(File file) {
if (!loaded) {
config = new Configuration(file);
syncConfig(true);
}
}
public static void syncConfig(boolean load) {
ArrayList<String> propOrder = new ArrayList<String>();
ArrayList<String> propOrderDebug = new ArrayList<String>();
try {
if (!config.isChild && load) {
config.load();
}
Property prop;
//Debug
prop = config.get("debug", "disableAllLogging", false);
prop.comment = "Disables ALL logging from GT++.";
prop.setLanguageKey("gtpp.disableAllLogging").setRequiresMcRestart(false);
disableAllLogging = prop.getBoolean(false);
propOrderDebug.add(prop.getName());
prop = config.get("debug", "enabledFixEntitySetHealth", false);
prop.comment = "Enable/Disable entity setHealth() fix.";
prop.setLanguageKey("gtpp.enabledFixEntitySetHealth").setRequiresMcRestart(true);
enabledFixEntitySetHealth = prop.getBoolean(false);
propOrderDebug.add(prop.getName());
prop = config.get("debug", "enableChunkDebugging", false);
prop.comment = "Enable/Disable Chunk Debugging Features, Must Be enabled on Client and Server.";
prop.setLanguageKey("gtpp.enableChunkDebugging").setRequiresMcRestart(true);
enableChunkDebugging = prop.getBoolean(false);
propOrderDebug.add(prop.getName());
prop = config.get("debug", "enableGtNbtFix", true);
prop.comment = "Enable/Disable GT NBT Persistency Fix";
prop.setLanguageKey("gtpp.enableGtNbtFix").setRequiresMcRestart(true);
enableGtNbtFix = prop.getBoolean(true);
propOrderDebug.add(prop.getName());
prop = config.get("debug", "enableCofhPatch", false);
prop.comment = "Enable/Disable COFH OreDictionaryArbiter Patch (Useful for Development)";
prop.setLanguageKey("gtpp.enableCofhPatch").setRequiresMcRestart(true);
enableCofhPatch = prop.getBoolean(false);
propOrderDebug.add(prop.getName());
//General Features
prop = config.get("general", "enableTiConFluidLighting", true);
prop.comment = "Enable/Disable Brightness Visuals for Tinkers Fluids, only required on the Client.";
prop.setLanguageKey("gtpp.enableTiConFluidLighting").setRequiresMcRestart(true);
enableTiConFluidLighting = prop.getBoolean(true);
propOrder.add(prop.getName());
prop = config.get("general", "enabledLwjglKeybindingFix", true);
prop.comment = "Prevents the game crashing from having invalid keybinds. https://github.com/alkcorp/GTplusplus/issues/544";
prop.setLanguageKey("gtpp.enabledLwjglKeybindingFix").setRequiresMcRestart(true);
enabledLwjglKeybindingFix = prop.getBoolean(true);
propOrder.add(prop.getName());
prop = config.get("general", "enableGtTooltipFix", true);
prop.comment = "Enable/Disable Custom GT Tooltips";
prop.setLanguageKey("gtpp.enableGtTooltipFix").setRequiresMcRestart(true);
enableGtTooltipFix = prop.getBoolean(true);
propOrder.add(prop.getName());
prop = config.get("general", "enableGtCharcoalPitFix", true);
prop.comment = "Makes the Charcoal Pile Igniter work better.";
prop.setLanguageKey("gtpp.enableGtCharcoalPitFix").setRequiresMcRestart(true);
enableGtCharcoalPitFix = prop.getBoolean(true);
propOrder.add(prop.getName());
prop = config.get("general", "enableGcFuelChanges", true);
prop.comment = "Enable/Disable changes to Galacticraft Rocket Fuels.";
prop.setLanguageKey("gtpp.enableGcFuelChanges").setRequiresMcRestart(true);
//Disabled because Broken
//enableGcFuelChanges = prop.getBoolean(true);
enableGcFuelChanges = false;
propOrder.add(prop.getName());
//Railcraft Tank fix
prop = config.get("general", "enableRcFlowFix", true);
prop.comment = "Allows Custom max IO rates on RC tanks";
prop.setLanguageKey("gtpp.enableRcFlowFix").setRequiresMcRestart(true);
enableRcFlowFix = prop.getBoolean(true);
propOrder.add(prop.getName());
prop = config.get("general", "maxRailcraftTankProcessVolume", 4000);
prop.comment = "Max IO for RC fluid tanks (Not Carts). 'enableRcFlowFix' Must be enabled.";
prop.setLanguageKey("gtpp.maxRailcraftTankProcessVolume").setRequiresMcRestart(true);
maxRailcraftTankProcessVolume = prop.getInt(4000);
propOrder.add(prop.getName());
// Railcraft Loader Max flowrate
prop = config.get("general", "maxRailcraftFluidLoaderFlow", 20);
prop.comment = "Max Output rate for RC Fluid Loaders";
prop.setLanguageKey("gtpp.maxRailcraftFluidLoaderFlow").setRequiresMcRestart(true);
maxRailcraftFluidLoaderFlow = prop.getInt(20);
propOrder.add(prop.getName());
// Railcraft Unloader Max flowrate
prop = config.get("general", "maxRailcraftFluidUnloaderFlow", 80);
prop.comment = "Max Output rate for RC Fluid Unloaders";
prop.setLanguageKey("gtpp.maxRailcraftFluidUnloaderFlow").setRequiresMcRestart(true);
maxRailcraftFluidUnloaderFlow = prop.getInt(80);
propOrder.add(prop.getName());
//Railcraft Dupe Fix
prop = config.get("general", "enableRcItemDupeFix", true);
prop.comment = "Fixes possible negative itemstacks";
prop.setLanguageKey("gtpp.enableRcItemDupeFix").setRequiresMcRestart(true);
enableRcItemDupeFix = prop.getBoolean(true);
propOrder.add(prop.getName());
//TC Aspect Safety
prop = config.get("general", "enableTcAspectSafety", true);
prop.comment = "Fixes small oversights in Thaumcraft 4.";
prop.setLanguageKey("gtpp.enableTcAspectSafety").setRequiresMcRestart(true);
enableTcAspectSafety = prop.getBoolean(true);
propOrder.add(prop.getName());
config.setCategoryPropertyOrder("general", propOrder);
config.setCategoryPropertyOrder("debug", propOrderDebug);
if (config.hasChanged()) {
config.save();
}
FMLLog.log(Level.INFO, "[GT++ ASM] Chunk Debugging - Enabled: "+enableChunkDebugging, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Gt Nbt Fix - Enabled: "+enableGtNbtFix, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] TiCon Fluid Lighting - Enabled: "+enableTiConFluidLighting, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Gt Tooltip Fix - Enabled: "+enableGtTooltipFix, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] COFH Patch - Enabled: "+enableCofhPatch, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Gc Fuel Changes Patch - Enabled: "+enableGcFuelChanges, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Railcraft Fluid Flow Patch - Enabled: "+enableRcFlowFix, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Thaumcraft Aspect Safety Patch - Enabled: "+enableTcAspectSafety, new Object[0]);
FMLLog.log(Level.INFO, "[GT++ ASM] Fix bad usage of EntityLivingBase.setHealth Patch - Enabled: "+enabledFixEntitySetHealth, new Object[0]);
} catch (Exception var3) {
FMLLog.log(Level.ERROR, var3, "GT++ ASM had a problem loading it's config", new Object[0]);
}
}
}
|