Interface IOperator
- All Known Implementing Classes:
CastOperator,CombinedOperator,CompositionalOperator,CurriedOperator,GeneralChoiceOperator,GeneralConstantOperator,GeneralIdentityOperator,GeneralOperator,OperatorBase,ParseOperator,PositionedOperator,PositionedOperatorNetworkVariableById,PositionedOperatorRecipeHandler,PositionedOperatorRecipeHandlerInputs,PositionedOperatorRecipeHandlerOutput,PositionedOperatorRecipeHandlerRecipeByInput,PositionedOperatorRecipeHandlerRecipeByOutput,PositionedOperatorRecipeHandlerRecipesByInput,PositionedOperatorRecipeHandlerRecipesByOutput,PredicateOperator
public interface IOperator
Relation on value types.
-
Method Summary
Modifier and TypeMethodDescriptionEvaluate the given input values for this operator.getConditionalOutputType(IVariable[] input) Get the output value type depending on the active input of the operator.default Stringnet.minecraft.network.chat.MutableComponentintdefault Stringnet.minecraft.resources.ResourceLocationvoidloadTooltip(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo) Add tooltip lines for this aspect when hovered in a gui.Materialize this operator so that it can exist without any external references.booleannet.minecraft.network.chat.MutableComponentvalidateTypes(IValueType[] input) Check the given input value types for this operator.
-
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
- 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
- Returns:
- The global interact name.
-
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(Consumer<net.minecraft.network.chat.Component> tooltipAdder, boolean appendOptionalInfo) Add tooltip lines for this aspect when hovered in a gui.- Parameters:
tooltipAdder- 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
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
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
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
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.
-