Package codechicken.lib.config
Interface ConfigCategory
- All Superinterfaces:
ConfigTag
- All Known Implementing Classes:
ConfigCategoryImpl
Created by covers1624 on 17/4/22.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all children from this tag.Deletes the tag with the given name.@Nullable ConfigCategoryfindCategory(String name) Gets theConfigCategorywith the given name, or null.@Nullable ConfigTagGets theConfigTagwith the given name, ornull.@Nullable ConfigValueGets theConfigValuewith the given name, or null.@Nullable ConfigValueListfindValueList(String name) Gets theConfigValueListwith the given name, or null.getCategory(String name) Gets or creates aConfigCategorywith the given name.Gets all child tags contained in this Category.Gets or creates aConfigValuewith the given name.getValueList(String name) Gets or creates aConfigValueListwith the given name.booleanChecks if this tag has a child with the given name.onSync(ConfigCallback<ConfigCategory> callback) setComment(String comment) Sets the comment for this tag.
Will be split on\n.setComment(String... comment) Sets the comment for this tag.setComment(List<String> comment) Sets the comment for this tag.Sets this tag as requiring syncing to the client.Methods inherited from interface codechicken.lib.config.ConfigTag
copy, delete, forceSync, getComment, getDesc, getName, getParent, isDirty, isNetworkTag, read, requiresClientSync, reset, resetFromNetwork, runSync, save, write
-
Method Details
-
has
Checks if this tag has a child with the given name.- Parameters:
name- The name.- Returns:
- If the child exists.
-
findTag
Gets theConfigTagwith the given name, ornull.- Parameters:
name- The name.- Returns:
- The
ConfigTagornullif it doesn't exist.
-
getCategory
Gets or creates aConfigCategorywith the given name.- Parameters:
name- The name.- Returns:
- The
ConfigCategory. - Throws:
IllegalStateException- If aConfigTagexists, but it is not aConfigCategory.
-
findCategory
Gets theConfigCategorywith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigCategoryor it does not exist.- Parameters:
name- The name.- Returns:
- The
ConfigCategoryornull.
-
getValue
Gets or creates aConfigValuewith the given name.- Parameters:
name- The name.- Returns:
- The
ConfigValue. - Throws:
IllegalStateException- If aConfigTagexists, but it is not aConfigValue.
-
findValue
Gets theConfigValuewith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigValueor it does not exist.- Parameters:
name- The name.- Returns:
- The
ConfigValueornull
-
getValueList
Gets or creates aConfigValueListwith the given name.- Parameters:
name- The name.- Returns:
- The
ConfigValueList. - Throws:
IllegalStateException- If aConfigTagexists, but it is not aConfigValueList.
-
findValueList
Gets theConfigValueListwith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigValueListor it does not exist.- Parameters:
name- The name.- Returns:
- The
ConfigValueListornull
-
getChildren
Collection<ConfigTag> getChildren()Gets all child tags contained in this Category.- Returns:
- All the child tags.
-
delete
Deletes the tag with the given name.If the tag does not exist, this method does nothing.
- Parameters:
name- The name of the tag to delete.- Returns:
- The same config tag.
-
clear
void clear()Removes all children from this tag. -
syncTagToClient
ConfigCategory syncTagToClient()Sets this tag as requiring syncing to the client.Register your root tag via
ConfigSyncManager.registerSync(ResourceLocation, ConfigTag).- Specified by:
syncTagToClientin interfaceConfigTag
-
onSync
-
setComment
Sets the comment for this tag.
Will be split on\n.- Specified by:
setCommentin interfaceConfigTag- Parameters:
comment- The comment line.- Returns:
- The same config tag.
-
setComment
Sets the comment for this tag.- Specified by:
setCommentin interfaceConfigTag- Parameters:
comment- The comment lines.- Returns:
- The same config tag.
-
setComment
Sets the comment for this tag.- Specified by:
setCommentin interfaceConfigTag- Parameters:
comment- The comment lines.- Returns:
- The same config tag.
-