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 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.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.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
(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>
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:IVariableFacadeHandler
Set the variable facade for the given tag.- Specified by:
setVariableFacade
in 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:IVariableFacadeHandler
Deserialize the given JSON element to a variable predicate.- Specified by:
deserializeVariablePredicate
in 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:IVariableFacadeHandler
Deserialize the given JSON element to a variable facade predicate.- Specified by:
deserializeVariableFacadePredicate
in interfaceIVariableFacadeHandler<IAspectVariableFacade>
element
- The JSON element.- Returns:
- The variable facade predicate.
-