Search in sources :

Example 1 with Configuration

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

the class PluginLepidopterology method doInit.

@Override
public void doInit() {
    config = new Configuration();
    Property property = config.get("entities.spawn.limit", CONFIG_CATEGORY, spawnConstraint);
    property.comment = "determines the global butterfly entity count above which natural spawning of butterflies ceases.";
    spawnConstraint = Integer.parseInt(property.value);
    property = config.get("entities.maximum.allowed", CONFIG_CATEGORY, entityConstraint);
    property.comment = "determines the global butterfly entity count above which butterflies will stay in item form and will not take flight anymore.";
    entityConstraint = Integer.parseInt(property.value);
    property = config.get("entities.pollination.allowed", CONFIG_CATEGORY, allowPollination);
    property.comment = "determines whether butterflies can pollinate leaves.";
    allowPollination = Boolean.parseBoolean(property.value);
    config.save();
    PluginCore.rootCommand.addChildCommand(new CommandButterfly());
    Utils.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
    proxy.initializeRendering();
    registerTemplates();
    BlockBase lepidopterology = ((BlockBase) ForestryBlock.lepidopterology.block());
    definitionChest = lepidopterology.addDefinition((new MachineDefinition(Defaults.DEFINITION_LEPICHEST_META, "forestry.LepiChest", TileLepidopteristChest.class, ShapedRecipeCustom.createShapedRecipe(ForestryBlock.lepidopterology.getItemStack(1, Defaults.DEFINITION_LEPICHEST_META), " # ", "XYX", "XXX", '#', Blocks.glass, 'X', ForestryItem.butterflyGE.getItemStack(1, Defaults.WILDCARD), 'Y', Blocks.chest)).setFaces(0, 1, 2, 3, 4, 4, 0, 7)));
    definitionChest.register();
    ((ITreeRoot) AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees")).registerLeafTickHandler(new ButterflySpawner());
    RecipeSorter.register("forestry:lepidopterologymating", MatingRecipe.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless");
}
Also used : MachineDefinition(forestry.core.gadgets.MachineDefinition) Configuration(forestry.core.config.Configuration) BlockBase(forestry.core.gadgets.BlockBase) ButterflySpawner(forestry.lepidopterology.ButterflySpawner) ITreeRoot(forestry.api.arboriculture.ITreeRoot) Property(forestry.core.config.Property) CommandButterfly(forestry.lepidopterology.commands.CommandButterfly)

Example 2 with Configuration

use of forestry.core.config.Configuration 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 3 with Configuration

use of forestry.core.config.Configuration 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

Configuration (forestry.core.config.Configuration)3 Property (forestry.core.config.Property)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