Package net.citizensnpcs.api.ai.speech
Class SpeechContext
java.lang.Object
net.citizensnpcs.api.ai.speech.SpeechContext
SpeechContext contains information about a
NPCSpeechEvent, including the Talkable talker, recipients,
and message.-
Constructor Summary
ConstructorsConstructorDescriptionSpeechContext(String message) SpeechContext(String message, Entity recipient) SpeechContext(NPC talker, String message) SpeechContext(NPC talker, String message, Entity recipient) -
Method Summary
Modifier and TypeMethodDescriptionaddRecipient(Entity entity) Adds a directTalkablerecipient.addRecipients(List<Talkable> talkables) Adds a list ofTalkablerecipients.Gets the text message sent.Gets the talker.booleanChecks if there are any recipients.iterator()Gets direct recipients, if any.voidsetMessage(String message) Sets the text message sent.voidSets the talker.intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
SpeechContext
public SpeechContext() -
SpeechContext
-
SpeechContext
-
SpeechContext
-
SpeechContext
-
-
Method Details
-
addRecipient
Adds a directTalkablerecipient.- Parameters:
entity- Talkable entity- Returns:
- the speech context
-
addRecipients
Adds a list ofTalkablerecipients.- Parameters:
talkables- Talkable entities- Returns:
- the Tongue
-
getMessage
Gets the text message sent. -
getTalker
Gets the talker.- Returns:
- NPC doing the talking
-
hasRecipients
public boolean hasRecipients()Checks if there are any recipients. If none, thisSpeechContextis not targeted.- Returns:
- true if recipients are specified.
-
iterator
Gets direct recipients, if any. -
setMessage
Sets the text message sent. Overrides text set with the constructor.- Parameters:
message- The text to send.
-
setTalker
Sets the talker.- Parameters:
entity- NPC doing the talking
-
size
public int size()- Returns:
- number of recipients.
-