Class OperatorRegistry
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.operator.OperatorRegistry
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry,IOperatorRegistry,IVariableFacadeHandler<IOperatorVariableFacade>
Registry for
IOperator-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(net.minecraft.nbt.Tag value) Deserialize the given operator value.deserializeVariablePredicate(com.google.gson.JsonObject element, IValueType valueType, ValuePredicate valuePredicate) Deserialize the given JSON element to a variable predicate.static OperatorRegistrygetOperator(net.minecraft.resources.ResourceLocation uniqueName) Get the operator with the given name.getOperatorsInCategory(String categoryName) Get the operators in the given category.getOperatorsWithInputTypes(IValueType... valueTypes) Get the operators with the given input value types in that specific order.getOperatorsWithOutputType(IValueType valueType) Get the operators with the given output value type.Map<IValueType<?>,Map<String, IOperator>> net.minecraft.resources.ResourceLocationgetVariableFacade(int id, net.minecraft.nbt.CompoundTag tag) Get the variable facade for the given tag.<O extends IOperator>
Oregister(O operator) Register a new operator.voidregisterSerializer(IOperatorSerializer serializer) Register an operator serializer.net.minecraft.nbt.TagSerialize the given operator.voidsetVariableFacade(net.minecraft.nbt.CompoundTag tag, IOperatorVariableFacade variableFacade) Set the variable facade for the given tag.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.item.IVariableFacadeHandler
deserializeVariableFacadePredicate
-
Method Details
-
getInstance
- Returns:
- The unique instance.
-
register
Description copied from interface:IOperatorRegistryRegister a new operator.- Specified by:
registerin interfaceIOperatorRegistry- Type Parameters:
O- The operator type.- Parameters:
operator- The operator.- Returns:
- The registered operator.
-
getOperators
- Specified by:
getOperatorsin interfaceIOperatorRegistry- Returns:
- All registered operators.
-
getOperator
Description copied from interface:IOperatorRegistryGet the operator with the given name.- Specified by:
getOperatorin interfaceIOperatorRegistry- Parameters:
uniqueName- The unique operator name.- Returns:
- The corresponding operator or null.
-
getOperatorsWithInputTypes
Description copied from interface:IOperatorRegistryGet the operators with the given input value types in that specific order.- Specified by:
getOperatorsWithInputTypesin interfaceIOperatorRegistry- Parameters:
valueTypes- The input value types.- Returns:
- The corresponding operators.
-
getOperatorsWithOutputType
Description copied from interface:IOperatorRegistryGet the operators with the given output value type.- Specified by:
getOperatorsWithOutputTypein interfaceIOperatorRegistry- Parameters:
valueType- The output value type.- Returns:
- The corresponding operators.
-
getOperatorsInCategory
Description copied from interface:IOperatorRegistryGet the operators in the given category.- Specified by:
getOperatorsInCategoryin interfaceIOperatorRegistry- Parameters:
categoryName- The name of the operator category.- Returns:
- The corresponding operators.
-
registerSerializer
Description copied from interface:IOperatorRegistryRegister an operator serializer.- Specified by:
registerSerializerin interfaceIOperatorRegistry- Parameters:
serializer- The operator serializer.
-
serialize
Description copied from interface:IOperatorRegistrySerialize the given operator.- Specified by:
serializein interfaceIOperatorRegistry- Parameters:
value- The operator to serialize.- Returns:
- The serialized operator value.
-
deserialize
Description copied from interface:IOperatorRegistryDeserialize the given operator value.- Specified by:
deserializein interfaceIOperatorRegistry- Parameters:
value- The operator value to deserialize.- Returns:
- The deserialized operator.
- Throws:
EvaluationException- If an error occurs while deserializing.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueNamein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Returns:
- The unique name of this type used to identity variables to this handler.
-
getVariableFacade
Description copied from interface:IVariableFacadeHandlerGet the variable facade for the given tag.- Specified by:
getVariableFacadein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
id- The id that was read and needs to be inserted into the variable facade.tag- The tag containing information that can be read and used to form a variable facade.- Returns:
- The variable facade
-
setVariableFacade
public void setVariableFacade(net.minecraft.nbt.CompoundTag tag, IOperatorVariableFacade variableFacade) Description copied from interface:IVariableFacadeHandlerSet the variable facade for the given tag.- Specified by:
setVariableFacadein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
tag- The tag that is used to write variable facade information to.variableFacade- The facade to write.
-
deserializeVariablePredicate
public VariablePredicate deserializeVariablePredicate(com.google.gson.JsonObject element, @Nullable IValueType valueType, ValuePredicate valuePredicate) Description copied from interface:IVariableFacadeHandlerDeserialize the given JSON element to a variable predicate.- Specified by:
deserializeVariablePredicatein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
element- The JSON element.valueType- The optional value type.valuePredicate- The value predicate.- Returns:
- The variable predicate.
-
getGlobalInteractOperators
- Specified by:
getGlobalInteractOperatorsin interfaceIOperatorRegistry- Returns:
- Mapping of globally interaction names of operators to their instance.
-
getScopedInteractOperators
- Specified by:
getScopedInteractOperatorsin interfaceIOperatorRegistry- Returns:
- Mapping of value types to locally interaction names of operators to their instance.
-