本文整理了Java中net.minecraftforge.common.config.Configuration.getCategory()
方法的一些代码示例,展示了Configuration.getCategory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getCategory()
方法的具体详情如下:
包路径:net.minecraftforge.common.config.Configuration
类名称:Configuration
方法名:getCategory
暂无
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public void destroyGridStorage( final long id )
{
final String stringID = String.valueOf( id );
this.config.getCategory( "gridstorage" ).remove( stringID );
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final ConfigCategory c = configurartion.getCategory( category );
configurartion.removeCategory( c );
configurartion.getCategory( CONFIG_COMMON_KEY ).setComment( CONFIG_COMMON_COMMENT );
final ConfigCategory category = configurartion.getCategory( CONFIG_FACADES_KEY );
category.setComment( CONFIG_FACADES_COMMENT );
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
public PlayerData( @Nonnull final Configuration configFile )
{
Preconditions.checkNotNull( configFile );
this.config = configFile;
final ConfigCategory playerList = this.config.getCategory( "players" );
this.playerMapping = new PlayerMapping( playerList );
}
代码示例来源:origin: Funwayguy/BetterQuesting
public static List<IConfigElement> getCategories(Configuration config)
{
List<IConfigElement> cats = new ArrayList<>();
for(String s : config.getCategoryNames())
{
cats.add(new ConfigElement(config.getCategory(s)));
}
return cats;
}
}
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
@Override
public int getPlayerID( @Nonnull final GameProfile profile )
{
Preconditions.checkNotNull( profile );
Preconditions.checkNotNull( this.config.getCategory( "players" ) );
Preconditions.checkState( profile.isComplete() );
final ConfigCategory players = this.config.getCategory( "players" );
final String uuid = profile.getId().toString();
final Property maybePlayerID = players.get( uuid );
if( maybePlayerID != null && maybePlayerID.isIntValue() )
{
return maybePlayerID.getInt();
}
else
{
final int newPlayerID = this.nextPlayer();
final Property newPlayer = new Property( uuid, String.valueOf( newPlayerID ), Property.Type.INTEGER );
players.put( uuid, newPlayer );
this.playerMapping.put( newPlayerID, profile.getId() ); // add to reverse map
this.config.save();
return newPlayerID;
}
}
代码示例来源:origin: Vazkii/Botania
public GuiBotaniaConfig(GuiScreen parentScreen) {
super(parentScreen, new ConfigElement(ConfigHandler.config.getCategory(Configuration.CATEGORY_GENERAL)).getChildElements(), LibMisc.MOD_ID, false, false, GuiConfig.getAbridgedConfigPath(ConfigHandler.config.toString()));
}
代码示例来源:origin: SlimeKnights/TinkersConstruct
category = Config.configFile.getCategory(serverCategory.getName());
代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2
final Set<ConfigCategory> whitelist = configurartion.getCategory( CONFIG_FACADES_KEY ).getChildren();
for( ConfigCategory configCategory : whitelist )
代码示例来源:origin: sinkillerj/ProjectE
@Override
public ConfigCategory getCategory(String name) {
if (name == null || "".equals(name)) return this.inner.getCategory(this.prefix);
return this.inner.getCategory(this.prefix + "." + name);
}
}
代码示例来源:origin: SlimeKnights/TinkersConstruct
Gameplay = configFile.getCategory(cat);
Worldgen = configFile.getCategory(cat);
ClientSide = configFile.getCategory(cat);
prop.set(false);
ForgeModContainer.replaceVanillaBucketModel = true;
Property forgeProp = ForgeModContainer.getConfig().getCategory(Configuration.CATEGORY_CLIENT).get("replaceVanillaBucketModel");
if(forgeProp != null) {
forgeProp.set(true);
代码示例来源:origin: Vazkii/Quark
public static List<IConfigElement> getAllElements(String baseCategory) {
List<IConfigElement> list = new ArrayList();
list.addAll(new ConfigElement(ModuleLoader.config.getCategory(baseCategory)).getChildElements());
return list;
}
代码示例来源:origin: MrCrayfish/MrCrayfishFurnitureMod
public static List<IConfigElement> getConfigElements()
{
List<IConfigElement> configs = new ArrayList<>();
configs.addAll(new ConfigElement(ConfigurationHandler.config.getCategory(ConfigurationHandler.CATEGORY_SETTINGS)).getChildElements());
configs.addAll(new ConfigElement(ConfigurationHandler.config.getCategory(ConfigurationHandler.CATEGORY_RECIPE_SETTINGS)).getChildElements());
configs.addAll(new ConfigElement(ConfigurationHandler.config.getCategory(ConfigurationHandler.CATEGORY_API)).getChildElements());
return configs;
}
}
代码示例来源:origin: Azanor/Baubles
private static List<IConfigElement> getConfigElements() {
List<IConfigElement> list = new ArrayList<IConfigElement>();
list.addAll(new ConfigElement(Config.config
.getCategory(Configuration.CATEGORY_GENERAL))
.getChildElements());
list.addAll(new ConfigElement(Config.config
.getCategory(Configuration.CATEGORY_CLIENT))
.getChildElements());
return list;
}
}
代码示例来源:origin: CoFH/CoFHCore
public boolean removeCategory(String category) {
if (!modConfiguration.hasCategory(category)) {
return false;
}
modConfiguration.removeCategory(modConfiguration.getCategory(category));
return true;
}
代码示例来源:origin: McJtyMods/TheOneProbe
public TopModConfigGui(GuiScreen parentScreen) {
super(parentScreen, new ConfigElement(TheOneProbe.config.getCategory(Config.CATEGORY_CLIENT)).getChildElements(),
TheOneProbe.MODID, false, false, "The One Probe Config");
}
}
代码示例来源:origin: CoFH/CoFHCore
public boolean removeProperty(String category, String key) {
if (!modConfiguration.hasKey(category, key)) {
return false;
}
modConfiguration.getCategory(category).remove(key);
return true;
}
代码示例来源:origin: CoFH/CoFHCore
public static boolean playerHasAccess(String playerName, GameProfile owner) {
if (owner == null || playerName == null) {
return false;
}
if (playerName.equals(owner.getName())) {
return true;
}
String id = owner.getId().toString();
return (friendConf.hasCategory(id) && friendConf.getCategory(id).containsKey(playerName.toLowerCase(Locale.US)));
}
代码示例来源:origin: Ellpeck/ActuallyAdditions
private static List<IConfigElement> getConfigElements(){
List<IConfigElement> list = new ArrayList<IConfigElement>();
for(int i = 0; i < ConfigCategories.values().length; i++){
ConfigCategories cat = ConfigCategories.values()[i];
ConfigurationHandler.config.setCategoryComment(cat.name, cat.comment);
list.add(new ConfigElement(ConfigurationHandler.config.getCategory(cat.name)));
}
return list;
}
}
代码示例来源:origin: WayofTime/BloodMagic
public static List<IConfigElement> getElements() {
List<IConfigElement> elements = Lists.newArrayList();
elements.addAll(ConfigElement.from(ConfigHandler.class).getChildElements());
elements.add(new ConfigElement(BloodMagic.RITUAL_MANAGER.getConfig().getCategory("rituals")));
if (Minecraft.getMinecraft().world != null)
elements.add(new DummyElementEditHUD(BloodMagic.NAME, "config." + BloodMagic.MODID + ".edit_hud"));
return elements;
}
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public boolean isValid() {
return EnderIO.getInstance().getConfiguration().getCategory(section).get(name).getBoolean() == value;
}
内容来源于网络,如有侵权,请联系作者删除!