Class ValueTypeRegistry
java.lang.Object
org.cyclops.integrateddynamics.core.evaluate.variable.ValueTypeRegistry
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry,IValueTypeRegistry,IVariableFacadeHandler<IValueTypeVariableFacade>
Registry for
IValueType.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondeserializeVariableFacadePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element) Deserialize the given JSON element to a variable facade predicate.static ValueTypeRegistrynet.minecraft.resources.ResourceLocationgetValueType(net.minecraft.resources.ResourceLocation name) Get the value type by name.<V extends IValue,T extends IValueType<V>>
net.minecraft.resources.ResourceLocationgetValueTypeModel(T valueType) Get the model resource location of the given value type.Collection<net.minecraft.resources.ResourceLocation>Get all registered model resource locations for the value types.getVariableFacade(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tag) Get the variable facade for the given tag.<V extends IValue,T extends IValueType<V>>
Tregister(T valueType) Register a new value type.<V extends IValue,T extends IValueTypeCategory<V>>
TregisterCategory(T category) Register a new value category.<V extends IValue,T extends IValueType<V>>
voidregisterValueTypeModel(T valueType, net.minecraft.resources.ResourceLocation modelLocation) Register a model resource location for the given value type.voidsetVariableFacade(net.minecraft.nbt.CompoundTag tag, IValueTypeVariableFacade 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
deserializeVariablePredicate
-
Method Details
-
getInstance
- Returns:
- The unique instance.
-
register
Description copied from interface:IValueTypeRegistryRegister a new value type.- Specified by:
registerin interfaceIValueTypeRegistry- Type Parameters:
V- The value type.T- The value type type.- Parameters:
valueType- The part type.- Returns:
- The registered value type.
-
registerCategory
Description copied from interface:IValueTypeRegistryRegister a new value category. This registration can be overwritten, so only the last registered category is remembered.- Specified by:
registerCategoryin interfaceIValueTypeRegistry- Type Parameters:
V- The value type.T- The value type type.- Parameters:
category- The category.- Returns:
- The registered category.
-
getValueType
Description copied from interface:IValueTypeRegistryGet the value type by name.- Specified by:
getValueTypein interfaceIValueTypeRegistry- Parameters:
name- The unique name.- Returns:
- The value type or null if not found.
-
registerValueTypeModel
public <V extends IValue,T extends IValueType<V>> void registerValueTypeModel(T valueType, net.minecraft.resources.ResourceLocation modelLocation) Description copied from interface:IValueTypeRegistryRegister a model resource location for the given value type.- Specified by:
registerValueTypeModelin interfaceIValueTypeRegistry- Type Parameters:
V- The value type.T- The value type type.- Parameters:
valueType- The value type.modelLocation- The model resource location.
-
getValueTypeModel
public <V extends IValue,T extends IValueType<V>> net.minecraft.resources.ResourceLocation getValueTypeModel(T valueType) Description copied from interface:IValueTypeRegistryGet the model resource location of the given value type.- Specified by:
getValueTypeModelin interfaceIValueTypeRegistry- Type Parameters:
V- The value type.T- The value type type.- Parameters:
valueType- The value type.- Returns:
- The model resource location.
-
getValueTypeModels
Description copied from interface:IValueTypeRegistryGet all registered model resource locations for the value types.- Specified by:
getValueTypeModelsin interfaceIValueTypeRegistry- Returns:
- All model resource locations.
-
getValueTypes
- Specified by:
getValueTypesin interfaceIValueTypeRegistry- Returns:
- All registered value types.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueNamein interfaceIVariableFacadeHandler<IValueTypeVariableFacade>- Returns:
- The unique name of this type used to identity variables to this handler.
-
getVariableFacade
public IValueTypeVariableFacade 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<IValueTypeVariableFacade>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, IValueTypeVariableFacade variableFacade) Description copied from interface:IVariableFacadeHandlerSet the variable facade for the given tag.- Specified by:
setVariableFacadein interfaceIVariableFacadeHandler<IValueTypeVariableFacade>- Parameters:
tag- The tag that is used to write variable facade information to.variableFacade- The facade to write.
-
deserializeVariableFacadePredicate
public VariableFacadePredicate deserializeVariableFacadePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element) Description copied from interface:IVariableFacadeHandlerDeserialize the given JSON element to a variable facade predicate.- Specified by:
deserializeVariableFacadePredicatein interfaceIVariableFacadeHandler<IValueTypeVariableFacade>element- The JSON element.- Returns:
- The variable facade predicate.
-