Interface IOperatorRegistry

All Superinterfaces:
org.cyclops.cyclopscore.init.IRegistry, IVariableFacadeHandler<IOperatorVariableFacade>
All Known Implementing Classes:
OperatorRegistry

public interface IOperatorRegistry extends org.cyclops.cyclopscore.init.IRegistry, IVariableFacadeHandler<IOperatorVariableFacade>
Registry for IOperator
  • Method Details

    • register

      <O extends IOperator> O register(O operator)
      Register a new operator.
      Type Parameters:
      O - The operator type.
      Parameters:
      operator - The operator.
      Returns:
      The registered operator.
    • getOperators

      Collection<IOperator> getOperators()
      Returns:
      All registered operators.
    • getOperator

      IOperator getOperator(net.minecraft.resources.ResourceLocation operatorName)
      Get the operator with the given name.
      Parameters:
      operatorName - The unique operator name.
      Returns:
      The corresponding operator or null.
    • getOperatorsWithInputTypes

      Collection<IOperator> getOperatorsWithInputTypes(IValueType... valueTypes)
      Get the operators with the given input value types in that specific order.
      Parameters:
      valueTypes - The input value types.
      Returns:
      The corresponding operators.
    • getOperatorsWithOutputType

      Collection<IOperator> getOperatorsWithOutputType(IValueType valueType)
      Get the operators with the given output value type.
      Parameters:
      valueType - The output value type.
      Returns:
      The corresponding operators.
    • getOperatorsInCategory

      Collection<IOperator> getOperatorsInCategory(String categoryName)
      Get the operators in the given category.
      Parameters:
      categoryName - The name of the operator category.
      Returns:
      The corresponding operators.
    • registerSerializer

      void registerSerializer(IOperatorSerializer serializer)
      Register an operator serializer.
      Parameters:
      serializer - The operator serializer.
    • serialize

      net.minecraft.nbt.Tag serialize(IOperator value)
      Serialize the given operator.
      Parameters:
      value - The operator to serialize.
      Returns:
      The serialized operator value.
    • deserialize

      IOperator 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.
      Throws:
      EvaluationException - If an error occurs while deserializing.
    • getGlobalInteractOperators

      Map<String,IOperator> getGlobalInteractOperators()
      Returns:
      Mapping of globally interaction names of operators to their instance.
    • getScopedInteractOperators

      Map<IValueType<?>,Map<String,IOperator>> getScopedInteractOperators()
      Returns:
      Mapping of value types to locally interaction names of operators to their instance.