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 SummaryConstructorsConstructorDescriptionSpeechContext(String message) SpeechContext(String message, Entity recipient) SpeechContext(NPC talker, String message) SpeechContext(NPC talker, String message, Entity recipient) 
- 
Method SummaryModifier 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliterator
- 
Constructor Details- 
SpeechContextpublic SpeechContext()
- 
SpeechContext
- 
SpeechContext
- 
SpeechContext
- 
SpeechContext
 
- 
- 
Method Details- 
addRecipientAdds a directTalkablerecipient.- Parameters:
- entity- Talkable entity
- Returns:
- the speech context
 
- 
addRecipientsAdds a list ofTalkablerecipients.- Parameters:
- talkables- Talkable entities
- Returns:
- the Tongue
 
- 
getMessageGets the text message sent.
- 
getTalkerGets the talker.- Returns:
- NPC doing the talking
 
- 
hasRecipientspublic boolean hasRecipients()Checks if there are any recipients. If none, thisSpeechContextis not targeted.- Returns:
- true if recipients are specified.
 
- 
iteratorGets direct recipients, if any.
- 
setMessageSets the text message sent. Overrides text set with the constructor.- Parameters:
- message- The text to send.
 
- 
setTalkerSets the talker.- Parameters:
- entity- NPC doing the talking
 
- 
sizepublic int size()- Returns:
- number of recipients.
 
 
-