本文整理匯總了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);
}