Search in sources :

Example 46 with Property

use of net.minecraftforge.common.config.Property in project Railcraft by Railcraft.

the class RailcraftConfig method loadRecipeProperty.

private static void loadRecipeProperty(String subCat, String tag, boolean defaultValue, String comment) {
    Property prop = configMain.get(CAT_RECIPES + "." + subCat, tag, defaultValue);
    decorateComment(prop, tag, comment);
    recipes.put(subCat + "." + tag, prop.getBoolean(defaultValue));
}
Also used : Property(net.minecraftforge.common.config.Property)

Example 47 with Property

use of net.minecraftforge.common.config.Property in project Railcraft by Railcraft.

the class RailcraftConfig method loadBlockProperty.

private static void loadBlockProperty(String tag) {
    cleanOldTags(configBlocks.getCategory(CAT_BLOCKS), tag);
    Property prop = configBlocks.get(CAT_BLOCKS, tag, true);
    enabledBlocks.put(tag, prop.getBoolean(true));
}
Also used : Property(net.minecraftforge.common.config.Property)

Example 48 with Property

use of net.minecraftforge.common.config.Property in project SecurityCraft by Geforce132.

the class ConfigHandler method setupConfiguration.

public void setupConfiguration() {
    SecurityCraft.configFile.load();
    Property dummyProp;
    dummyProp = SecurityCraft.configFile.get("options", "Is codebreaker allowed?", true);
    dummyProp.setLanguageKey("config.isCodebreakerAllowed");
    allowCodebreakerItem = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Is admin tool allowed?", false);
    dummyProp.setLanguageKey("config.allowAdminTool");
    allowAdminTool = dummyProp.getBoolean(false);
    dummyProp = SecurityCraft.configFile.get("options", "Mine(s) spawn fire when detonated?", true);
    dummyProp.setLanguageKey("config.shouldSpawnFire");
    shouldSpawnFire = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Are mines unbreakable?", true);
    dummyProp.setLanguageKey("config.ableToBreakMines");
    ableToBreakMines = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable level 1 keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftKeycard1");
    ableToCraftKeycard1 = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable level 2 keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftKeycard2");
    ableToCraftKeycard2 = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable level 3 keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftKeycard3");
    ableToCraftKeycard3 = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable level 4 keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftKeycard4");
    ableToCraftKeycard4 = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable level 5 keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftKeycard5");
    ableToCraftKeycard5 = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Craftable Limited Use keycard?", true);
    dummyProp.setLanguageKey("config.ableToCraftLUKeycard");
    ableToCraftLUKeycard = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Mines use a smaller explosion?", false);
    dummyProp.setLanguageKey("config.smallerMineExplosion");
    smallerMineExplosion = dummyProp.getBoolean(false);
    dummyProp = SecurityCraft.configFile.get("options", "Mines explode when broken in Creative?", true);
    dummyProp.setLanguageKey("config.mineExplodesWhenInCreative");
    mineExplodesWhenInCreative = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Portable radar search radius:", 25);
    dummyProp.setLanguageKey("config.portableRadarSearchRadius");
    portableRadarSearchRadius = dummyProp.getDouble(25);
    dummyProp = SecurityCraft.configFile.get("options", "Username logger search radius:", 3);
    dummyProp.setLanguageKey("config.usernameLoggerSearchRadius");
    usernameLoggerSearchRadius = dummyProp.getInt(3);
    dummyProp = SecurityCraft.configFile.get("options", "Laser range:", 5);
    dummyProp.setLanguageKey("config.laserBlockRange");
    laserBlockRange = dummyProp.getInt(5);
    dummyProp = SecurityCraft.configFile.get("options", "Delay between alarm sounds (seconds):", 2);
    dummyProp.setLanguageKey("config.alarmTickDelay");
    alarmTickDelay = dummyProp.getInt(2);
    dummyProp = SecurityCraft.configFile.get("options", "Alarm sound volume:", 0.8D);
    dummyProp.setLanguageKey("config.alarmSoundVolume");
    alarmSoundVolume = dummyProp.getDouble(0.8D);
    dummyProp = SecurityCraft.configFile.get("options", "Portable radar delay (seconds):", 4);
    dummyProp.setLanguageKey("config.portableRadarDelay");
    portableRadarDelay = dummyProp.getInt(4);
    dummyProp = SecurityCraft.configFile.get("options", "Claymore range:", 5);
    dummyProp.setLanguageKey("config.claymoreRange");
    claymoreRange = dummyProp.getInt(5);
    dummyProp = SecurityCraft.configFile.get("options", "IMS range:", 12);
    dummyProp.setLanguageKey("config.imsRange");
    imsRange = dummyProp.getInt(12);
    dummyProp = SecurityCraft.configFile.get("options", "Display a 'tip' message at spawn?", true);
    dummyProp.setLanguageKey("config.sayThanksMessage");
    sayThanksMessage = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Is debug mode? (not recommended!)", false);
    dummyProp.setLanguageKey("config.debuggingMode");
    SecurityCraft.debug = dummyProp.getBoolean(false);
    dummyProp = SecurityCraft.configFile.get("options", "Use old keypad recipe (9 buttons)?", false);
    dummyProp.setLanguageKey("config.useOldKeypadRecipe");
    useOldKeypadRecipe = dummyProp.getBoolean(false);
    dummyProp = SecurityCraft.configFile.get("options", "Camera Speed when not using LookingGlass:", 2);
    dummyProp.setLanguageKey("config.cameraSpeed");
    cameraSpeed = dummyProp.getInt(2);
    dummyProp = SecurityCraft.configFile.get("options", "Should check for updates on Github?", true);
    dummyProp.setLanguageKey("config.checkForUpdates");
    checkForUpdates = dummyProp.getBoolean(true);
    dummyProp = SecurityCraft.configFile.get("options", "Inventory Scanner range:", 2);
    dummyProp.setLanguageKey("config.inventoryScannerRange");
    inventoryScannerRange = dummyProp.getInt(2);
    if (SecurityCraft.configFile.hasChanged())
        SecurityCraft.configFile.save();
}
Also used : Property(net.minecraftforge.common.config.Property)

Example 49 with Property

use of net.minecraftforge.common.config.Property in project VanillaTeleporter by dyeo.

the class ModConfiguration method preInit.

public static void preInit() {
    File configFile = new File(Loader.instance().getConfigDir(), TeleporterMod.MODID + ".cfg");
    config = new Configuration(configFile);
    config.setCategoryRequiresMcRestart(Configuration.CATEGORY_GENERAL, true);
    config.load();
    config.addCustomCategoryComment(Configuration.CATEGORY_GENERAL, "Vanilla-Inspired Teleporters Version " + TeleporterMod.VERSION + " Configuration");
    Property propUseDiamonds = config.get(Configuration.CATEGORY_GENERAL, "useDiamonds", useDiamonds, "If false, removes diamonds from the crafting recipe and replaces them with quartz blocks.\nDefault is true");
    Property propNumTeleporters = config.get(Configuration.CATEGORY_GENERAL, "numTeleporters", numTeleporters, "Specifies the number of teleporters created with a single recipe.\nDefault is 1");
    Property propTeleportPassiveMobs = config.get(Configuration.CATEGORY_GENERAL, "teleportPassiveMobs", teleportPassiveMobs, "Specifies whether or not passive mobs can go through teleporters.\nDefault is true");
    Property propTeleportHostileMobs = config.get(Configuration.CATEGORY_GENERAL, "teleportHostileMobs", teleportHostileMobs, "Specifies whether or not hostile mobs can go through teleporters.\nDefault is true");
    config.addCustomCategoryComment(ModConfiguration.CATEGORY_SOUNDS, "See http://minecraft.gamepedia.com/Sounds.json#Sound_events for a list of vanilla sound effects");
    Property propSoundEffectTeleporterEnter = config.get(ModConfiguration.CATEGORY_SOUNDS, "soundEffectTeleporterEnter", soundEffectTeleporterEnter, "Sound effect to play when an entity enters a teleporter.\nDefault is \"" + TeleporterMod.MODID + ":portal_enter\", leave blank for no sound.");
    Property propSoundEffectTeleporterExit = config.get(ModConfiguration.CATEGORY_SOUNDS, "soundEffectTeleporterExit", soundEffectTeleporterExit, "Sound effect to play when an entity exits a teleporter.\nDefault is \"" + TeleporterMod.MODID + ":portal_exit\", leave blank for no sound.");
    Property propSoundEffectTeleporterError = config.get(ModConfiguration.CATEGORY_SOUNDS, "soundEffectTeleporterError", soundEffectTeleporterError, "Sound effect to play when a teleporter cannot be used.\nDefault is \"" + TeleporterMod.MODID + ":portal_error\", leave blank for no sound.");
    List<String> propOrderGeneral = new ArrayList<String>();
    propOrderGeneral.add(propUseDiamonds.getName());
    propOrderGeneral.add(propNumTeleporters.getName());
    propOrderGeneral.add(propTeleportPassiveMobs.getName());
    propOrderGeneral.add(propTeleportHostileMobs.getName());
    config.setCategoryPropertyOrder(Configuration.CATEGORY_GENERAL, propOrderGeneral);
    List<String> propOrderSounds = new ArrayList<String>();
    propOrderSounds.add(propSoundEffectTeleporterEnter.getName());
    propOrderSounds.add(propSoundEffectTeleporterExit.getName());
    propOrderSounds.add(propSoundEffectTeleporterError.getName());
    config.setCategoryPropertyOrder(ModConfiguration.CATEGORY_SOUNDS, propOrderSounds);
    useDiamonds = propUseDiamonds.getBoolean();
    numTeleporters = propNumTeleporters.getInt();
    teleportPassiveMobs = propTeleportPassiveMobs.getBoolean();
    teleportHostileMobs = propTeleportHostileMobs.getBoolean();
    soundEffectTeleporterEnter = propSoundEffectTeleporterEnter.getString();
    soundEffectTeleporterExit = propSoundEffectTeleporterExit.getString();
    soundEffectTeleporterError = propSoundEffectTeleporterError.getString();
    if (config.hasChanged())
        config.save();
}
Also used : Configuration(net.minecraftforge.common.config.Configuration) ArrayList(java.util.ArrayList) File(java.io.File) Property(net.minecraftforge.common.config.Property)

Example 50 with Property

use of net.minecraftforge.common.config.Property in project MorePlanets by SteveKunG.

the class ConfigManagerMP method addGCAddonCompatConfig.

private static ArrayList<String> addGCAddonCompatConfig() {
    ArrayList<String> propOrder = new ArrayList<>();
    Property prop;
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 4 Rocket Schematic", true);
    ConfigManagerMP.enableTier4RocketSchematic = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 5 Rocket Schematic", true);
    ConfigManagerMP.enableTier5RocketSchematic = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 6 Rocket Schematic", true);
    ConfigManagerMP.enableTier6RocketSchematic = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 4 Rocket Recipe", true);
    ConfigManagerMP.enableTier4RocketRecipe = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 5 Rocket Recipe", true);
    ConfigManagerMP.enableTier5RocketRecipe = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    prop = ConfigManagerMP.config.get(ConfigManagerMP.GC_ADDON_COMPAT, "Enable Tier 6 Rocket Recipe", true);
    ConfigManagerMP.enableTier6RocketRecipe = prop.getBoolean();
    prop.setRequiresMcRestart(true);
    propOrder.add(prop.getName());
    return propOrder;
}
Also used : ArrayList(java.util.ArrayList) Property(net.minecraftforge.common.config.Property)

Aggregations

Property (net.minecraftforge.common.config.Property)50 ArrayList (java.util.ArrayList)8 File (java.io.File)2 Configuration (net.minecraftforge.common.config.Configuration)2 AMVector2 (am2.api.math.AMVector2)1 IOException (java.io.IOException)1 Date (java.util.Date)1 IRailcraftModule (mods.railcraft.api.core.IRailcraftModule)1 IVariantEnum (mods.railcraft.api.core.IVariantEnum)1 RailcraftModule (mods.railcraft.api.core.RailcraftModule)1 RailcraftBlocks (mods.railcraft.common.blocks.RailcraftBlocks)1 TrackKits (mods.railcraft.common.blocks.tracks.outfitted.TrackKits)1 RailcraftItems (mods.railcraft.common.items.RailcraftItems)1 ItemMap (mods.railcraft.common.util.collections.ItemMap)1 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)1 ModContainer (net.minecraftforge.fml.common.ModContainer)1