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
Modifier and TypeClassDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptiongetAspect
(net.minecraft.resources.ResourceLocation name) Get an aspect by name.net.minecraft.resources.ResourceLocation
getAspectModel
(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 AspectRegistry
Get all registered read aspects.getReadAspects
(IPartType partType) Get the registered read aspects for a given part type.net.minecraft.resources.ResourceLocation
getVariableFacade
(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.boolean
isInstance
(IVariable<?> variable) If the given variable is created by this handler.boolean
isInstance
(IVariableFacade variableFacade) If the given facade is created by this handler.void
register
(IPartType partType, Collection<IAspect> aspects) Register a set of aspects for a given part type.Register a new aspect for a given part type.void
registerAspectModel
(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) void
setVariableFacade
(ValueDeseralizationContext valueDeseralizationContext, 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:IAspectRegistry
Register a new aspect for a given part type.- Specified by:
register
in interfaceIAspectRegistry
- Parameters:
partType
- The part type.aspect
- The aspect.- Returns:
- The registered element.
-
registerSubAspectType
-
register
Description copied from interface:IAspectRegistry
Register a set of aspects for a given part type.- Specified by:
register
in interfaceIAspectRegistry
- Parameters:
partType
- The part type.aspects
- The aspects.
-
getAspects
Description copied from interface:IAspectRegistry
Get the registered aspects for a given part type.- Specified by:
getAspects
in interfaceIAspectRegistry
- Parameters:
partType
- The part type.- Returns:
- The aspects.
-
getReadAspects
Description copied from interface:IAspectRegistry
Get the registered read aspects for a given part type.- Specified by:
getReadAspects
in interfaceIAspectRegistry
- Parameters:
partType
- The part type.- Returns:
- The read aspects.
-
getWriteAspects
Description copied from interface:IAspectRegistry
Get the registered write aspects for a given part type.- Specified by:
getWriteAspects
in interfaceIAspectRegistry
- Parameters:
partType
- The part type.- Returns:
- The write aspects.
-
getAspects
Description copied from interface:IAspectRegistry
Get all registered aspects.- Specified by:
getAspects
in interfaceIAspectRegistry
- Returns:
- The aspects.
-
getReadAspects
Description copied from interface:IAspectRegistry
Get all registered read aspects.- Specified by:
getReadAspects
in interfaceIAspectRegistry
- Returns:
- The read aspects.
-
getWriteAspects
Description copied from interface:IAspectRegistry
Get all registered write aspects.- Specified by:
getWriteAspects
in interfaceIAspectRegistry
- Returns:
- The write aspects.
-
getAspect
Description copied from interface:IAspectRegistry
Get an aspect by name.- Specified by:
getAspect
in 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:IAspectRegistry
Register a model resource location for the given aspect.- Specified by:
registerAspectModel
in interfaceIAspectRegistry
- Parameters:
aspect
- The aspect.modelLocation
- The model resource location.
-
getAspectModel
Description copied from interface:IAspectRegistry
Get the model resource location of the given aspect.- Specified by:
getAspectModel
in interfaceIAspectRegistry
- Parameters:
aspect
- The aspect.- Returns:
- The model resource location.
-
getAspectModels
Description copied from interface:IAspectRegistry
Get all registered model resource locations for the aspects.- Specified by:
getAspectModels
in interfaceIAspectRegistry
- Returns:
- All model resource locations.
-
getUniqueName
public net.minecraft.resources.ResourceLocation getUniqueName()- Specified by:
getUniqueName
in 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:IVariableFacadeHandler
Get the variable facade for the given tag.- Specified by:
getVariableFacade
in interfaceIVariableFacadeHandler<IAspectVariableFacade>
- 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, IAspectVariableFacade variableFacade) Description copied from interface:IVariableFacadeHandler
Set the variable facade for the given tag.- Specified by:
setVariableFacade
in interfaceIVariableFacadeHandler<IAspectVariableFacade>
- Parameters:
valueDeseralizationContext
-tag
- The tag that is used to write variable facade information to.variableFacade
- The facade to write.
-
isInstance
Description copied from interface:IVariableFacadeHandler
If the given facade is created by this handler.- Specified by:
isInstance
in interfaceIVariableFacadeHandler<IAspectVariableFacade>
- Parameters:
variableFacade
- A facade.- Returns:
- If it is an instance.
-
isInstance
Description copied from interface:IVariableFacadeHandler
If the given variable is created by this handler.- Specified by:
isInstance
in interfaceIVariableFacadeHandler<IAspectVariableFacade>
- Parameters:
variable
- A variable.- Returns:
- If it is an instance.
-