All Known Implementing Classes:
CastOperator, CombinedOperator, CompositionalOperator, CurriedOperator, GeneralChoiceOperator, GeneralConstantOperator, GeneralIdentityOperator, GeneralOperator, OperatorBase, ParseOperator, PositionedOperator, PositionedOperatorRecipeHandler, PositionedOperatorRecipeHandlerInputs, PositionedOperatorRecipeHandlerOutput, PositionedOperatorRecipeHandlerRecipeByInput, PositionedOperatorRecipeHandlerRecipeByOutput, PositionedOperatorRecipeHandlerRecipesByInput, PositionedOperatorRecipeHandlerRecipesByOutput, PredicateOperator

public interface IOperator
Relation on value types.
  • Method Details

    • getSymbol

      String getSymbol()
      Returns:
      The unique name of this operator that will also be used for display.
    • getUniqueName

      net.minecraft.resources.ResourceLocation getUniqueName()
      Returns:
      The unique name for this operator, only used for internal storage.
    • getInteractName

      String getInteractName()
      Returns:
      The unique interact name for this operator, when interacting with this operator using external contexts, such as Integrated Scripting.
    • getGlobalInteractNamePrefix

      @Nullable String getGlobalInteractNamePrefix()
      Returns:
      Override for the default global interact name prefix.
    • shouldAlsoPrefixLocalScope

      boolean shouldAlsoPrefixLocalScope()
      Returns:
      If the global interact name prefix should also be used for local scopes.
    • getGlobalInteractName

      default String getGlobalInteractName()
      Returns:
      The global interact name.
    • getScopedInteractName

      default String getScopedInteractName()
      Returns:
      The scoped interact name.
    • getTranslationKey

      String getTranslationKey()
      Returns:
      The unique unlocalized name for this operator.
    • getUnlocalizedCategoryName

      String getUnlocalizedCategoryName()
      Returns:
      The unique unlocalized category name for this operator.
    • getLocalizedNameFull

      net.minecraft.network.chat.MutableComponent getLocalizedNameFull()
      Returns:
      The localized full name for this operator, includes category name
    • loadTooltip

      void loadTooltip(List<net.minecraft.network.chat.Component> lines, boolean appendOptionalInfo)
      Add tooltip lines for this aspect when hovered in a gui.
      Parameters:
      lines - The list to add lines to.
      appendOptionalInfo - If shift-to-show info should be added.
    • getInputTypes

      IValueType[] getInputTypes()
      Returns:
      The ordered types of values that are used as input for this operator.
    • getOutputType

      IValueType getOutputType()
      Returns:
      The type of value that is achieved when this operator is executed.
    • getConditionalOutputType

      IValueType getConditionalOutputType(IVariable[] input)
      Get the output value type depending on the active input of the operator.
      Parameters:
      input - The input that would be given during evaluation.
      Returns:
      The type of value that is achieved when this operator is executed.
    • evaluate

      IValue evaluate(IVariable... input) throws EvaluationException
      Evaluate the given input values for this operator.
      Parameters:
      input - The ordered input values.
      Returns:
      The output value.
      Throws:
      EvaluationException - When something went wrong while evaluating.
    • getRequiredInputLength

      int getRequiredInputLength()
      Returns:
      The required input length.
    • validateTypes

      net.minecraft.network.chat.MutableComponent validateTypes(IValueType[] input)
      Check the given input value types for this operator.
      Parameters:
      input - The ordered input value types.
      Returns:
      An error or null if valid.
    • getRenderPattern

      IConfigRenderPattern getRenderPattern()
      Returns:
      The render pattern for this operator inside the logic programmer.
    • materialize

      IOperator materialize() throws EvaluationException
      Materialize this operator so that it can exist without any external references.
      Returns:
      The materialized operator.
      Throws:
      EvaluationException - if materialization fails because of a variable evaluation.