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 Type
    Method
    Description
    boolean
    canHandle(IOperator operator)
     
    deserialize(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.Tag value)
    Deserialize the given operator value.
    net.minecraft.resources.ResourceLocation
     
    net.minecraft.nbt.Tag
    serialize(O operator)
    Serialize the given operator.
  • 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(O operator)
      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