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.Component
canDeserialize
(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.boolean
correspondsTo
(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.int
net.minecraft.ChatFormatting
net.minecraft.resources.ResourceLocation
boolean
boolean
isObject()
void
loadTooltip
(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.void
serialize
(net.minecraft.world.level.storage.ValueOutput valueOutput, DummyValueType.DummyValue value) Serialize the given value.net.minecraft.network.chat.MutableComponent
Get the string representation of the given value.
-
Field Details
-
TYPE
-
-
Constructor Details
-
DummyValueType
public DummyValueType()
-
-
Method Details
-
getClient
- Specified by:
getClient
in interfaceIValueType<DummyValueType.DummyValue>
-
isCategory
public boolean isCategory()- Specified by:
isCategory
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- If this type is a category and should be handled accordingly.
-
isObject
public boolean isObject()- Specified by:
isObject
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- If this type is an object type, otherwise it is a raw type.
-
getDefault
Description copied from interface:IValueType
Create an immutable default value.- Specified by:
getDefault
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- The default value of this type.
-
getTypeName
- Specified by:
getTypeName
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- The name of this type without any prefixes.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueName
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- The unique name for this value type, only used for internal storage.
-
getTranslationKey
- Specified by:
getTranslationKey
in 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:IValueType
Add tooltip lines for this aspect when hovered in a gui.- Specified by:
loadTooltip
in 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:
toCompactString
in 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:
getDisplayColor
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- The color that is used to identify this value type.
-
getDisplayColorFormat
public net.minecraft.ChatFormatting getDisplayColorFormat()- Specified by:
getDisplayColorFormat
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- The color that is used to identify this value type using MC formatting codes.
-
correspondsTo
Description copied from interface:IValueType
Check if the given type corresponds with this type. To check bidirectional, useValueHelpers.correspondsTo(IValueType, IValueType)
.- Specified by:
correspondsTo
in 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:IValueType
Serialize the given value.- Specified by:
serialize
in 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:IValueType
Check if the given value can be deserialized.- Specified by:
canDeserialize
in 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:IValueType
Deserialize the given value.- Specified by:
deserialize
in interfaceIValueType<DummyValueType.DummyValue>
- Parameters:
valueInput
- The value to deserialize.- Returns:
- The deserialized value.
-
materialize
Description copied from interface:IValueType
Materialize the given value so that it can exist without any external references.- Specified by:
materialize
in interfaceIValueType<DummyValueType.DummyValue>
- Parameters:
value
- The value to materialize.- Returns:
- The materialized value.
-
toString
Description copied from interface:IValueType
Get 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:
toString
in interfaceIValueType<DummyValueType.DummyValue>
- Parameters:
value
- A value.- Returns:
- A string representation of the given value.
-
parseString
Description copied from interface:IValueType
Parse the given string representation of a value. This corresponds toIValueType.toString(IValue)
.- Specified by:
parseString
in interfaceIValueType<DummyValueType.DummyValue>
- Parameters:
value
- A string representation of a value.- Returns:
- A value.
- Throws:
EvaluationException
- If parsing failed.
-
createLogicProgrammerElement
- Specified by:
createLogicProgrammerElement
in interfaceIValueType<DummyValueType.DummyValue>
- Returns:
- A new logic programmer element for this value type.
-
cast
Description copied from interface:IValueType
Attempt to cast the given value to a value of this value type.- Specified by:
cast
in interfaceIValueType<DummyValueType.DummyValue>
- Parameters:
value
- A value of unknown type.- Returns:
- The casted value.
- Throws:
EvaluationException
- If the incorrect value type was found.
-