Class AspectRegistry
java.lang.Object
org.cyclops.integrateddynamics.core.part.aspect.AspectRegistry
- All Implemented Interfaces:
org.cyclops.cyclopscore.init.IRegistry,IVariableFacadeHandler<IAspectVariableFacade>,IAspectRegistry
Registry for
IAspect.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Method Summary
Modifier and TypeMethodDescriptiondeserializeVariableFacadePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element) Deserialize the given JSON element to a variable facade predicate.deserializeVariablePredicate(ValueDeseralizationContext valueDeseralizationContext, com.google.gson.JsonObject element, IValueType valueType, ValuePredicate valuePredicate) Deserialize the given JSON element to a variable predicate.getAspect(net.minecraft.resources.ResourceLocation name) Get an aspect by name.net.minecraft.resources.ResourceLocationgetAspectModel(IAspect aspect) Get the model resource location of the given aspect.Collection<net.minecraft.resources.ResourceLocation>Get all registered model resource locations for the aspects.Get all registered aspects.getAspects(IPartType partType) Get the registered aspects for a given part type.static AspectRegistryGet all registered read aspects.getReadAspects(IPartType partType) Get the registered read aspects for a given part type.net.minecraft.resources.ResourceLocationgetVariableFacade(ValueDeseralizationContext valueDeseralizationContext, int id, net.minecraft.nbt.CompoundTag tag) Get the variable facade for the given tag.Get all registered write aspects.getWriteAspects(IPartType partType) Get the registered write aspects for a given part type.voidregister(IPartType partType, Collection<IAspect> aspects) Register a set of aspects for a given part type.Register a new aspect for a given part type.voidregisterAspectModel(IAspect aspect, net.minecraft.resources.ResourceLocation modelLocation) Register a model resource location for the given aspect.protected <T extends IAspect>
voidregisterSubAspectType(IPartType partType, T aspect, Map<IPartType, Set<T>> partAspects, Map<String, T> unlocalizedAspects) voidsetVariableFacade(net.minecraft.nbt.CompoundTag tag, IAspectVariableFacade variableFacade) Set the variable facade for the given tag.
-
Method Details
-
getInstance
- Returns:
- The unique instance.
-
register
Description copied from interface:IAspectRegistryRegister a new aspect for a given part type.- Specified by:
registerin interfaceIAspectRegistry- Parameters:
partType- The part type.aspect- The aspect.- Returns:
- The registered element.
-
registerSubAspectType
-
register
Description copied from interface:IAspectRegistryRegister a set of aspects for a given part type.- Specified by:
registerin interfaceIAspectRegistry- Parameters:
partType- The part type.aspects- The aspects.
-
getAspects
Description copied from interface:IAspectRegistryGet the registered aspects for a given part type.- Specified by:
getAspectsin interfaceIAspectRegistry- Parameters:
partType- The part type.- Returns:
- The aspects.
-
getReadAspects
Description copied from interface:IAspectRegistryGet the registered read aspects for a given part type.- Specified by:
getReadAspectsin interfaceIAspectRegistry- Parameters:
partType- The part type.- Returns:
- The read aspects.
-
getWriteAspects
Description copied from interface:IAspectRegistryGet the registered write aspects for a given part type.- Specified by:
getWriteAspectsin interfaceIAspectRegistry- Parameters:
partType- The part type.- Returns:
- The write aspects.
-
getAspects
Description copied from interface:IAspectRegistryGet all registered aspects.- Specified by:
getAspectsin interfaceIAspectRegistry- Returns:
- The aspects.
-
getReadAspects
Description copied from interface:IAspectRegistryGet all registered read aspects.- Specified by:
getReadAspectsin interfaceIAspectRegistry- Returns:
- The read aspects.
-
getWriteAspects
Description copied from interface:IAspectRegistryGet all registered write aspects.- Specified by:
getWriteAspectsin interfaceIAspectRegistry- Returns:
- The write aspects.
-
getAspect
Description copied from interface:IAspectRegistryGet an aspect by name.- Specified by:
getAspectin interfaceIAspectRegistry- Parameters:
name- The name of the aspect.- Returns:
- The matching aspect.
-
registerAspectModel
public void registerAspectModel(IAspect aspect, net.minecraft.resources.ResourceLocation modelLocation) Description copied from interface:IAspectRegistryRegister a model resource location for the given aspect.- Specified by:
registerAspectModelin interfaceIAspectRegistry- Parameters:
aspect- The aspect.modelLocation- The model resource location.
-
getAspectModel
Description copied from interface:IAspectRegistryGet the model resource location of the given aspect.- Specified by:
getAspectModelin interfaceIAspectRegistry- Parameters:
aspect- The aspect.- Returns:
- The model resource location.
-
getAspectModels
Description copied from interface:IAspectRegistryGet all registered model resource locations for the aspects.- Specified by:
getAspectModelsin interfaceIAspectRegistry- Returns:
- All model resource locations.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueNamein interfaceIVariableFacadeHandler<IAspectVariableFacade>- Returns:
- The unique name of this type used to identity variables to this handler.
-
getVariableFacade
public IAspectVariableFacade 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<IAspectVariableFacade>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, IAspectVariableFacade variableFacade) Description copied from interface:IVariableFacadeHandlerSet the variable facade for the given tag.- Specified by:
setVariableFacadein interfaceIVariableFacadeHandler<IAspectVariableFacade>- Parameters:
tag- The tag that is used to write variable facade information to.variableFacade- The facade to write.
-
deserializeVariablePredicate
public VariablePredicate deserializeVariablePredicate(ValueDeseralizationContext valueDeseralizationContext, 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<IAspectVariableFacade>element- The JSON element.valueType- The optional value type.valuePredicate- The value predicate.- Returns:
- The variable predicate.
-
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<IAspectVariableFacade>element- The JSON element.- Returns:
- The variable facade predicate.
-