Package net.citizensnpcs.api.ai.speech
Interface SpeechFactory
public interface SpeechFactory
SpeechFactory keeps track of and creates new VocalChord instances, necessary for NPC Speech.
-
Method Summary
Modifier and TypeMethodDescriptiongetVocalChord
(Class<? extends VocalChord> clazz) Creates a new instance of a VocalChordgetVocalChord
(String name) Creates a new instance of aVocalChord
getVocalChordName
(Class<? extends VocalChord> clazz) Returns the registered name of aVocalChord
classboolean
isRegistered
(String name) Checks whether the suppliedVocalChord
name is registered.newTalkableEntity
(Entity entity) Creates a new Talkable entity and returns itvoid
register
(Class<? extends VocalChord> clazz, String name) Registers aVocalChord
class with the SpeechController, making it available for use within.
-
Method Details
-
getVocalChord
Creates a new instance of a VocalChord- Parameters:
clazz
- The class of the desired VocalChord- Returns:
- a new instance of this VocalChord
-
getVocalChord
Creates a new instance of aVocalChord
- Parameters:
name
- The name of the desired VocalChord- Returns:
- a new instance of this VocalChord, ornull if a VocalChord is not registered with this name
-
getVocalChordName
Returns the registered name of aVocalChord
class- Parameters:
clazz
- The VocalChord class- Returns:
- the registered name, null if not registered
-
isRegistered
Checks whether the suppliedVocalChord
name is registered.- Parameters:
name
- The name of the VocalChord to check- Returns:
- true if the VocalChord name is registered
-
newTalkableEntity
Creates a new Talkable entity and returns it- Parameters:
entity
- the entity to use- Returns:
- a Talkable entity
-
register
Registers aVocalChord
class with the SpeechController, making it available for use within. Requires a 'name', which should generally describe the intent of the VocalChord.- Parameters:
clazz
- The VocalChord classname
- The name of the VocalChord
-