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 TypeMethodDescriptionbooleandeserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value) Deserialize the given operator value.net.minecraft.resources.ResourceLocationnet.minecraft.nbt.Tagserialize(ValueDeseralizationContext valueDeseralizationContext, O operator) 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:
valueDeseralizationContext-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
-