mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-12-29 04:18:05 +01:00
Fix issue when AbandonedListener targeted correct input values.
I did not understand correctly how that listener worked.
This commit is contained in:
parent
4ab706b207
commit
8d5514325c
@ -1085,7 +1085,13 @@ public abstract class CommonGUI
|
||||
// On cancel conversation will be closed.
|
||||
withEscapeSequence("cancel").
|
||||
// Use null value in consumer to detect if user has abandoned conversation.
|
||||
addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)).
|
||||
addConversationAbandonedListener(abandonedEvent ->
|
||||
{
|
||||
if (!abandonedEvent.gracefulExit())
|
||||
{
|
||||
consumer.accept(null);
|
||||
}
|
||||
}).
|
||||
withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")).
|
||||
buildConversation(user.getPlayer());
|
||||
|
||||
|
@ -720,7 +720,13 @@ public class AdminGUI extends CommonGUI
|
||||
// On cancel conversation will be closed.
|
||||
withEscapeSequence("cancel").
|
||||
// Use null value in consumer to detect if user has abandoned conversation.
|
||||
addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)).
|
||||
addConversationAbandonedListener(abandonedEvent ->
|
||||
{
|
||||
if (!abandonedEvent.gracefulExit())
|
||||
{
|
||||
consumer.accept(null);
|
||||
}
|
||||
}).
|
||||
withLocalEcho(false).
|
||||
withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")).
|
||||
buildConversation(user.getPlayer());
|
||||
|
@ -480,7 +480,13 @@ public class NumberGUI
|
||||
// On cancel conversation will be closed.
|
||||
withEscapeSequence("cancel").
|
||||
// Use null value in consumer to detect if user has abandoned conversation.
|
||||
addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)).
|
||||
addConversationAbandonedListener(abandonedEvent ->
|
||||
{
|
||||
if (!abandonedEvent.gracefulExit())
|
||||
{
|
||||
consumer.accept(null);
|
||||
}
|
||||
}).
|
||||
withPrefix(context ->
|
||||
NumberGUI.this.user.getTranslation("challenges.gui.questions.prefix")).
|
||||
buildConversation(user.getPlayer());
|
||||
|
@ -305,7 +305,13 @@ public class StringListGUI
|
||||
// On cancel conversation will be closed.
|
||||
withEscapeSequence("cancel").
|
||||
// Use null value in consumer to detect if user has abandoned conversation.
|
||||
addConversationAbandonedListener(abandonedEvent -> consumer.accept(null)).
|
||||
addConversationAbandonedListener(abandonedEvent ->
|
||||
{
|
||||
if (!abandonedEvent.gracefulExit())
|
||||
{
|
||||
consumer.accept(null);
|
||||
}
|
||||
}).
|
||||
withLocalEcho(false).
|
||||
withPrefix(context -> user.getTranslation("challenges.gui.questions.prefix")).
|
||||
buildConversation(user.getPlayer());
|
||||
|
Loading…
Reference in New Issue
Block a user