Class ValueTypeNbt
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeBase<ValueTypeNbt.ValueNbt>
org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeNbt
- All Implemented Interfaces:
IValueType<ValueTypeNbt.ValueNbt>,IValueTypeNamed<ValueTypeNbt.ValueNbt>,IValueTypeNullable<ValueTypeNbt.ValueNbt>
public class ValueTypeNbt
extends ValueTypeBase<ValueTypeNbt.ValueNbt>
implements IValueTypeNullable<ValueTypeNbt.ValueNbt>, IValueTypeNamed<ValueTypeNbt.ValueNbt>
Value type with values that are NBT tags.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IValueType
IValueType.ValueTypeComparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Deserialize the given value.net.minecraft.nbt.TagfilterBlacklistedTags(net.minecraft.nbt.Tag tag) Filter away the blacklisted tags from the given NBT tag.Create an immutable default value.getName(ValueTypeNbt.ValueNbt value) booleanparseString(String value) Parse the given string representation of a value.net.minecraft.nbt.Tagserialize(ValueTypeNbt.ValueNbt value) Serialize the given value.net.minecraft.network.chat.MutableComponenttoString(ValueTypeNbt.ValueNbt value) Get the string representation of the given value.Methods inherited from class org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeBase
canDeserialize, cast, correspondsTo, createLogicProgrammerElement, getDisplayColor, getDisplayColorFormat, getModId, getTranslationKey, getTypeName, getTypeNamespace, getUniqueName, getUnlocalizedPrefix, isCategory, isObject, loadTooltip, materialize, registerModelResourceLocation, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IValueType
canDeserialize, cast, correspondsTo, createLogicProgrammerElement, deserializeValuePredicate, getDisplayColor, getDisplayColorFormat, getTranslationKey, getTypeName, getUniqueName, getVariableItemOverrideModel, isCategory, isObject, loadTooltip, materialize, renderISTER
-
Constructor Details
-
ValueTypeNbt
public ValueTypeNbt()
-
-
Method Details
-
getDefault
Description copied from interface:IValueTypeCreate an immutable default value.- Specified by:
getDefaultin interfaceIValueType<ValueTypeNbt.ValueNbt>- Returns:
- The default value of this type.
-
toCompactString
- Specified by:
toCompactStringin interfaceIValueType<ValueTypeNbt.ValueNbt>- Parameters:
value- The value- Returns:
- A short string representation used in guis to show the value.
-
serialize
Description copied from interface:IValueTypeSerialize the given value.- Specified by:
serializein interfaceIValueType<ValueTypeNbt.ValueNbt>- Parameters:
value- The value to serialize.- Returns:
- The serialized value.
-
deserialize
public ValueTypeNbt.ValueNbt deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Description copied from interface:IValueTypeDeserialize the given value.- Specified by:
deserializein interfaceIValueType<ValueTypeNbt.ValueNbt>- Parameters:
valueDeseralizationContext- Deserialization context.value- The value to deserialize.- Returns:
- The deserialized value.
-
toString
Description copied from interface:IValueTypeGet the string representation of the given value. This is useful for cases when the value needs to be edited in a GUI. This corresponds toIValueType.parseString(String).- Specified by:
toStringin interfaceIValueType<ValueTypeNbt.ValueNbt>- Overrides:
toStringin classValueTypeBase<ValueTypeNbt.ValueNbt>- Parameters:
value- A value.- Returns:
- A string representation of the given value.
-
parseString
Description copied from interface:IValueTypeParse the given string representation of a value. This corresponds toIValueType.toString(IValue).- Specified by:
parseStringin interfaceIValueType<ValueTypeNbt.ValueNbt>- Overrides:
parseStringin classValueTypeBase<ValueTypeNbt.ValueNbt>- Parameters:
value- A string representation of a value.- Returns:
- A value.
- Throws:
EvaluationException- If parsing failed.
-
isNull
- Specified by:
isNullin interfaceIValueTypeNullable<ValueTypeNbt.ValueNbt>
-
filterBlacklistedTags
public net.minecraft.nbt.Tag filterBlacklistedTags(net.minecraft.nbt.Tag tag) Filter away the blacklisted tags from the given NBT tag. This won't modify the original tag.- Parameters:
tag- The tag.- Returns:
- The tag where all blacklisted tags have been removed.
-
getName
- Specified by:
getNamein interfaceIValueTypeNamed<ValueTypeNbt.ValueNbt>
-