All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.badbird5907.blib.util.QuestionConversation Maven / Gradle / Ivy

There is a newer version: 2.1.11-REL
Show newest version
package net.badbird5907.blib.util;

import lombok.RequiredArgsConstructor;
import net.badbird5907.blib.objects.TypeCallback;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import org.bukkit.conversations.StringPrompt;

@RequiredArgsConstructor
public class QuestionConversation extends StringPrompt {
    private final String prompt;
    private final TypeCallback callback;
    @Override
    public String getPromptText(ConversationContext conversationContext) {
        return prompt;
    }

    @Override
    public Prompt acceptInput(ConversationContext conversationContext, String s) {
        return callback.callback(s);
    }
    public Prompt reprompt(){
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy