Interface TraitFactory
- All Known Implementing Classes:
CitizensTraitFactory
public interface TraitFactory
-
Method Summary
Modifier and TypeMethodDescriptionvoidderegisterTrait(TraitInfo info) Removes a trait.intgetTemplateParser(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
-
deregisterTrait
Removes a trait. This prevents a trait from being added to an NPC but does not remove existing traits from the NPCs.- Parameters:
info- The TraitInfo to deregister
-
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
-
getTrait
-
getTraitClass
-
registerTrait
Registers a trait using the given information.- Parameters:
info- Registration information
-