Package net.citizensnpcs.npc.ai.speech
Class CitizensSpeechFactory
java.lang.Object
net.citizensnpcs.npc.ai.speech.CitizensSpeechFactory
- All Implemented Interfaces:
SpeechFactory
-
Constructor Summary
Constructors -
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 itnewTalkableEntity
(LivingEntity 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.
-
Constructor Details
-
CitizensSpeechFactory
public CitizensSpeechFactory()
-
-
Method Details
-
getVocalChord
Description copied from interface:SpeechFactory
Creates a new instance of a VocalChord- Specified by:
getVocalChord
in interfaceSpeechFactory
- Parameters:
clazz
- The class of the desired VocalChord- Returns:
- a new instance of this VocalChord
-
getVocalChord
Description copied from interface:SpeechFactory
Creates a new instance of aVocalChord
- Specified by:
getVocalChord
in interfaceSpeechFactory
- 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
Description copied from interface:SpeechFactory
Returns the registered name of aVocalChord
class- Specified by:
getVocalChordName
in interfaceSpeechFactory
- Parameters:
clazz
- The VocalChord class- Returns:
- the registered name, null if not registered
-
isRegistered
Description copied from interface:SpeechFactory
Checks whether the suppliedVocalChord
name is registered.- Specified by:
isRegistered
in interfaceSpeechFactory
- Parameters:
name
- The name of the VocalChord to check- Returns:
- true if the VocalChord name is registered
-
newTalkableEntity
Description copied from interface:SpeechFactory
Creates a new Talkable entity and returns it- Specified by:
newTalkableEntity
in interfaceSpeechFactory
- Parameters:
entity
- the entity to use- Returns:
- a Talkable entity
-
newTalkableEntity
Description copied from interface:SpeechFactory
Creates a new Talkable entity and returns it- Specified by:
newTalkableEntity
in interfaceSpeechFactory
- Parameters:
entity
- the livingEntity to use- Returns:
- a Talkable entity
-
register
Description copied from interface:SpeechFactory
Registers aVocalChord
class with the SpeechController, making it available for use within. Requires a 'name', which should generally describe the intent of the VocalChord.- Specified by:
register
in interfaceSpeechFactory
- Parameters:
clazz
- The VocalChord classname
- The name of the VocalChord
-