本文整理汇总了Java中net.minecraftforge.common.config.ConfigCategory.setLanguageKey方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigCategory.setLanguageKey方法的具体用法?Java ConfigCategory.setLanguageKey怎么用?Java ConfigCategory.setLanguageKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.ConfigCategory
的用法示例。
在下文中一共展示了ConfigCategory.setLanguageKey方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getConfigElements
import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> elements = new ArrayList<IConfigElement>();
for (String name : Blockbuster.proxy.forge.getCategoryNames())
{
ConfigCategory category = Blockbuster.proxy.forge.getCategory(name);
category.setLanguageKey("blockbuster.config." + name + ".title");
if (name.indexOf(".") == -1)
{
elements.add(new ConfigElement(category));
}
}
return elements;
}
示例2: getConfigElements
import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements()
{
List<IConfigElement> elements = new ArrayList<IConfigElement>();
for (String name : Metamorph.proxy.forge.getCategoryNames())
{
ConfigCategory category = Metamorph.proxy.forge.getCategory(name);
category.setLanguageKey("metamorph.config." + name + ".title");
elements.add(new ConfigElement(category));
}
return elements;
}
示例3: createConfigElements
import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
@SuppressWarnings({ "rawtypes" })
private static List<IConfigElement> createConfigElements() {
ConfigCategory modules = OpenPeripheralIntegration.instance.config().getCategory(OpenPeripheralIntegration.CATEGORY_MODULES);
modules.setLanguageKey("openperipheralintegration.config.modules");
final ConfigElement modulesElement = new ConfigElement(modules);
return Lists.<IConfigElement> newArrayList(modulesElement);
}
示例4: link
import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
public void link(Configuration config, String name, String langKeyPrefix) {
String[] parts = StringUtils.split(name, '.');
String catName = parts[0];
String propName = parts[1];
// set category language key and description
String catLangKey = langKeyPrefix + "." + catName;
String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);
// configure category and add property
ConfigCategory cat = config.getCategory(catName);
cat.setLanguageKey(catLangKey);
cat.setComment(catDesc);
// set property language key and description
String propLangKey = langKeyPrefix + "." + propName;
String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);
// create supplier so that later calls don't need all the variables above
propSupplier = () -> {
Property prop = config.get(catName, propName, getPropDefault(),
propDesc, getPropType());
prop.setLanguageKey(propLangKey);
return prop;
};
// initialize prop
getProp();
// make sure the properties have an insertion order
List<String> order = new ArrayList<>(cat.getPropertyOrder());
order.add(name);
cat.setPropertyOrder(order);
}
示例5: link
import net.minecraftforge.common.config.ConfigCategory; //导入方法依赖的package包/类
public void link(Configuration config, String name, String langKeyPrefix) {
String[] parts = StringUtils.split(name, '.');
String catName = parts[0];
String propName = parts[1];
// set category language key and description
String catLangKey = langKeyPrefix + "." + catName;
String catDesc = WordUtils.wrap(I18n.format(catLangKey + ".tooltip"), 128);
// configure category and add property
ConfigCategory cat = config.getCategory(catName);
cat.setLanguageKey(catLangKey);
cat.setComment(catDesc);
// set property language key and description
String propLangKey = langKeyPrefix + "." + propName;
String propDesc = WordUtils.wrap(I18n.format(propLangKey + ".tooltip"), 128);
// make sure the properties have insertion order instead of being
// randomly ordered
List<String> order = new ArrayList<>(cat.getPropertyOrder());
order.add(propName);
// create supplier so that later calls don't need all the variables above
propSupplier = () -> {
Property prop = config.get(catName, propName, getPropDefault(),
propDesc, getPropType());
prop.setLanguageKey(propLangKey);
return prop;
};
// initialize prop
getProp();
// update prop order
cat.setPropertyOrder(order);
}