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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
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
-
hasRecipients
public boolean hasRecipients()Checks if there are any recipients. If none, thisSpeechContextis not targeted.- Returns:
- true if recipients are specified.
-
iterator
-
setMessage
Sets the text message sent. Overrides text set with the constructor.- Parameters:
message- The text to send.
-
setTalker
-
size
public int size()- Returns:
- number of recipients.
-