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 Details

    • canHandle

      boolean canHandle(IOperator operator)
      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

      net.minecraft.nbt.Tag serialize(ValueDeseralizationContext valueDeseralizationContext, O operator)
      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