Interface IOperatorSerializer<O extends IOperator>
- Type Parameters:
O
- The operator type
- All Known Implementing Classes:
CombinedOperator.Conjunction.Serializer
,CombinedOperator.Disjunction.Serializer
,CombinedOperator.Flip.Serializer
,CombinedOperator.ListOperatorSerializer
,CombinedOperator.Negation.Serializer
,CombinedOperator.Pipe.Serializer
,CombinedOperator.Pipe2.Serializer
,CurriedOperator.Serializer
,OperatorSerializerDefault
,PositionedOperator.Serializer
,PredicateOperator.Serializer
public interface IOperatorSerializer<O extends IOperator>
A serialization action for operators.
-
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 the given operator.
-
Method Details
-
canHandle
- Parameters:
operator
- The operator to test.- Returns:
- If this can serialize the given operator.
-
getUniqueName
net.minecraft.resources.ResourceLocation getUniqueName()- Returns:
- The unique name of this serializer.
-
serialize
Serialize the given operator.- Parameters:
operator
- The operator to serialize.- Returns:
- The serialized operator value.
-
deserialize
O deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) throws EvaluationException Deserialize the given operator value.- Parameters:
valueDeseralizationContext
-value
- The operator value to deserialize.- Returns:
- The deserialized operator, null if deserialization failed.
- Throws:
EvaluationException
- If something goes wrong while deserializing
-