Package net.citizensnpcs.api.trait
Class TraitInfo
java.lang.Object
net.citizensnpcs.api.trait.TraitInfo
Builds a trait.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
static TraitInfo
Constructs a factory with the given trait class.boolean
void
registerListener
(Plugin plugin) boolean
<T extends Trait>
TwithSupplier
(Supplier<? extends Trait> supplier)
-
Method Details
-
asDefaultTrait
-
checkValid
public void checkValid() -
getTraitClass
-
getTraitName
-
isDefaultTrait
public boolean isDefaultTrait() -
optInToStats
-
registerListener
-
shouldTrackStats
public boolean shouldTrackStats() -
tryCreateInstance
-
withName
-
withSupplier
-
create
Constructs a factory with the given trait class. The trait class must have a no-arguments constructor.- Parameters:
trait
- Class of the trait- Returns:
- The created
TraitInfo
- Throws:
IllegalArgumentException
- If the trait class does not have a no-arguments constructor
-