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.world.level.storage.ValueInput valueInput) Deserialize the given operator value.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(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tag) Get the variable facade for the given tag.booleanisInstance(IVariable<?> variable) If the given variable is created by this handler.booleanisInstance(IVariableFacade variableFacade) If the given facade is created by this handler.<O extends IOperator>
Oregister(O operator) Register a new operator.voidregisterSerializer(IOperatorSerializer serializer) Register an operator serializer.voidSerialize the given operator.voidsetVariableFacade(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag, IOperatorVariableFacade variableFacade) Set the variable facade for the given tag.
-
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:
valueOutput- The value output.value- The operator to serialize.
-
deserialize
public IOperator deserialize(net.minecraft.world.level.storage.ValueInput valueInput) throws EvaluationException Description copied from interface:IOperatorRegistryDeserialize the given operator value.- Specified by:
deserializein interfaceIOperatorRegistry- Parameters:
valueInput- 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
public IOperatorVariableFacade getVariableFacade(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tag) Description copied from interface:IVariableFacadeHandlerGet the variable facade for the given tag.- Specified by:
getVariableFacadein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
valueDeseralizationContext-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(ValueDeseralizationContext valueDeseralizationContext, 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:
valueDeseralizationContext-tag- The tag that is used to write variable facade information to.variableFacade- The facade to write.
-
isInstance
Description copied from interface:IVariableFacadeHandlerIf the given facade is created by this handler.- Specified by:
isInstancein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
variableFacade- A facade.- Returns:
- If it is an instance.
-
isInstance
Description copied from interface:IVariableFacadeHandlerIf the given variable is created by this handler.- Specified by:
isInstancein interfaceIVariableFacadeHandler<IOperatorVariableFacade>- Parameters:
variable- A variable.- Returns:
- If it is an instance.
-
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.
-