Package de.Keyle.MyPet.api.dialog
Interface DialogService
- All Superinterfaces:
Listener,ServiceContainer
Opens text and confirm prompts for a viewer using whichever transport
the implementation has available (anvil rename, chat conversation, or
a chest-menu confirm). Callbacks fire on the main thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoidpromptConfirm(Player viewer, ConfirmPromptSpec spec, Runnable onYes, Runnable onNo) Opens a yes/no confirm prompt.voidpromptText(Player viewer, TextPromptSpec spec, Consumer<String> onResult, Runnable onCancel) Opens a text-input prompt.Methods inherited from interface de.Keyle.MyPet.api.util.service.ServiceContainer
getActivationMessage, getServiceName, loadConfig, onDisable, onEnable
-
Method Details
-
promptText
Opens a text-input prompt. CallsonResultwith the submitted text, oronCancelif dismissed.- Parameters:
viewer- who to show the prompt tospec- what the prompt looks like and how long the input may beonResult- receives the submitted text, on the main threadonCancel- run if the viewer dismisses the prompt, on the main thread
-
promptConfirm
Opens a yes/no confirm prompt. CallsonYeson confirm andonNoon cancel/decline.- Parameters:
viewer- who to show the prompt tospec- the title, message and button labelsonYes- run if the viewer confirms, on the main threadonNo- run if the viewer declines or dismisses, on the main thread
-