Skip to content

Commit

Permalink
Add deregister trait API
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Oct 24, 2015
1 parent 7e517da commit 5afaa6b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/main/java/net/citizensnpcs/api/trait/TraitFactory.java
Expand Up @@ -6,15 +6,24 @@ public interface TraitFactory {

/**
* Adds all default traits to a given NPC.
*
*
* @param npc
* The NPC to add default traits to
*/
void addDefaultTraits(NPC npc);

/**
* Removes a trait. This prevents a trait from being added to an NPC but does not remove existing traits from the
* NPCs.
*
* @param info
* The TraitInfo to deregister
*/
void deregisterTrait(TraitInfo info);

/**
* Gets a trait with the given class.
*
*
* @param clazz
* Class of the trait
* @return Trait with the given class
Expand All @@ -23,7 +32,7 @@ public interface TraitFactory {

/**
* Gets a trait with the given name.
*
*
* @param name
* Name of the trait
* @return Trait with the given name
Expand All @@ -32,17 +41,17 @@ public interface TraitFactory {

/**
* Gets the {@link Trait} class with the given name, or null if not found.
*
*
* @param name
* The trait name
* @return The trait class
*/
Class<? extends Trait> getTraitClass(String name);

/**
* Checks whether the given trait is 'internal'. An internal trait is
* implementation-defined and is default or built-in.
*
* Checks whether the given trait is 'internal'. An internal trait is implementation-defined and is default or
* built-in.
*
* @param trait
* The trait to check
* @return Whether the trait is an internal trait
Expand All @@ -51,7 +60,7 @@ public interface TraitFactory {

/**
* Registers a trait using the given information.
*
*
* @param info
* Registration information
*/
Expand Down

0 comments on commit 5afaa6b

Please sign in to comment.