Class ConversationPlayer
java.lang.Object
rocks.gravili.notquests.paper.conversation.ConversationPlayer
-
Constructor Summary
ConstructorDescriptionConversationPlayer
(NotQuests main, QuestPlayer questPlayer, org.bukkit.entity.Player player, Conversation conversation) -
Method Summary
Modifier and TypeMethodDescriptionvoid
chooseOption
(String option) Called when the player chooses an answer (clicks in chat).findConversationLinesWhichFulfillsCondition
(ArrayList<ConversationLine> conversationLines) final QuestPlayer
boolean
next
(ConversationLine currentLine, boolean deletePrevious) Continues the conversation.void
nextPlayer
(ArrayList<ConversationLine> playerLines) Called when the next lines (playerLines) are clickable option linesvoid
play()
void
Resends the chat history without ANY conversation messagesvoid
sendLine
(ConversationLine conversationLine, boolean deletePrevious) Sends the player a normal text line.void
sendOptionLine
(ConversationLine conversationLine) Sends the player a clickable option text.
-
Constructor Details
-
ConversationPlayer
public ConversationPlayer(NotQuests main, QuestPlayer questPlayer, org.bukkit.entity.Player player, Conversation conversation)
-
-
Method Details
-
play
public void play() -
next
Continues the conversation. Called, when either (1) starting line is called or (2) when the next line is NOT a clickable option line.- Parameters:
currentLine
-- Returns:
-
nextPlayer
Called when the next lines (playerLines) are clickable option lines- Parameters:
playerLines
-
-
findConversationLinesWhichFulfillsCondition
public ArrayList<ConversationLine> findConversationLinesWhichFulfillsCondition(ArrayList<ConversationLine> conversationLines) -
sendLine
Sends the player a normal text line. This is NOT a clickable/option line.- Parameters:
conversationLine
-
-
sendOptionLine
Sends the player a clickable option text. The conversation will not continue until the player clicks it- Parameters:
conversationLine
-
-
chooseOption
Called when the player chooses an answer (clicks in chat).- Parameters:
option
- option which the player chooses = exact message
-
removeOldMessages
public void removeOldMessages()Resends the chat history without ANY conversation messages -
getQuestPlayer
-