本文整理汇总了Java中net.minecraftforge.common.config.Configuration.getCategory方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.getCategory方法的具体用法?Java Configuration.getCategory怎么用?Java Configuration.getCategory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.common.config.Configuration
的用法示例。
在下文中一共展示了Configuration.getCategory方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupBookConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public static void setupBookConfig(Configuration cfg) {
ConfigCategory category = cfg.getCategory(CATEGORY_BOOKS);
if (category.isEmpty()) {
// Initialize with defaults
addBook(cfg, Items.BOOK.getRegistryName().toString(), "*");
addBook(cfg, Items.ENCHANTED_BOOK.getRegistryName().toString(), "*");
addBook(cfg, Items.WRITABLE_BOOK.getRegistryName().toString(), "*");
addBook(cfg, Items.WRITTEN_BOOK.getRegistryName().toString(), "*");
addBook(cfg, "rftools:rftools_manual", BookType.BOOK_BLUE.getModel());
addBook(cfg, "rftoolscontrol:rftoolscontrol_manual", BookType.BOOK_GREEN.getModel());
addBook(cfg, "rftoolsdim:rftoolsdim_manual", BookType.BOOK_GREEN.getModel());
addBook(cfg, "deepresonance:dr_manual", BookType.BOOK_RED.getModel());
} else {
for (Map.Entry<String, Property> entry : category.entrySet()) {
validBooks.put(entry.getKey(), entry.getValue().getString());
}
}
}
示例2: getConfigElements
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> configElements = new ArrayList<IConfigElement>();
Configuration config = ModConfig.CONFIG;
if (config != null) {
ConfigCategory categoryClient = config.getCategory(ModConfig.CLIENT_CAT);
configElements.addAll(new ConfigElement(categoryClient).getChildElements());
}
return configElements;
}
示例3: buildChildScreen
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
@Override
protected GuiScreen buildChildScreen() {
Configuration config = VExConfig.getConfig();
ConfigElement categoryBlocks = new ConfigElement(config.getCategory(VExConfig.CATEGORY_NAME_BLOCKS));
List<IConfigElement> propertiesOnScreen = categoryBlocks.getChildElements();
String windowTitle = I18n.format("gui.config.category.blocks");
return new GuiConfig(owningScreen, propertiesOnScreen, owningScreen.modID,
this.configElement.requiresWorldRestart() || this.owningScreen.allRequireWorldRestart,
this.configElement.requiresMcRestart() || this.owningScreen.allRequireMcRestart, windowTitle);
}
示例4: getConfigElements
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> configElements = new ArrayList<IConfigElement>();
Configuration config = Config.getConfig();
if (config != null) {
ConfigCategory category = config.getCategory(Config.getCategory());
configElements.addAll(new ConfigElement(category).getChildElements());
}
return configElements;
}
示例5: InitClientMessage
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
public InitClientMessage(Configuration conf) {
ConfigCategory cat = conf.getCategory("default building targets");
this.sentryTargets = cat.get("Attack on hurt").getBoolean() ? 1 : 0;
this.sentryTargets += cat.get("Attack other players").getBoolean() ? 2 : 0;
this.sentryTargets += cat.get("Attack hostile mobs").getBoolean() ? 4 : 0;
this.sentryTargets += cat.get("Attack friendly creatures").getBoolean() ? 8 : 0;
this.dispenserPlayer = cat.get("Dispensers heal neutral players").getBoolean();
this.teleporterPlayer = cat.get("Neutral players can teleport").getBoolean();
this.teleporterEntity = cat.get("Entities can teleport").getBoolean();
}
示例6: loadConfig
import net.minecraftforge.common.config.Configuration; //导入方法依赖的package包/类
static void loadConfig(File configurationFile)
{
config = new Configuration(configurationFile);
Property bl = config.get("items", "blacklist", new String[0]);
bl.setComment("List of items to disallow from placing in the belt.");
Property wl = config.get("items", "whitelist", new String[0]);
wl.setComment("List of items to force-allow placing in the belt. Takes precedence over blacklist.");
Property showBeltOnPlayersProperty = config.get("display", "showBeltOnPlayers", true);
showBeltOnPlayersProperty.setComment("If set to FALSE, the belts and tools will NOT draw on players.");
Property beltItemScaleProperty = config.get("display", "beltItemScale", 0.5);
beltItemScaleProperty.setComment("Changes the scale of items on the belt.");
Property releaseToSwapProperty = config.get("input", "releaseToSwap", false);
releaseToSwapProperty.setComment("If set to TRUE, releasing the menu key (R) will activate the swap. Requires a click otherwise (default).");
Property clipMouseToCircleProperty = config.get("input", "clipMouseToCircle", false);
clipMouseToCircleProperty.setComment("If set to TRUE, the radial menu will try to prevent the mouse from leaving the outer circle.");
Property allowClickOutsideBoundsProperty = config.get("input", "allowClickOutsideBounds", false);
allowClickOutsideBoundsProperty.setComment("If set to TRUE, the radial menu will allow clicking outside the outer circle to activate the items.");
display = config.getCategory("display");
display.setComment("Options for customizing the display of tools on the player");
input = config.getCategory("input");
input.setComment("Options for customizing the interaction with the radial menu");
showBeltOnPlayers = showBeltOnPlayersProperty.getBoolean();
beltItemScale = (float)beltItemScaleProperty.getDouble();
releaseToSwap = releaseToSwapProperty.getBoolean();
clipMouseToCircle = clipMouseToCircleProperty.getBoolean();
allowClickOutsideBounds = allowClickOutsideBoundsProperty.getBoolean();
blackListString.addAll(Arrays.asList(bl.getStringList()));
whiteListString.addAll(Arrays.asList(wl.getStringList()));
if (!bl.wasRead() ||
!wl.wasRead() ||
!releaseToSwapProperty.wasRead() ||
!showBeltOnPlayersProperty.wasRead() ||
!beltItemScaleProperty.wasRead() ||
!clipMouseToCircleProperty.wasRead() ||
!allowClickOutsideBoundsProperty.wasRead())
{
config.save();
}
}