Class PositionedOperator.Serializer
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.operator.PositionedOperator.Serializer
- All Implemented Interfaces:
IOperatorSerializer<PositionedOperator>
- Enclosing class:
PositionedOperator
public static class PositionedOperator.Serializer
extends Object
implements IOperatorSerializer<PositionedOperator>
-
Constructor Summary
ConstructorDescriptionSerializer
(Class<? extends PositionedOperator> clazz, net.minecraft.resources.ResourceLocation uniqueName) -
Method Summary
Modifier and TypeMethodDescriptionboolean
deserialize
(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Deserialize the given operator value.net.minecraft.resources.ResourceLocation
net.minecraft.nbt.Tag
serialize
(ValueDeseralizationContext valueDeseralizationContext, PositionedOperator operator) Serialize the given operator.
-
Constructor Details
-
Serializer
public Serializer(Class<? extends PositionedOperator> clazz, net.minecraft.resources.ResourceLocation uniqueName)
-
-
Method Details
-
canHandle
- Specified by:
canHandle
in interfaceIOperatorSerializer<PositionedOperator>
- Parameters:
operator
- The operator to test.- Returns:
- If this can serialize the given operator.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueName
in interfaceIOperatorSerializer<PositionedOperator>
- Returns:
- The unique name of this serializer.
-
serialize
public net.minecraft.nbt.Tag serialize(ValueDeseralizationContext valueDeseralizationContext, PositionedOperator operator) Description copied from interface:IOperatorSerializer
Serialize the given operator.- Specified by:
serialize
in interfaceIOperatorSerializer<PositionedOperator>
- Parameters:
valueDeseralizationContext
-operator
- The operator to serialize.- Returns:
- The serialized operator value.
-
deserialize
public PositionedOperator deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) throws EvaluationException Description copied from interface:IOperatorSerializer
Deserialize the given operator value.- Specified by:
deserialize
in interfaceIOperatorSerializer<PositionedOperator>
- Parameters:
valueDeseralizationContext
-value
- The operator value to deserialize.- Returns:
- The deserialized operator, null if deserialization failed.
- Throws:
EvaluationException
- If something goes wrong while deserializing
-