Class ConfigValueListImpl
- All Implemented Interfaces:
ConfigTag,ConfigValueList
-
Field Summary
Fields inherited from class codechicken.lib.config.AbstractConfigTag
comment, dirty, networkSynthetic, syncToClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy(@Nullable ConfigCategoryImpl parent) it.unimi.dsi.fastutil.booleans.BooleanListGets theBooleanListvalues stored in this tag.it.unimi.dsi.fastutil.booleans.BooleanListGets the defaultBooleanListvalues stored in this tag.it.unimi.dsi.fastutil.doubles.DoubleListGets the defaultDoubleListvalues stored in this tag.it.unimi.dsi.fastutil.ints.IntListGets the defaultIntListvalues represented as Hex strings stored in this tag.it.unimi.dsi.fastutil.ints.IntListGets the defaultIntListvalues stored in this tag.it.unimi.dsi.fastutil.longs.LongListGets the defaultLongListvalues stored in this tag.it.unimi.dsi.fastutil.doubles.DoubleListGets theDoubleListvalues stored in this tag.it.unimi.dsi.fastutil.ints.IntListgetHexs()Gets theIntListvalues stored as a Hex strings stored in this tag.it.unimi.dsi.fastutil.ints.IntListgetInts()Gets theIntListvalues stored in this tag.it.unimi.dsi.fastutil.longs.LongListgetLongs()Gets theLongListvalue stored in this tag.List<?>@Nullable ListRestrictionGets theRestrictionpredicate for this tag.getType()Gets the type of theConfigValueList.voidread(MCDataInput in) Read this tag from aMCDataInput.voidreset()Reset this tag back to the default.voidResets all network tags back to their original value.setBooleans(List<Boolean> values) setDefaultBooleans(List<Boolean> values) setDefaultDoubles(List<Double> values) setDefaultHexs(List<Integer> values) setDefaultInts(List<Integer> values) setDefaultLongs(List<Long> values) setDefaultStrings(List<String> values) setDefaultValue(List<?> value) setDoubles(List<Double> values) voidsetKnownType(ValueType type) setRestriction(ListRestriction restriction) // TODO Improve wording for lists.setStrings(List<String> values) voidwrite(MCDataOutput out) Write this tag to aMCDataOutput.Methods inherited from class codechicken.lib.config.AbstractConfigTag
clearDirty, copy, getComment, getName, getParent, isDirty, isNetworkTag, onSync, requiresClientSync, runSync, setComment, setComment, setComment, syncTagToClientMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface codechicken.lib.config.ConfigTag
copy, delete, forceSync, getComment, getDesc, getName, getParent, isDirty, isNetworkTag, requiresClientSync, runSync, saveMethods inherited from interface codechicken.lib.config.ConfigValueList
onSync, setComment, setComment, setComment, syncTagToClient
-
Constructor Details
-
ConfigValueListImpl
-
-
Method Details
-
getType
Description copied from interface:ConfigValueListGets the type of theConfigValueList.- Specified by:
getTypein interfaceConfigValueList- Returns:
- The
ValueTypeof this tag.
-
getBooleans
public it.unimi.dsi.fastutil.booleans.BooleanList getBooleans()Description copied from interface:ConfigValueListGets theBooleanListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getBooleansin interfaceConfigValueList- Returns:
- The boolean value or the default.
-
getStrings
Description copied from interface:ConfigValueListGets theListofStringvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getStringsin interfaceConfigValueList- Returns:
- The String value or the default.
-
getInts
public it.unimi.dsi.fastutil.ints.IntList getInts()Description copied from interface:ConfigValueListGets theIntListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getIntsin interfaceConfigValueList- Returns:
- The int value or the default.
-
getLongs
public it.unimi.dsi.fastutil.longs.LongList getLongs()Description copied from interface:ConfigValueListGets theLongListvalue stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getLongsin interfaceConfigValueList- Returns:
- The long value or the default.
-
getHexs
public it.unimi.dsi.fastutil.ints.IntList getHexs()Description copied from interface:ConfigValueListGets theIntListvalues stored as a Hex strings stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getHexsin interfaceConfigValueList- Returns:
- The int value or the default.
-
getDoubles
public it.unimi.dsi.fastutil.doubles.DoubleList getDoubles()Description copied from interface:ConfigValueListGets theDoubleListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDoublesin interfaceConfigValueList- Returns:
- The double value or the default.
-
setBooleans
Description copied from interface:ConfigValueListSets theListofBooleanvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setBooleansin interfaceConfigValueList- Parameters:
values- TheListofBooleanvalues.- Returns:
- The same
ConfigValueList.
-
setStrings
Description copied from interface:ConfigValueListSets theListofStringvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setStringsin interfaceConfigValueList- Parameters:
values- TheListofStringvalues.- Returns:
- The same
ConfigValueList.
-
setInts
Description copied from interface:ConfigValueListSets theListofIntegervalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setIntsin interfaceConfigValueList- Parameters:
values- TheListofIntegervalues.- Returns:
- The same
ConfigValueList.
-
setLongs
Description copied from interface:ConfigValueListSets theListofLongvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setLongsin interfaceConfigValueList- Parameters:
values- TheListofLongvalues.- Returns:
- The same
ConfigValueList.
-
setHexs
Description copied from interface:ConfigValueListSets theListofIntegervalues represented as hex Strings stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setHexsin interfaceConfigValueList- Parameters:
values- TheListofIntegervalues.- Returns:
- The same
ConfigValueList.
-
setDoubles
Description copied from interface:ConfigValueListSets theListofDoublevalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDoublesin interfaceConfigValueList- Parameters:
values- TheListofDoublevalues.- Returns:
- The same
ConfigValueList.
-
getDefaultBooleans
public it.unimi.dsi.fastutil.booleans.BooleanList getDefaultBooleans()Description copied from interface:ConfigValueListGets the defaultBooleanListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultBooleansin interfaceConfigValueList- Returns:
- The default
BooleanListvalues.
-
getDefaultStrings
Description copied from interface:ConfigValueListGets the defaultListofStringvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultStringsin interfaceConfigValueList- Returns:
- The default
ListofStringvalues.
-
getDefaultInts
public it.unimi.dsi.fastutil.ints.IntList getDefaultInts()Description copied from interface:ConfigValueListGets the defaultIntListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultIntsin interfaceConfigValueList- Returns:
- The default
LongListvalues.
-
getDefaultLongs
public it.unimi.dsi.fastutil.longs.LongList getDefaultLongs()Description copied from interface:ConfigValueListGets the defaultLongListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultLongsin interfaceConfigValueList- Returns:
- The default
LongListvalues.
-
getDefaultHexs
public it.unimi.dsi.fastutil.ints.IntList getDefaultHexs()Description copied from interface:ConfigValueListGets the defaultIntListvalues represented as Hex strings stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultHexsin interfaceConfigValueList- Returns:
- The default
IntListvalues.
-
getDefaultDoubles
public it.unimi.dsi.fastutil.doubles.DoubleList getDefaultDoubles()Description copied from interface:ConfigValueListGets the defaultDoubleListvalues stored in this tag.No attempt to convert between tag types is made, this must be called on a tag which has a non
ValueType.UNKNOWNtype.- Specified by:
getDefaultDoublesin interfaceConfigValueList- Returns:
- The default
DoubleListvalues.
-
setDefaultBooleans
Description copied from interface:ConfigValueListSets the defaultListofBooleanvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultBooleansin interfaceConfigValueList- Parameters:
values- TheListofBooleanvalues.- Returns:
- The same
ConfigValueList.
-
setDefaultStrings
Description copied from interface:ConfigValueListSets the defaultListofStringvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultStringsin interfaceConfigValueList- Parameters:
values- TheListofStringvalues.- Returns:
- The same
ConfigValueList.
-
setDefaultInts
Description copied from interface:ConfigValueListSets the defaultListofIntegervalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultIntsin interfaceConfigValueList- Parameters:
values- TheListofIntegervalues.- Returns:
- The same
ConfigValueList.
-
setDefaultLongs
Description copied from interface:ConfigValueListSets the defaultListofLongvalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultLongsin interfaceConfigValueList- Parameters:
values- TheListofLongvalues.- Returns:
- The same
ConfigValueList.
-
setDefaultHexs
Description copied from interface:ConfigValueListSets the defaultListofIntegervalues represented as hex Strings stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultHexsin interfaceConfigValueList- Parameters:
values- TheListofIntegervalues.- Returns:
- The same
ConfigValueList.
-
setDefaultDoubles
Description copied from interface:ConfigValueListSets the defaultListofDoublevalues stored in this tag.If the tag has an
ValueType.UNKNOWNvalue type, this function will set it appropriately.- Specified by:
setDefaultDoublesin interfaceConfigValueList- Parameters:
values- TheListofDoublevalues.- Returns:
- The same
ConfigValueList.
-
setRestriction
Description copied from interface:ConfigValueList// TODO Improve wording for lists. Set theRestrictionfor thisConfigValueList.A restriction is just a
Predicate, and can be used for anything, but is most commonly used for int/float value ranges on tags.If the restriction is violated, either by the tag being loaded from disk, or via a set method, it will be reset to default.
TODO, in the future, provide a function to choose what to do when a value is invalid, allow the value to be altered (clamped), removed, or reset entirely to default.
It is invalid for the restriction to not accept the tag's default value, if the restriction does not, it will throw an
IllegalArgumentExceptioneither when the restriction is set, or the default is set, whichever comes last.See
Restrictionfor more information.- Specified by:
setRestrictionin interfaceConfigValueList- Parameters:
restriction- The restriction to set.- Returns:
- The same
ConfigValueList. - See Also:
-
getRestriction
Description copied from interface:ConfigValueListGets theRestrictionpredicate for this tag.- Specified by:
getRestrictionin interfaceConfigValueList- Returns:
- The
Restriction
-
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. -
copy
- Specified by:
copyin classAbstractConfigTag<ConfigValueList>
-
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
-
setValue
-
getRawValue
-
setDefaultValue
-
setKnownType
-