You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
3.5 KiB
Java
66 lines
3.5 KiB
Java
package com.zivilon.cinder_loe;
|
|
|
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
|
|
|
import java.io.File;
|
|
|
|
import lotr.common.fac.LOTRFaction;
|
|
import net.minecraftforge.common.config.Configuration;
|
|
|
|
public class CinderLoE_Config {
|
|
public static Configuration config;
|
|
public static float enchantment_color_red;
|
|
public static float enchantment_color_green;
|
|
public static float enchantment_color_blue;
|
|
public static String corrupt_faction;
|
|
public static String skeleton_faction;
|
|
|
|
public static boolean objective_lindon;
|
|
public static boolean objective_arnor;
|
|
public static boolean objective_angmar;
|
|
public static boolean objective_durin;
|
|
public static boolean objective_dolguldur;
|
|
public static boolean objective_woodelf;
|
|
public static boolean objective_lothlorien;
|
|
public static boolean objective_dale;
|
|
public static boolean objective_rhudaur;
|
|
|
|
|
|
public static void init(FMLPreInitializationEvent event) {
|
|
File configFile = new File(event.getModConfigurationDirectory(), "CinderLoE.cfg");
|
|
config = new Configuration(configFile);
|
|
syncConfig();
|
|
}
|
|
|
|
public static void syncConfig() {
|
|
try {
|
|
// Load the configuration file
|
|
config.load();
|
|
|
|
// Read properties, define categories and keys
|
|
enchantment_color_red = config.getFloat("EnchantmentColorRed", Configuration.CATEGORY_GENERAL, 0.38f, 0.0f, 1.0f, "Configure red color for enchantments");
|
|
enchantment_color_green = config.getFloat("EnchantmentColorGreen", Configuration.CATEGORY_GENERAL, 0.19f, 0.0f, 1.0f, "Configure green color for enchantments");
|
|
enchantment_color_blue = config.getFloat("EnchantmentColorBlue", Configuration.CATEGORY_GENERAL, 0.608f, 0.0f, 1.0f, "Configure blue color for enchantments");
|
|
|
|
corrupt_faction = config.getString("CorruptFaction", Configuration.CATEGORY_GENERAL, "UTUMNO", "Configure the alignment the Corrupt npcs follow");
|
|
skeleton_faction = config.getString("SkeletonFaction", Configuration.CATEGORY_GENERAL, "UTUMNO", "Configure the alignment the Skeleton npcs follow");
|
|
|
|
objective_lindon = config.getBoolean("Lindon", Configuration.CATEGORY_GENERAL, false, "set true if Lindon Objective Complete");
|
|
objective_arnor = config.getBoolean("Arnor", Configuration.CATEGORY_GENERAL, false,"set true if Arnor Objective Complete");
|
|
objective_angmar = config.getBoolean("Angmar", Configuration.CATEGORY_GENERAL, false, "set true if Angmar Objective Complete");
|
|
objective_durin = config.getBoolean("Durin", Configuration.CATEGORY_GENERAL, false, "set true if Durin Objective Complete");
|
|
objective_dolguldur = config.getBoolean("Dol_Guldur", Configuration.CATEGORY_GENERAL, false,"set true if Dol Guldur Objective Complete");
|
|
objective_woodelf = config.getBoolean("Wood_Elf", Configuration.CATEGORY_GENERAL, false, "set true if Wood Elf Objective Complete");
|
|
objective_lothlorien = config.getBoolean("Lothlorien", Configuration.CATEGORY_GENERAL, false, "set true if Lothlorien Objective Complete");
|
|
objective_dale = config.getBoolean("Dale", Configuration.CATEGORY_GENERAL, false, "set true if Dalish Objective Complete");
|
|
objective_rhudaur = config.getBoolean("Rhudaur", Configuration.CATEGORY_GENERAL, false, "set true if Rhudaur Objective Complete");
|
|
|
|
// Save the configuration if it has changed
|
|
if (config.hasChanged()) {
|
|
config.save();
|
|
}
|
|
} catch (Exception e) {
|
|
}
|
|
}
|
|
}
|