Class DummyValueType
java.lang.Object
org.cyclops.integrateddynamics.gametest.integration.DummyValueType
- All Implemented Interfaces:
IValueType<DummyValueType.DummyValue>
Dummy value type
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.cyclops.integrateddynamics.api.evaluate.variable.IValueType
IValueType.ValueTypeComparator -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentcanDeserialize(net.minecraft.world.level.storage.ValueInput valueInput) Check if the given value can be deserialized.Attempt to cast the given value to a value of this value type.booleancorrespondsTo(IValueType valueType) Check if the given type corresponds with this type.deserialize(net.minecraft.world.level.storage.ValueInput valueInput) Deserialize the given value.Create an immutable default value.intnet.minecraft.ChatFormattingnet.minecraft.resources.ResourceLocationbooleanbooleanisObject()voidloadTooltip(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo, DummyValueType.DummyValue value) Add tooltip lines for this aspect when hovered in a gui.Materialize the given value so that it can exist without any external references.parseString(String value) Parse the given string representation of a value.voidserialize(net.minecraft.world.level.storage.ValueOutput valueOutput, DummyValueType.DummyValue value) Serialize the given value.net.minecraft.network.chat.MutableComponentGet the string representation of the given value.
-
Field Details
-
TYPE
-
-
Constructor Details
-
DummyValueType
public DummyValueType()
-
-
Method Details
-
getClient
- Specified by:
getClientin interfaceIValueType<DummyValueType.DummyValue>
-
isCategory
public boolean isCategory()- Specified by:
isCategoryin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- If this type is a category and should be handled accordingly.
-
isObject
public boolean isObject()- Specified by:
isObjectin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- If this type is an object type, otherwise it is a raw type.
-
getDefault
Description copied from interface:IValueTypeCreate an immutable default value.- Specified by:
getDefaultin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The default value of this type.
-
getTypeName
- Specified by:
getTypeNamein interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The name of this type without any prefixes.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueNamein interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The unique name for this value type, only used for internal storage.
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The unique name of this type that will also be used for display.
-
loadTooltip
public void loadTooltip(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo, @Nullable DummyValueType.DummyValue value) Description copied from interface:IValueTypeAdd tooltip lines for this aspect when hovered in a gui.- Specified by:
loadTooltipin interfaceIValueType<DummyValueType.DummyValue>- Parameters:
tooltipAdder- The list to add lines to.appendOptionalInfo- If shift-to-show info should be added.value- The value to show the tooltip for.
-
toCompactString
- Specified by:
toCompactStringin interfaceIValueType<DummyValueType.DummyValue>- Parameters:
value- The value- Returns:
- A short string representation used in guis to show the value.
-
getDisplayColor
public int getDisplayColor()- Specified by:
getDisplayColorin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The color that is used to identify this value type.
-
getDisplayColorFormat
public net.minecraft.ChatFormatting getDisplayColorFormat()- Specified by:
getDisplayColorFormatin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- The color that is used to identify this value type using MC formatting codes.
-
correspondsTo
Description copied from interface:IValueTypeCheck if the given type corresponds with this type. To check bidirectional, useValueHelpers.correspondsTo(IValueType, IValueType).- Specified by:
correspondsToin interfaceIValueType<DummyValueType.DummyValue>- Parameters:
valueType- The value type to check correspondence with.- Returns:
- If the given value type can be used with this value type.
-
serialize
public void serialize(net.minecraft.world.level.storage.ValueOutput valueOutput, DummyValueType.DummyValue value) Description copied from interface:IValueTypeSerialize the given value.- Specified by:
serializein interfaceIValueType<DummyValueType.DummyValue>- Parameters:
valueOutput- Where to write the value to.value- The value to serialize.
-
canDeserialize
public net.minecraft.network.chat.Component canDeserialize(net.minecraft.world.level.storage.ValueInput valueInput) Description copied from interface:IValueTypeCheck if the given value can be deserialized.- Specified by:
canDeserializein interfaceIValueType<DummyValueType.DummyValue>- Parameters:
valueInput- The value to deserialize.- Returns:
- An error or null.
-
deserialize
public DummyValueType.DummyValue deserialize(net.minecraft.world.level.storage.ValueInput valueInput) Description copied from interface:IValueTypeDeserialize the given value.- Specified by:
deserializein interfaceIValueType<DummyValueType.DummyValue>- Parameters:
valueInput- The value to deserialize.- Returns:
- The deserialized value.
-
materialize
Description copied from interface:IValueTypeMaterialize the given value so that it can exist without any external references.- Specified by:
materializein interfaceIValueType<DummyValueType.DummyValue>- Parameters:
value- The value to materialize.- Returns:
- The materialized 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<DummyValueType.DummyValue>- 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<DummyValueType.DummyValue>- Parameters:
value- A string representation of a value.- Returns:
- A value.
- Throws:
EvaluationException- If parsing failed.
-
createLogicProgrammerElement
- Specified by:
createLogicProgrammerElementin interfaceIValueType<DummyValueType.DummyValue>- Returns:
- A new logic programmer element for this value type.
-
cast
Description copied from interface:IValueTypeAttempt to cast the given value to a value of this value type.- Specified by:
castin interfaceIValueType<DummyValueType.DummyValue>- Parameters:
value- A value of unknown type.- Returns:
- The casted value.
- Throws:
EvaluationException- If the incorrect value type was found.
-