Search in sources :

Example 6 with Property

use of forestry.core.config.Property in project ForestryMC by ForestryMC.

the class PluginStorage method postInit.

@Override
public void postInit() {
    scanForItems();
    config = new Configuration();
    Property backpackConf = config.get("backpacks.miner.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add additional blocks and items for the miner's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("miner"));
    backpackConf = config.get("backpacks.digger.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add additional blocks and items for the digger's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("digger"));
    backpackConf = config.get("backpacks.forester.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add additional blocks and items for the forester's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("forester"));
    backpackConf = config.get("backpacks.hunter.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add additional blocks and items for the hunter's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("hunter"));
    backpackConf = config.get("backpacks.adventurer.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add blocks and items for the adventurer's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("adventurer"));
    backpackConf = config.get("backpacks.builder.items", CONFIG_CATEGORY, "");
    backpackConf.comment = "add blocks and items for the builder's backpack here in the format modid:name:meta. separate blocks and items using ';'. wildcard for metadata: '*'";
    parseBackpackItems(backpackConf.value, BackpackManager.definitions.get("builder"));
    config.save();
    BackpackManager.definitions.get("miner").addValidItems(minerItems);
    BackpackManager.definitions.get("digger").addValidItems(diggerItems);
    BackpackManager.definitions.get("forester").addValidItems(foresterItems);
    BackpackManager.definitions.get("hunter").addValidItems(hunterItems);
    BackpackManager.definitions.get("adventurer").addValidItems(adventurerItems);
    BackpackManager.definitions.get("builder").addValidItems(builderItems);
}
Also used : Configuration(forestry.core.config.Configuration) Property(forestry.core.config.Property)

Example 7 with Property

use of forestry.core.config.Property in project ForestryMC by ForestryMC.

the class PluginApiculture method doInit.

@Override
public void doInit() {
    super.doInit();
    // Config
    apicultureConfig = new Configuration();
    Property property = apicultureConfig.get("apiary.sidesensitive", CONFIG_CATEGORY, apiarySideSensitive);
    property.comment = "set to false if apiaries should output all items regardless of side a pipe is attached to";
    apiarySideSensitive = Boolean.parseBoolean(property.value);
    property = apicultureConfig.get("render.bees.fancy", CONFIG_CATEGORY, fancyRenderedBees);
    property.comment = "set to true to enable a fancy butterfly-like renderer for bees. (experimental!)";
    fancyRenderedBees = Boolean.parseBoolean(property.value);
    property = apicultureConfig.get("beekeeping.mode", CONFIG_CATEGORY, "NORMAL");
    property.comment = "change beekeeping modes here. possible values EASY, NORMAL, HARD, HARDCORE, INSANE. mods may add additional modes.";
    beekeepingMode = property.value.trim();
    Proxies.log.finer("Beekeeping mode read from config: " + beekeepingMode);
    Property secondPrincess = apicultureConfig.get("beekeeping.secondprincess", CONFIG_CATEGORY, secondPrincessChance);
    secondPrincess.comment = "percent chance of second princess drop, for limited/skyblock maps.";
    secondPrincessChance = Integer.parseInt(secondPrincess.value);
    property = apicultureConfig.get("beekeeping.flowers.custom", CONFIG_CATEGORY, "");
    property.comment = "add additional flower blocks for apiaries here in the format modid:name or modid:name:meta. separate blocks using ';'. wildcard for metadata: '*'. will be treated like vanilla flowers. not recommended for flowers implemented as tile entities.";
    parseAdditionalFlowers(property.value, FlowerManager.plainFlowers);
    property = apicultureConfig.get("species.blacklist", CONFIG_CATEGORY, "");
    property.comment = "add species to blacklist identified by their uid and seperated with ';'.";
    parseBeeBlacklist(property.value);
    apicultureConfig.save();
    // Genetics
    createAlleles();
    createMutations();
    // Hives
    registerBeehiveDrops();
    createHives();
    // Inducers for swarmer
    BeeManager.inducers.put(ForestryItem.royalJelly.getItemStack(), 10);
    registerTemplates();
    GameRegistry.registerTileEntity(TileAlvearyPlain.class, "forestry.Alveary");
    GameRegistry.registerTileEntity(TileSwarm.class, "forestry.Swarm");
    GameRegistry.registerTileEntity(TileAlvearySwarmer.class, "forestry.AlvearySwarmer");
    GameRegistry.registerTileEntity(TileAlvearyHeater.class, "forestry.AlvearyHeater");
    GameRegistry.registerTileEntity(TileAlvearyFan.class, "forestry.AlvearyFan");
    GameRegistry.registerTileEntity(TileAlvearyHygroregulator.class, "forestry.AlvearyHygro");
    GameRegistry.registerTileEntity(TileAlvearyStabiliser.class, "forestry.AlvearyStabiliser");
    GameRegistry.registerTileEntity(TileAlvearySieve.class, "forestry.AlvearySieve");
    GameRegistry.registerTileEntity(TileCandle.class, "forestry.Candle");
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getForestTemplate()));
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getMeadowsTemplate()));
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getModestTemplate()));
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getMarshyTemplate()));
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getWintryTemplate()));
    BeeManager.villageBees[0].add(beeInterface.templateAsGenome(BeeTemplates.getTropicalTemplate()));
    BeeManager.villageBees[1].add(beeInterface.templateAsGenome(BeeTemplates.getForestRainResistTemplate()));
    BeeManager.villageBees[1].add(beeInterface.templateAsGenome(BeeTemplates.getCommonTemplate()));
    BeeManager.villageBees[1].add(beeInterface.templateAsGenome(BeeTemplates.getValiantTemplate()));
    if (Config.enableVillager) {
        // Register villager stuff
        VillageHandlerApiculture villageHandler = new VillageHandlerApiculture();
        VillagerRegistry.instance().registerVillageCreationHandler(villageHandler);
        VillagerRegistry.instance().registerVillagerId(Defaults.ID_VILLAGER_BEEKEEPER);
        Proxies.render.registerVillagerSkin(Defaults.ID_VILLAGER_BEEKEEPER, Defaults.TEXTURE_SKIN_BEEKPEEPER);
        VillagerRegistry.instance().registerVillageTradeHandler(Defaults.ID_VILLAGER_BEEKEEPER, villageHandler);
    }
    proxy.initializeRendering();
}
Also used : VillageHandlerApiculture(forestry.apiculture.VillageHandlerApiculture) Configuration(forestry.core.config.Configuration) Property(forestry.core.config.Property)

Aggregations

Property (forestry.core.config.Property)7 Configuration (forestry.core.config.Configuration)3 ITreeRoot (forestry.api.arboriculture.ITreeRoot)1 VillageHandlerApiculture (forestry.apiculture.VillageHandlerApiculture)1 BlockBase (forestry.core.gadgets.BlockBase)1 MachineDefinition (forestry.core.gadgets.MachineDefinition)1 ButterflySpawner (forestry.lepidopterology.ButterflySpawner)1 CommandButterfly (forestry.lepidopterology.commands.CommandButterfly)1 ItemStack (net.minecraft.item.ItemStack)1