use of forestry.core.config.Property in project ForestryMC by ForestryMC.
the class GameMode method initSetting.
private void initSetting(String ident, ItemStack def, String comment) {
Property property = Config.config.get(ident, category, def.stackSize);
property.comment = comment;
ItemStack changed = def.copy();
changed.stackSize = Integer.parseInt(property.value);
stackSettings.put(ident, changed);
}
use of forestry.core.config.Property 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");
}
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();
}
use of forestry.core.config.Property in project ForestryMC by ForestryMC.
the class GameMode method initSetting.
private void initSetting(String ident, int def, int max, String comment) {
Property property = Config.config.get(ident, category, def);
if (max < 0) {
property.comment = comment;
integerSettings.put(ident, Integer.parseInt(property.value));
} else {
property.comment = comment + " (max: " + max + ")";
integerSettings.put(ident, Math.min(Integer.parseInt(property.value), max));
}
Config.config.set(ident, category, integerSettings.get(ident));
}
use of forestry.core.config.Property in project ForestryMC by ForestryMC.
the class GameMode method initSetting.
private void initSetting(String ident, boolean def, String comment) {
Property property = Config.config.get(ident, category, def);
property.comment = comment;
booleanSettings.put(ident, Boolean.parseBoolean(property.value));
Config.config.set(ident, category, booleanSettings.get(ident));
}
Aggregations