Package codechicken.lib.config
Class AbstractConfigTag<T extends ConfigTag>
java.lang.Object
codechicken.lib.config.AbstractConfigTag<T>
- All Implemented Interfaces:
ConfigTag
- Direct Known Subclasses:
ConfigCategoryImpl,ConfigValueImpl,ConfigValueListImpl
Created by covers1624 on 17/4/22.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractConfigTag(String name, @Nullable ConfigCategoryImpl parent) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy()Creates a deep clone of thisConfigTag.abstract AbstractConfigTag<T> copy(@Nullable ConfigCategoryImpl parent) Gets the comment for the tag.final StringgetName()Gets the name of this tag.final @Nullable ConfigCategoryGet the parent tag.booleanisDirty()If thisConfigTagor any of its children are dirty and requires flushing to disk.booleanChecks if this tags is a synthetic network tag.onSync(ConfigCallback<T> callback) booleanChecks if this tag or any of its children require client sync.voidrunSync(ConfigCallback.Reason reason) Triggers all registeredConfigCallback's in the tree with the specified reason.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.
-
Field Details
-
dirty
protected boolean dirty -
networkSynthetic
protected boolean networkSynthetic -
comment
-
syncToClient
protected boolean syncToClient
-
-
Constructor Details
-
AbstractConfigTag
-
-
Method Details
-
getName
Description copied from interface:ConfigTagGets the name of this tag. -
getParent
Description copied from interface:ConfigTagGet the parent tag.This will be
nullfor the root tag. -
setComment
Description copied from interface:ConfigTagSets 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
Description copied from interface:ConfigTagSets the comment for this tag.- Specified by:
setCommentin interfaceConfigTag- Parameters:
comment- The comment lines.- Returns:
- The same config tag.
-
setComment
Description copied from interface:ConfigTagSets the comment for this tag.- Specified by:
setCommentin interfaceConfigTag- Parameters:
comment- The comment lines.- Returns:
- The same config tag.
-
getComment
Description copied from interface:ConfigTagGets the comment for the tag.- Specified by:
getCommentin interfaceConfigTag- Returns:
- The comment.
-
onSync
-
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 interfaceConfigTag
-
requiresClientSync
public boolean requiresClientSync()Description copied from interface:ConfigTagChecks if this tag or any of its children require client sync.- Specified by:
requiresClientSyncin interfaceConfigTag- 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.
-
isNetworkTag
public boolean isNetworkTag()Description copied from interface:ConfigTagChecks if this tags is a synthetic network tag.Synthetic network tags will exist on the client when some form of dynamic config structure is synced to the client.
- Specified by:
isNetworkTagin interfaceConfigTag- Returns:
- If the tag is synthetic.
-
isDirty
public boolean isDirty()Description copied from interface:ConfigTagIf thisConfigTagor any of its children are dirty and requires flushing to disk. -
clearDirty
@Internal public void clearDirty() -
copy
Description copied from interface:ConfigTagCreates a deep clone of thisConfigTag.If this is called on a child tag, it will split from its parent.
Does not keep callbacks.
-
copy
-