当前位置: 首页>>代码示例>>Java>>正文


Java Property.getString方法代码示例

本文整理汇总了Java中net.minecraftforge.common.config.Property.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getString方法的具体用法?Java Property.getString怎么用?Java Property.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.config.Property的用法示例。


在下文中一共展示了Property.getString方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSafeColorFromProperty

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public static int getSafeColorFromProperty(Property property, int min, int max) {
 String colorString = property.getString();
 if (colorString.startsWith("0x"))
	 colorString = colorString.replace("0x", "");
 try {
	 int color = Integer.parseInt(colorString, 16);
	 if (color<min || color>max)
		 return -1;
	 else
		 return color;
 }
 catch (NumberFormatException e) {
	 property.setToDefault();
	 return -1;
 }
}
 
开发者ID:GWYOG,项目名称:GTVeinLocator,代码行数:17,代码来源:ModConfig.java

示例2: getStringFor

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public static String getStringFor(Configuration config, String heading, String item, String value)
{
	if (config == null)
		return value;
	try
	{
		Property prop = config.get(heading, item, value);
		return prop.getString();
	} catch (Exception e)
	{
		System.out.println("[" + ModDetails.ModName + "] Error while trying to add String, config wasn't loaded properly!");
	}
	return value;
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:15,代码来源:ModOptions.java

示例3: syncConfig

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
private static void syncConfig()
{
    Property fontNameProp = cfg.get(Configuration.CATEGORY_GENERAL, "fontName", "SansSerif", "Valid font names: " + Arrays.toString(ALL_FONT_NAMES));

    fontName = fontNameProp.getString();
    fontSize = cfg.getInt("fontSize", Configuration.CATEGORY_GENERAL, 18, 1, 100, "The font's size");
    antiAlias = cfg.getBoolean("antiAlias", Configuration.CATEGORY_GENERAL, false, "Whether to use anti-aliasing");
    dropShadow = cfg.getBoolean("dropShadow", Configuration.CATEGORY_GENERAL, true, "Setting this to \"false\" will disable drop shadows completely");

    fontNameProp.setConfigEntryClass(SelectFontEntry.class);

    if (cfg.hasChanged())
        cfg.save();
}
 
开发者ID:cubex2,项目名称:BetterFonts,代码行数:15,代码来源:Config.java

示例4: getStringFor

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public static String getStringFor(Configuration config, String heading, String item, String value) {
	if (config == null)
		return value;
	try {
		Property prop = config.get(heading, item, value);
		return prop.getString();
	} catch (Exception e) {
		TFCTech.LOG.error("Error while trying to add String, config wasn't loaded properly!");
	}
	return value;
}
 
开发者ID:Shurgent,项目名称:TFCTech,代码行数:12,代码来源:ModOptions.java

示例5: getStringFor

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
public static String getStringFor(Configuration config, String heading, String item, String value)
{
	if (config == null)
		return value;
	try
	{
		Property prop = config.get(heading, item, value);
		return prop.getString();
	} catch (Exception e)
	{
		System.out.println("[" + TFCPPDetails.ModName + "] Error while trying to add String, config wasn't loaded properly!");
	}
	return value;
}
 
开发者ID:Wahazar,项目名称:TerraFirmaProgressivePack,代码行数:15,代码来源:TFCPPOptions.java

示例6: registerTraceRenderInformation

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
private static void registerTraceRenderInformation(final String categoryName, final String categoryQualifiedName) {
    final Property propName = configuration.get(categoryQualifiedName, Names.Config.NAME, categoryName, Names.Config.NAME_DESC);
    propName.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.NAME);
    final String name = propName.getString();

    final Property propColorRed = configuration.get(categoryQualifiedName, Names.Config.COLOR_RED, DEFAULT_COLOR_RED, Names.Config.COLOR_RED_DESC, 0, 255);
    propColorRed.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.COLOR_RED);
    final int red = propColorRed.getInt(DEFAULT_COLOR_RED);

    final Property propColorGreen = configuration.get(categoryQualifiedName, Names.Config.COLOR_GREEN, DEFAULT_COLOR_GREEN, Names.Config.COLOR_GREEN_DESC, 0, 255);
    propColorGreen.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.COLOR_GREEN);
    final int green = propColorGreen.getInt(DEFAULT_COLOR_GREEN);

    final Property propColorBlue = configuration.get(categoryQualifiedName, Names.Config.COLOR_BLUE, DEFAULT_COLOR_BLUE, Names.Config.COLOR_BLUE_DESC, 0, 255);
    propColorBlue.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.COLOR_BLUE);
    final int blue = propColorBlue.getInt(DEFAULT_COLOR_BLUE);

    final Property propColorAlpha = configuration.get(categoryQualifiedName, Names.Config.COLOR_ALPHA, DEFAULT_COLOR_ALPHA, Names.Config.COLOR_ALPHA_DESC, 0, 255);
    propColorAlpha.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.COLOR_ALPHA);
    final int alpha = propColorAlpha.getInt(DEFAULT_COLOR_ALPHA);

    final Property propTTL = configuration.get(categoryQualifiedName, Names.Config.TTL, DEFAULT_TTL, Names.Config.TTL_DESC, 1, 120);
    propTTL.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.TTL);
    final int ttl = propTTL.getInt(DEFAULT_TTL) * 20;

    final Property propThickness = configuration.get(categoryQualifiedName, Names.Config.THICKNESS, DEFAULT_THICKNESS, Names.Config.THICKNESS_DESC, 1.0, 10.0);
    propThickness.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.THICKNESS);
    final double thickness = propThickness.getDouble(DEFAULT_THICKNESS);

    final Property propOffsetY = configuration.get(categoryQualifiedName, Names.Config.OFFSET_Y, DEFAULT_OFFSET_Y, Names.Config.OFFSET_Y_DESC, -1.0, +1.0);
    propOffsetY.setLanguageKey(Names.Config.LANG_PREFIX + "." + Names.Config.OFFSET_Y);
    final double offsetY = propOffsetY.getDouble(DEFAULT_OFFSET_Y);

    setCategoryPropertyOrder(categoryQualifiedName, Names.Config.NAME, Names.Config.COLOR_RED, Names.Config.COLOR_GREEN, Names.Config.COLOR_BLUE, Names.Config.COLOR_ALPHA, Names.Config.TTL, Names.Config.THICKNESS, Names.Config.OFFSET_Y);

    Tracer.proxy.setConfigEntryClassSlider(propColorRed, propColorGreen, propColorBlue, propColorAlpha);
    Tracer.proxy.setConfigEntryClassSlider(propTTL, propThickness, propOffsetY);

    TraceRegistry.INSTANCE.register(name, red, green, blue, alpha, thickness, ttl, offsetY);
}
 
开发者ID:Lunatrius,项目名称:Tracer,代码行数:41,代码来源:ConfigurationHandler.java

示例7: StringConfigProperty

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
protected StringConfigProperty(final @Nonnull Configuration config, final @Nonnull Property property) {
	super(config, property, property.getString());
}
 
开发者ID:Team-Fruit,项目名称:ServerObserver,代码行数:4,代码来源:ConfigBase.java

示例8: dataFrom

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
@Override
public String dataFrom(Property source) {
    return source.getString();
}
 
开发者ID:Zeno410,项目名称:Geographicraft,代码行数:5,代码来源:Settings.java

示例9: structures

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
private static void structures() {
    // catacombs
    Property structuresDimensionIdProperty = config.get(CATEGORY_STRUCTURES_CATACOMBS, "StructuresDimensionIds", GraveStoneWorldGenerator.DEFAULT_DIMENSION_ID);
    structuresDimensionIdProperty.setComment("List of dimension id in which structures generation is allowed. \"dimension_id_1;dimension_id_2;.....\".");
    String ar = structuresDimensionIdProperty.getString();
    String[] ids = ar.split(";");
    structuresDimensionIds = new ArrayList<>(ids.length);
    for (String id : ids) {
        try {
            structuresDimensionIds.add(Integer.parseInt(id));
        } catch (NumberFormatException e) {
            GSLogger.logError("Can't parse StructuresDimensionIds!!!");
            e.printStackTrace();
        }
    }
    if (structuresDimensionIds.isEmpty()) {
        structuresDimensionIds.add(GraveStoneWorldGenerator.DEFAULT_DIMENSION_ID);
    }

    generateCatacombs = config.get(CATEGORY_STRUCTURES_CATACOMBS, "GenerateCatacombs", true).getBoolean(true);
    maxCatacombsHeight = config.get(CATEGORY_STRUCTURES_CATACOMBS, "MaximumCatacombsGenerationHeight", 75).getInt();
    catacombsGenerationChance = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsGenerationChance", CatacombsGenerator.DEFAULT_GENERATION_CHANCE).getDouble();
    generateCatacombsGraveyard = config.get(CATEGORY_STRUCTURES_CATACOMBS, "GenerateCatacombsGraveyard", true).getBoolean(true);
    generatePilesOfBones = config.get(CATEGORY_STRUCTURES_CATACOMBS, "GeneratePilesOfBones", true).getBoolean(true);

    catacombsMinRoomsCountAt1Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMinRoomsCountAt1Level", CatacombsLevel.DEFAULT_MIN_ROOMS_COUNT_AT_1_LEVEL).getInt();
    catacombsMaxRoomsCountAt1Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMaxRoomsCountAt1Level", CatacombsLevel.DEFAULT_MAX_ROOMS_COUNT_AT_1_LEVEL).getInt();

    catacombsMinRoomsCountAt2Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMinRoomsCountAt2Level", CatacombsLevel.DEFAULT_MIN_ROOMS_COUNT_AT_2_LEVEL).getInt();
    catacombsMaxRoomsCountAt2Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMaxRoomsCountAt2Level", CatacombsLevel.DEFAULT_MAX_ROOMS_COUNT_AT_2_LEVEL).getInt();

    catacombsMinRoomsCountAt3Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMinRoomsCountAt3Level", CatacombsLevel.DEFAULT_MIN_ROOMS_COUNT_AT_3_LEVEL).getInt();
    catacombsMaxRoomsCountAt3Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMaxRoomsCountAt3Level", CatacombsLevel.DEFAULT_MAX_ROOMS_COUNT_AT_3_LEVEL).getInt();

    catacombsMinRoomsCountAt4Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMinRoomsCountAt4Level", CatacombsLevel.DEFAULT_MIN_ROOMS_COUNT_AT_4_LEVEL).getInt();
    catacombsMaxRoomsCountAt4Level = config.get(CATEGORY_STRUCTURES_CATACOMBS, "CatacombsMaxRoomsCountAt4Level", CatacombsLevel.DEFAULT_MAX_ROOMS_COUNT_AT_4_LEVEL).getInt();

    // other
    gravesGenerationChance = config.get(CATEGORY_STRUCTURES_OTHER, "GravesGenerationChance", SingleGraveGenerator.DEFAULT_GENERATION_CHANCE).getDouble();
    memorialsGenerationChance = config.get(CATEGORY_STRUCTURES_OTHER, "MemorialsGenerationChance", MemorialGenerator.DEFAULT_GENERATION_CHANCE).getDouble();

    generateGravesInMushroomBiomes = config.get(CATEGORY_STRUCTURES_OTHER, "GenerateGravesInMushroomBiomes", true).getBoolean(true);
    generateMemorials = config.get(CATEGORY_STRUCTURES_OTHER, "GenerateMemorials", true).getBoolean(true);
    generateSingleGraves = config.get(CATEGORY_STRUCTURES_OTHER, "GenerateSingleGraves", true).getBoolean(true);
    // village
    generateCemeteries = config.get(CATEGORY_STRUCTURES_VILLAGE, "GenerateCemeteries", false).getBoolean(false);
    generateVillageMemorials = config.get(CATEGORY_STRUCTURES_VILLAGE, "GenerateVillageMemorials", true).getBoolean(true);
    generateUndertaker = config.get(CATEGORY_STRUCTURES_VILLAGE, "GenerateUndertaker", true).getBoolean(true);
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:50,代码来源:ExtendedConfig.java

示例10: StringConfigProperty

import net.minecraftforge.common.config.Property; //导入方法依赖的package包/类
protected StringConfigProperty(final Configuration config, final Property property) {
	super(config, property, property.getString());
}
 
开发者ID:Team-Fruit,项目名称:EEWReciever,代码行数:4,代码来源:ConfigHandler.java


注:本文中的net.minecraftforge.common.config.Property.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。