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(net.minecraft.world.level.storage.ValueInput valueInput)
    Deserialize the given operator value.
    net.minecraft.resources.Identifier
     
    default boolean
    If the operators handled by this serializer are materialized, meaning that they can exist without any external references.
    void
    serialize(net.minecraft.world.level.storage.ValueOutput valueOutput, 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.Identifier getUniqueName()
      Returns:
      The unique name of this serializer.
    • isMaterialized

      default boolean isMaterialized()
      If the operators handled by this serializer are materialized, meaning that they can exist without any external references. Only materialized operators can be shared between worlds.
      Returns:
      If the handled operators are materialized.
    • serialize

      void serialize(net.minecraft.world.level.storage.ValueOutput valueOutput, O operator)
      Serialize the given operator.
      Parameters:
      valueOutput -
      operator - The operator to serialize.
    • deserialize

      O deserialize(net.minecraft.world.level.storage.ValueInput valueInput) throws EvaluationException
      Deserialize the given operator value.
      Parameters:
      valueInput -
      Returns:
      The deserialized operator, null if deserialization failed.
      Throws:
      EvaluationException - If something goes wrong while deserializing