-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathConfigExperimental.java
More file actions
39 lines (31 loc) · 1.41 KB
/
Copy pathConfigExperimental.java
File metadata and controls
39 lines (31 loc) · 1.41 KB
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
package noppes.npcs.config;
import cpw.mods.fml.common.FMLLog;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.config.Property;
import org.apache.logging.log4j.Level;
import java.io.File;
public class ConfigExperimental {
public static Configuration config;
public final static String CLIENT = "Client";
public final static String SERVER = "Server";
public static Property ModernGuiSystemProperty;
public static boolean ModernGuiSystem = false;
public static Property LegacyDropProperty;
public static boolean LegacyDrop = false;
public static void init(File configFile) {
config = new Configuration(configFile);
try {
config.load();
ModernGuiSystemProperty = config.get(CLIENT, "Experimental Dialog GUI", false, "Enables the new CNPC+ Modern GUI for Dialog and Quest information");
ModernGuiSystem = ModernGuiSystemProperty.getBoolean(false);
LegacyDropProperty = config.get(SERVER, "Use Legacy DropItem for npc", false, "Use Legacy Drop Item for NPCs for compatibility");
LegacyDrop = LegacyDropProperty.getBoolean(false);
} catch (Exception e) {
FMLLog.log(Level.ERROR, e, "CNPC+ has had a problem loading its experimental configuration");
} finally {
if (config.hasChanged()) {
config.save();
}
}
}
}