Package net.citizensnpcs.api.trait
Interface TraitFactory
- All Known Implementing Classes:
CitizensTraitFactory
public interface TraitFactory
-
Method Summary
Modifier and TypeMethodDescriptionintgetTemplateParser(String name) Gets theTraitTemplateParserwith the given trait name or null if not found.<T extends Trait>
TGets a trait with the given class.<T extends Trait>
TGets a trait with the given name.getTraitClass(String name) Gets theTraitclass with the given name, or null if not found.voidregisterTrait(TraitInfo info) Registers a trait using the given information.
-
Method Details
-
getId
-
getRegisteredTraits
Collection<TraitInfo> getRegisteredTraits()- Returns:
- All currently registered traits, including internal traits.
-
getTemplateParser
Gets theTraitTemplateParserwith the given trait name or null if not found.- Parameters:
name-- Returns:
- the trait template parser
-
getTrait
Gets a trait with the given class.- Parameters:
clazz- Class of the trait- Returns:
- Trait with the given class
-
getTrait
Gets a trait with the given name.- Parameters:
name- Name of the trait- Returns:
- Trait with the given name
-
getTraitClass
Gets theTraitclass with the given name, or null if not found.- Parameters:
name- The trait name- Returns:
- The trait class
-
registerTrait
Registers a trait using the given information.- Parameters:
info- Registration information
-