use of net.minecraftforge.common.config.Configuration in project VoodooCraft by Mod-DevCafeTeam.
the class VoodooConfig method init.
public static void init(File configFile) {
//Create configuration object from the given configuration file
config = new Configuration(configFile);
/**CUSTOM CATEGORY COMMENTS**/
config.addCustomCategoryComment("Tweaks", "Tweak certian things");
syncConfiguration();
}
use of net.minecraftforge.common.config.Configuration in project OpenModularTurrets by OpenModularTurretsTeam.
the class ConfigHandler method init.
public static void init(File configFile) {
Configuration config = new Configuration(configFile);
config.load();
baseTierOneMaxCharge = config.get("TurretBaseTierOne", "MaxCharge", 500).getInt();
baseTierOneMaxIo = config.get("TurretBaseTierOne", "MaxIo", 50).getInt();
baseTierOneBlastResistance = config.get("TurretBaseTierOne", "BlastResistance", 5).getInt();
baseTierOneHardness = config.get("TurretBaseTierOne", "Hardness", 20).getInt();
baseTierTwoMaxCharge = config.get("TurretBaseTierTwo", "MaxCharge", 50000).getInt();
baseTierTwoMaxIo = config.get("TurretBaseTierTwo", "MaxIo", 100).getInt();
baseTierTwoBlastResistance = config.get("TurretBaseTierTwo", "BlastResistance", 10).getInt();
baseTierTwoHardness = config.get("TurretBaseTierTwo", "Hardness", 30).getInt();
baseTierThreeMaxCharge = config.get("TurretBaseTierThree", "MaxCharge", 150000).getInt();
baseTierThreeMaxIo = config.get("TurretBaseTierThree", "MaxIo", 500).getInt();
baseTierThreeBlastResistance = config.get("TurretBaseTierThree", "BlastResistance", 15).getInt();
baseTierThreeHardness = config.get("TurretBaseTierThree", "Hardness", 40).getInt();
baseTierFourMaxCharge = config.get("TurretBaseTierFour", "MaxCharge", 500000).getInt();
baseTierFourMaxIo = config.get("TurretBaseTierFour", "MaxIo", 1500).getInt();
baseTierFourBlastResistance = config.get("TurretBaseTierFour", "BlastResistance", 20).getInt();
baseTierFourHardness = config.get("TurretBaseTierFour", "Hardness", 50).getInt();
baseTierFiveMaxCharge = config.get("TurretBaseTierFive", "MaxCharge", 10000000).getInt();
baseTierFiveMaxIo = config.get("TurretBaseTierFive", "MaxIo", 5000).getInt();
baseTierFiveBlastResistance = config.get("TurretBaseTierFive", "BlastResistance", 25).getInt();
baseTierFiveHardness = config.get("TurretBaseTierFive", "Hardness", 60).getInt();
disposable_turret = new TurretSetting(config.get("TurretDisposable", "Range", 10, "Turret range, in blocks").getInt(), config.get("TurretDisposable", "FireRateCooldown", 25, "Number of ticks between firings").getInt(), config.get("TurretDisposable", "Damage", 2, "Measured in half-hearts").getInt(), config.get("TurretDisposable", "Accuracy", 50, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretDisposable", "PowerUsage", 2, "RF used per shot").getInt(), config.get("TurretDisposable", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretDisposable", "DamageAmpBonus", 0.05F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
potato_cannon_turret = new TurretSetting(config.get("TurretPotatoCannon", "Range", 15, "Turret range, in blocks").getInt(), config.get("TurretPotatoCannon", "FireRateCooldown", 35, "Number of ticks between firings").getInt(), config.get("TurretPotatoCannon", "Damage", 3, "Measured in half-hearts").getInt(), config.get("TurretPotatoCannon", "Accuracy", 30, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretPotatoCannon", "PowerUsage", 10, "RF used per shot").getInt(), config.get("TurretPotatoCannon", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretPotatoCannon", "DamageAmpBonus", 0.05F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
machine_gun_turret = new TurretSetting(config.get("TurretMachineGun", "Range", 18, "Turret range, in blocks").getInt(), config.get("TurretMachineGun", "FireRateCooldown", 8, "Number of ticks between firings").getInt(), config.get("TurretMachineGun", "Damage", 2, "Measured in half-hearts").getInt(), config.get("TurretMachineGun", "Accuracy", 30, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretMachineGun", "PowerUsage", 100, "RF used per shot").getInt(), config.get("TurretMachineGun", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretMachineGun", "DamageAmpBonus", 0.06F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
incendiary_turret = new TurretSetting(config.get("TurretIncendiary", "Range", 12, "Turret range, in blocks").getInt(), config.get("TurretIncendiary", "FireRateCooldown", 25, "Number of ticks between firings").getInt(), config.get("TurretIncendiary", "Damage", 2, "Measured in half-hearts").getInt(), config.get("TurretIncendiary", "Accuracy", 30, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretIncendiary", "PowerUsage", 250, "RF used per shot").getInt(), config.get("TurretIncendiary", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretIncendiary", "DamageAmpBonus", 0.05F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
grenade_turret = new TurretSetting(config.get("TurretGrenade", "Range", 20, "Turret range, in blocks").getInt(), config.get("TurretGrenade", "FireRateCooldown", 40, "Number of ticks between firings").getInt(), config.get("TurretGrenade", "Damage", 8, "Measured in half-hearts").getInt(), config.get("TurretGrenade", "Accuracy", 30, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretGrenade", "PowerUsage", 3000, "RF used per shot").getInt(), config.get("TurretGrenade", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretGrenade", "DamageAmpBonus", 0.08F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
relativistic_turret = new TurretSetting(config.get("TurretRelativistic", "Range", 20, "Turret range, in blocks").getInt(), config.get("TurretRelativistic", "FireRateCooldown", 100, "Number of ticks between firings").getInt(), config.get("TurretRelativistic", "Damage", 0, "Measured in half-hearts").getInt(), config.get("TurretRelativistic", "Accuracy", 0, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretRelativistic", "PowerUsage", 5000, "RF used per shot").getInt(), config.get("TurretRelativistic", "Enabled", true, "Enabled?").getBoolean(), 0);
rocket_turret = new TurretSetting(config.get("TurretRocket", "Range", 30, "Turret range, in blocks").getInt(), config.get("TurretRocket", "FireRateCooldown", 30, "Number of ticks between firings").getInt(), config.get("TurretRocket", "Damage", 10, "Measured in half-hearts").getInt(), config.get("TurretRocket", "Accuracy", 10, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretRocket", "PowerUsage", 5000, "RF used per shot").getInt(), config.get("TurretRocket", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretRocket", "DamageAmpBonus", 0.08F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
teleporter_turret = new TurretSetting(config.get("TurretTeleporter", "Range", 20, "Turret range, in blocks").getInt(), config.get("TurretTeleporter", "FireRateCooldown", 100, "Number of ticks between firings").getInt(), config.get("TurretTeleporter", "Damage", 0, "Measured in half-hearts").getInt(), config.get("TurretTeleporter", "Accuracy", 0, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretTeleporter", "PowerUsage", 15000, "RF used per shot").getInt(), config.get("TurretTeleporter", "Enabled", true, "Enabled?").getBoolean(), 0);
laser_turret = new TurretSetting(config.get("TurretLaser", "Range", 25, "Turret range, in blocks").getInt(), config.get("TurretLaser", "FireRateCooldown", 10, "Number of ticks between firings").getInt(), config.get("TurretLaser", "Damage", 2, "Measured in half-hearts").getInt(), config.get("TurretLaser", "Accuracy", 10, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretLaser", "PowerUsage", 10000, "RF used per shot").getInt(), config.get("TurretLaser", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretLaser", "DamageAmpBonus", 0.06F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
railgun_turret = new TurretSetting(config.get("TurretRailgun", "Range", 30, "Turret range, in blocks").getInt(), config.get("TurretRailgun", "FireRateCooldown", 100, "Number of ticks between firings").getInt(), config.get("TurretRailgun", "Damage", 25, "Measured in half-hearts").getInt(), config.get("TurretRailgun", "Accuracy", 0, "Value between 0 - 100, where 0 will miss 0% of the time over a distance of 10 blocks, subject to standard deviation.").getDouble(), config.get("TurretRailgun", "PowerUsage", 25000, "RF used per shot").getInt(), config.get("TurretRailgun", "Enabled", true, "Enabled?").getBoolean(), config.get("TurretRailgun", "DamageAmpBonus", 0.10F, "Value of the bonus damage (relative to HP of enemy target) for the turret per damage amp addon.").getDouble());
rangeUpgradeBoost = config.get("upgrades", "range", 2, "Increases range in blocks linearly").getInt();
fireRateUpgradeBoostPercentage = config.get("upgrades", "rateOfFire", 0.1D, "It's a double for some reason, reduces cooldown").getDouble();
accuracyUpgradeBoost = config.get("upgrades", "accuracy", 0.2D, "Increases accuracy linearly").getDouble();
efficiencyUpgradeBoostPercentage = config.get("upgrades", "efficiency", 0.08D, "Reduces power consumption linearly").getDouble();
solarPanelAddonGen = config.get("addons", "solar", 10, "Generates specified RF every tick in sunlight").getInt();
redstoneReactorAddonGen = config.get("addons", "redstone", 1550, "Generates RF from redstone dust/blocks in turret's inventory").getInt();
recyclerNegateChance = config.get("addons", "recycler", 10, "Recycler ammo use negation % chance").getInt();
recyclerAddChance = config.get("addons", "recycler", 5, "Recycler ammo add % chance").getInt();
turretWarningDistance = config.get("miscellaneous", "warningDistance", 5, "Distance outside the max range of a turret players should be warned").getInt();
turretAlarmSound = config.get("miscellaneous", "Enable/Disable turret alarm sound. True=enabled, false=disabled", true).getBoolean();
turretWarnMessage = config.get("miscellaneous", "Should turret warn message be displayed?", true).getBoolean();
turretBreakable = config.get("miscellaneous", "Are turrets/turret bases breakable by anyone?", false).getBoolean();
turretDamageTrustedPlayers = config.get("miscellaneous", "Can turrets damage their trusted players when they accidentally hit them?", true).getBoolean();
canRocketsHome = config.get("miscellaneous", "Can rockets fired by the rocket launcher turret home on targets ?", false).getBoolean();
doTurretsKillsDropMobLoot = config.get("miscellaneous", "Do Mobs killed by turrets drop loot?", true).getBoolean();
useWhitelistForAmmo = config.get("miscellaneous", "whitelistForAmmo", true, "Use Whitelist for ammo slots?").getBoolean();
stringMobBlackList = Arrays.asList(config.getStringList("mobBlackList", "miscellaneous", new String[] { "ArmorStand" }, "Which Entities should not be targetable by turrets? String is the name used by the /summon command."));
stringAmmoAllowList = Arrays.asList(config.getStringList("disposableAmmoList", "miscellaneous", new String[] { "minecraft:cobblestone", "minecraft:planks" }, "Which Items should be usable as disp. ammo (modid:itemname[:meta], if meta is omitted it enables all subitems/blocks)"));
canRocketsHurtEnderDragon = config.get("miscellaneous", "Can rockets fired by the rocket launcher turret hurt the Ender Dragon?", false).getBoolean();
recipes = config.get("miscellaneous", "Which recipes should we do? (auto, enderio, mekanism, vanilla)", "auto").getString();
turretSoundVolume = config.get("miscellaneous", "Turret sound volume percentage (Between 0 - 100)", 40).getInt() / 10;
allowBaseCamo = config.get("miscellaneous", "Should turret bases be camouflage-able with normal blocks?", true).getBoolean();
canRocketsDestroyBlocks = config.get("miscellaneous", "Can rockets destroy normal blocks?", false).getBoolean();
canGrenadesDestroyBlocks = config.get("miscellaneous", "Can grenades destroy normal blocks?", false).getBoolean();
canRailgunDestroyBlocks = config.get("miscellaneous", "Can the railgun destroy normal blocks?", false).getBoolean();
shouldDoThaumcraftIntegration = config.get("ModCompatibility", "Should we enable items that integrate with Thaumcraft?", true).getBoolean();
potentiaToRFRatio = config.get("ModCompatibility", "Potentia Addons' RF conversion ratio per 1 essentia", 500).getInt();
potentiaAddonCapacity = config.get("ModCompatibility", "How much essentia the Potentia Addon can store", 20).getInt();
globalCanTargetPlayers = config.get("GlobalTargetingParameters", "Can turrets attack players?", true).getBoolean();
globalCanTargetNeutrals = config.get("GlobalTargetingParameters", "Can turrets attack neutrals?", true).getBoolean();
globalCanTargetMobs = config.get("GlobalTargetingParameters", "Can turrets attack mobs?", true).getBoolean();
expanderPowerTierOneCapacity = config.get("Expanders", "Power expander tier one capacity", 250).getInt();
expanderPowerTierTwoCapacity = config.get("Expanders", "Power expander tier two capacity", 25000).getInt();
expanderPowerTierThreeCapacity = config.get("Expanders", "Power expander tier three capacity", 75000).getInt();
expanderPowerTierFourCapacity = config.get("Expanders", "Power expander tier four capacity", 250000).getInt();
expanderPowerTierFiveCapacity = config.get("Expanders", "Power expander tier five capacity", 5000000).getInt();
turretTargetSearchTicks = config.get("GlobalTargetingParameters", "If a turret does not have a target, how many ticks should it wait before looking again?", 10).getInt();
if (config.hasChanged()) {
config.save();
}
}
use of net.minecraftforge.common.config.Configuration in project SecurityCraft by Geforce132.
the class mod_SecurityCraft method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
log("Starting to load....");
log("Loading config file....");
log(mod_SecurityCraft.VERSION + " of SecurityCraft is for a post MC-1.6.4 version! Configuration files are useless for setting anything besides options.");
mod_SecurityCraft.configFile = new Configuration(event.getSuggestedConfigurationFile());
this.configHandler.setupConfiguration();
log("Config file loaded.");
log("Setting up handlers!");
this.configHandler.setupHandlers(event);
log("Handlers registered.");
log("Setting up network....");
mod_SecurityCraft.network = NetworkRegistry.INSTANCE.newSimpleChannel(mod_SecurityCraft.MODID);
this.configHandler.setupPackets(mod_SecurityCraft.network);
log("Network setup.");
log("Loading mod additions...");
this.configHandler.setupAdditions();
if (this.debuggingMode) {
this.configHandler.setupDebugAdditions();
}
log("Finished loading mod additions.");
log("Doing registering stuff... (PT 1/2)");
this.configHandler.setupGameRegistry();
ModMetadata modMeta = event.getModMetadata();
modMeta.authorList = Arrays.asList(new String[] { "Geforce" });
modMeta.autogenerated = false;
modMeta.credits = "Thanks to all of you guys for your support!";
modMeta.description = "Adds a load of things to keep your house safe with.\nIf you like this mod, hit the green arrow\nin the corner of the forum thread!\nPlease visit the URL above for help. \n \nMessage of the update: \n" + MOTU;
modMeta.url = "http://geforce.freeforums.org";
}
use of net.minecraftforge.common.config.Configuration in project BetterWithAddons by DaedalusGame.
the class ModConfiguration method preInit.
public void preInit(FMLPreInitializationEvent event) {
configuration = new Configuration(event.getSuggestedConfigurationFile());
configuration.load();
configuration.getCategory("interaction").setComment("Enable or disable mod interactions.");
InteractionBWM.ENABLED = BWM_Enabled.init(configuration);
InteractionBWM.MILL_CLAY = BWM_MillClay.init(configuration);
InteractionBWM.CHORUS_IN_CAULDRON = BWM_ChorusInCauldron.init(configuration);
InteractionBWM.BUTCHER_BLOCKS = BWM_ButcherBlocks.init(configuration);
InteractionQuark.ENABLED = Quark_Enabled.init(configuration);
InteractionQuark.MIDORI_BLOCKS_NEED_CHUNKS = Quark_MidoriBlocksNeedChunks.init(configuration);
configuration.getCategory("addons").setComment("Configure individual addons.");
InteractionBWA.STONEBRICKS_NEED_SMELTING = BWA_StoneBricksNeedSmelting.init(configuration);
InteractionBWA.RADIUS = BWA_LureTreeRadius.init(configuration);
InteractionBWA.MAXCHARGE = BWA_LureTreeTime.init(configuration);
InteractionBWA.MAXFOOD = BWA_LureTreeMaxFood.init(configuration);
InteractionBWA.FOODGLOWSTONE = BWA_LureTreeFoodGlowstone.init(configuration);
InteractionEriottoMod.ENABLED = EriottoMod_Enabled.init(configuration);
InteractionEriottoMod.GRASS_DROPS_SEEDS = EriottoMod_GrassDropsSeeds.init(configuration);
InteractionDecoAddon.ENABLED = DecoAddon_Enabled.init(configuration);
InteractionDecoAddon.WOOD_COLORING = DecoAddon_WoodColoring.init(configuration);
InteractionDecoAddon.ALTERNATE_WROUGHT_BARS = DecoAddon_AlternateWroughtBars.init(configuration);
InteractionDecoAddon.CHISEL_BRICKS_IN_ANVIL = DecoAddon_ChiselBricksInAnvil.init(configuration);
InteractionDecoAddon.GLASS_PANE_REBALANCE = DecoAddon_GlassPaneRebalance.init(configuration);
InteractionDecoAddon.GLASS_FURNACE = DecoAddon_GlassFurnace.init(configuration);
InteractionDecoAddon.CHEAPER_BOTTLES = DecoAddon_CheaperBottles.init(configuration);
InteractionDecoAddon.RECYCLE_BOTTLES = DecoAddon_RecycleBottles.init(configuration);
InteractionCondensedOutputs.ENABLED = CondensedOutputs_Enabled.init(configuration);
InteractionCondensedOutputs.LOSE_BINDER = CondensedOutputs_LoseBinder.init(configuration);
InteractionBTWTweak.ENABLED = BTWTweak_Enabled.init(configuration);
//InteractionBTWTweak.KILN_DOUBLING = BTWTweak_KilnDoubling.init(configuration);
InteractionBTWTweak.SOFT_WOODS = BTWTweak_SoftWoods.init(configuration);
InteractionBTWTweak.HARD_STUMPS = BTWTweak_HardStumps.init(configuration);
InteractionBTWTweak.SAW_RECYCLING = BTWTweak_SawRecycling.init(configuration);
InteractionBTWTweak.EGG_INCUBATION = BTWTweak_EggIncubation.init(configuration);
if (configuration.hasChanged()) {
configuration.save();
}
}
use of net.minecraftforge.common.config.Configuration in project RecurrentComplex by Ivorforce.
the class RecurrentComplex method preInit.
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = event.getModLog();
config = new Configuration(event.getSuggestedConfigurationFile());
config.load();
RCConfig.loadConfig(null);
config.save();
// After loading config, re-test vanilla acceptance, because of lightweight mode
NetworkRegistry.INSTANCE.registry().get(Loader.instance().getIndexedModList().get(MOD_ID)).testVanillaAcceptance();
logger.trace(isLite() ? "Entering lightweight mode!" : "Entering default mode!");
loader = new FileLoader();
saver = new FileSaver();
remapper = new FMLRemapper();
specialRegistry = new MCRegistrySpecial(mcRegistry = new MCRegistryRemapping(new MCRegistryDefault(), remapper), remapper);
cremapper = new FMLRemapperConvenience(MOD_ID, specialRegistry, remapper);
missingRemapper = new FMLMissingRemapper(new MCRegistryDefault(), remapper);
forgeEventHandler = new RCForgeEventHandler();
forgeEventHandler.register();
terrainEventHandler = new RCTerrainGenEventHandler();
terrainEventHandler.register();
recurrentComplexEventHandler = new RCRecurrentComplexEventHandler();
recurrentComplexEventHandler.register();
guiHandler = new RCGuiHandler();
IvGuiRegistry.INSTANCE.register(MOD_ID, guiHandler);
communicationHandler = new RCCommunicationHandler(logger, MOD_ID, instance);
RCRegistryHandler.preInit(event, this);
proxy.preInit(event);
}
Aggregations