Class ConfigCategoryImpl
- All Implemented Interfaces:
ConfigCategory,ConfigTag
-
Field Summary
Fields inherited from class codechicken.lib.config.AbstractConfigTag
comment, dirty, networkSynthetic, syncToClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Removes all children from this tag.voidcopy(@Nullable ConfigCategoryImpl parent) Deletes the tag with the given name.@Nullable ConfigCategoryImplfindCategory(String name) Gets theConfigCategorywith the given name, or null.@Nullable AbstractConfigTag<?>Gets theConfigTagwith the given name, ornull.@Nullable ConfigValueImplGets theConfigValuewith the given name, or null.@Nullable ConfigValueListImplfindValueList(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.booleanisDirty()If thisConfigTagor any of its children are dirty and requires flushing to disk.voidread(MCDataInput in) Read this tag from aMCDataInput.booleanChecks if this tag or any of its children require client sync.voidreset()Reset this tag back to the default.voidResets all network tags back to their original value.voidrunSync(ConfigCallback.Reason reason) Triggers all registeredConfigCallback's in the tree with the specified reason.Sets this tag as requiring syncing to the client.voidwrite(MCDataOutput out) Write this tag to aMCDataOutput.Methods inherited from class codechicken.lib.config.AbstractConfigTag
copy, getComment, getName, getParent, isNetworkTag, onSync, setComment, setComment, setCommentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.lib.config.ConfigCategory
onSync, setComment, setComment, setCommentMethods inherited from interface codechicken.lib.config.ConfigTag
copy, delete, forceSync, getComment, getDesc, getName, getParent, isNetworkTag, save
-
Constructor Details
-
ConfigCategoryImpl
-
-
Method Details
-
has
Description copied from interface:ConfigCategoryChecks if this tag has a child with the given name.- Specified by:
hasin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- If the child exists.
-
findTag
Description copied from interface:ConfigCategoryGets theConfigTagwith the given name, ornull.- Specified by:
findTagin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigTagornullif it doesn't exist.
-
getCategory
Description copied from interface:ConfigCategoryGets or creates aConfigCategorywith the given name.- Specified by:
getCategoryin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigCategory.
-
findCategory
Description copied from interface:ConfigCategoryGets theConfigCategorywith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigCategoryor it does not exist.- Specified by:
findCategoryin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigCategoryornull.
-
getValue
Description copied from interface:ConfigCategoryGets or creates aConfigValuewith the given name.- Specified by:
getValuein interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigValue.
-
findValue
Description copied from interface:ConfigCategoryGets theConfigValuewith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigValueor it does not exist.- Specified by:
findValuein interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigValueornull
-
getValueList
Description copied from interface:ConfigCategoryGets or creates aConfigValueListwith the given name.- Specified by:
getValueListin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigValueList.
-
findValueList
Description copied from interface:ConfigCategoryGets theConfigValueListwith the given name, or null.This will return
nullif theConfigTagat the name is not aConfigValueListor it does not exist.- Specified by:
findValueListin interfaceConfigCategory- Parameters:
name- The name.- Returns:
- The
ConfigValueListornull
-
getChildren
Description copied from interface:ConfigCategoryGets all child tags contained in this Category.- Specified by:
getChildrenin interfaceConfigCategory- Returns:
- All the child tags.
-
delete
Description copied from interface:ConfigCategoryDeletes the tag with the given name.If the tag does not exist, this method does nothing.
- Specified by:
deletein interfaceConfigCategory- Parameters:
name- The name of the tag to delete.- Returns:
- The same config tag.
-
clear
public void clear()Description copied from interface:ConfigCategoryRemoves all children from this tag.- Specified by:
clearin interfaceConfigCategory
-
reset
public void reset()Description copied from interface:ConfigTagReset this tag back to the default.In the event that this is a
ConfigCategorysets all descendant values to their default. -
syncTagToClient
Description copied from interface:ConfigTagSets this tag as requiring syncing to the client.Register your root tag via
ConfigSyncManager.registerSync(ResourceLocation, ConfigTag).- Specified by:
syncTagToClientin interfaceConfigCategory- Specified by:
syncTagToClientin interfaceConfigTag- Overrides:
syncTagToClientin classAbstractConfigTag<ConfigCategory>
-
requiresClientSync
public boolean requiresClientSync()Description copied from interface:ConfigTagChecks if this tag or any of its children require client sync.- Specified by:
requiresClientSyncin interfaceConfigTag- Overrides:
requiresClientSyncin classAbstractConfigTag<ConfigCategory>- Returns:
- If client sync is required.
-
runSync
Description copied from interface:ConfigTagTriggers all registeredConfigCallback's in the tree with the specified reason.This method should probably not be called by anyone else.
- Specified by:
runSyncin interfaceConfigTag- Overrides:
runSyncin classAbstractConfigTag<ConfigCategory>- Parameters:
reason- The reason.
-
isDirty
public boolean isDirty()Description copied from interface:ConfigTagIf thisConfigTagor any of its children are dirty and requires flushing to disk.- Specified by:
isDirtyin interfaceConfigTag- Overrides:
isDirtyin classAbstractConfigTag<ConfigCategory>- Returns:
- If the branch is dirty.
-
clearDirty
public void clearDirty()- Overrides:
clearDirtyin classAbstractConfigTag<ConfigCategory>
-
copy
- Specified by:
copyin classAbstractConfigTag<ConfigCategory>
-
write
Description copied from interface:ConfigTagWrite this tag to aMCDataOutput. Only categories and/or tags which haveConfigTag.syncTagToClient()set will be written. -
read
Description copied from interface:ConfigTagRead this tag from aMCDataInput. All tags and values will be read and inserted into the tree.If a tag does not already exist in the tree, one will be added and marked as a 'network tag',
ConfigTag.isNetworkTag().All tags with a network value will be reset to default when
ConfigTag.resetFromNetwork()is called, whilst any 'network only' tags will be deleted. -
resetFromNetwork
public void resetFromNetwork()Description copied from interface:ConfigTagResets all network tags back to their original value.Whilst a tag is set from the network, it is effectively immutable and may not be set.
Any tags which are 'network only' are deleted during this operation.
- Specified by:
resetFromNetworkin interfaceConfigTag
-