类org.bukkit.conversations.Conversable源码实例Demo

下面列出了怎么用org.bukkit.conversations.Conversable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Kettle   文件: CraftServer.java
public boolean dispatchServerCommand(CommandSender sender, PendingCommand serverCommand) {
    if (sender instanceof Conversable) {
        Conversable conversable = (Conversable) sender;

        if (conversable.isConversing()) {
            conversable.acceptConversationInput(serverCommand.command);
            return true;
        }
    }
    try {
        this.playerCommandState = true;
        return this.dispatchCommand(sender, serverCommand.command);
    } catch (Exception ex) {
        getLogger().log(Level.WARNING,
                "Unexpected exception while parsing console command \"" + serverCommand.command + '"', ex);
        return false;
    } finally {
        this.playerCommandState = false;
    }
}
 
源代码2 项目: SonarPet   文件: NameFactory.java
public static void askForName(Conversable whom, IPet pet, boolean admin) {
    new ConversationFactory(EchoPet.getPlugin())
            .withModality(true)
            .withLocalEcho(false)
            .withPrefix(new NameConversationPrefix())
            .withTimeout(90)
            .withFirstPrompt(new NamePrompt(pet, admin))
            .withEscapeSequence("exit")
            .withEscapeSequence("quit")
            .buildConversation(whom).begin();
}
 
源代码3 项目: Thermos   文件: CraftServer.java
public boolean dispatchServerCommand(CommandSender sender, net.minecraft.command.ServerCommand serverCommand) {
    if (sender instanceof Conversable) {
        Conversable conversable = (Conversable)sender;

        if (conversable.isConversing()) {
            conversable.acceptConversationInput(serverCommand.command);
            return true;
        }
    }
    try {
        this.playerCommandState = true;
        // Cauldron start - handle bukkit/vanilla console commands
        int space = serverCommand.command.indexOf(" ");
        // if bukkit command exists then execute it over vanilla
        if (this.getCommandMap().getCommand(serverCommand.command.substring(0, space != -1 ? space : serverCommand.command.length())) != null)
        {
            return this.dispatchCommand(sender, serverCommand.command);
        }
        else { // process vanilla console command
            craftCommandMap.setVanillaConsoleSender(serverCommand.sender);
            return this.dispatchVanillaCommand(sender, serverCommand.command);
        }
        // Cauldron end
    } catch (Exception ex) {
        getLogger().log(Level.WARNING, "Unexpected exception while parsing console command \"" + serverCommand.command + '"', ex);
        return false;
    } finally {
        this.playerCommandState = false;
    }
}
 
源代码4 项目: HoloAPI   文件: LangSetting.java
public static void send(Conversable conversable, String message) {
    if (conversable instanceof CommandSender) {
        send((CommandSender) conversable, message);
        return;
    }

    if (message != null) {
        conversable.sendRawMessage(HoloAPI.getPrefix() + ChatColor.translateAlternateColorCodes('&', message));
    }
}
 
源代码5 项目: HoloAPI   文件: CreateCommand.java
@Command(
        command = "create",
        description = "Create a hologram from text",
        permission = "holoapi.holo.create",
        help = {"Lines can be entered one after another", "Once the command is entered, you will be prompted to enter the line content"}
)
public boolean create(CommandEvent event) {
    if (!(event.sender() instanceof Conversable)) {
        event.respond(Lang.NOT_CONVERSABLE.getValue());
        return true;
    }
    InputFactory.buildBasicConversation().withFirstPrompt(new InputPrompt()).buildConversation((Conversable) event.sender()).begin();
    return true;
}
 
源代码6 项目: HoloAPI   文件: CreateCommand.java
@Command(
        command = "create animation",
        description = "Create a hologram using animations",
        permission = "holoapi.holo.create",
        help = "Animation can be defined in the HoloAPI config file"
)
public boolean createAnimation(CommandEvent event) {
    if (!(event.sender() instanceof Conversable)) {
        event.respond(Lang.NOT_CONVERSABLE.getValue());
        return true;
    }
    InputFactory.buildBasicConversation().withFirstPrompt(new AnimationBuilderInputPrompt()).buildConversation((Conversable) event.sender()).begin();
    return true;
}
 
源代码7 项目: HoloAPI   文件: BuildCommand.java
@Command(
        command = "build",
        description = "Dynamically build a combined hologram of both text and images",
        permission = "holoapi.holo.build"
)
public boolean command(CommandEvent event) {
    if (!(event.sender() instanceof Conversable)) {
        event.respond(Lang.NOT_CONVERSABLE.getValue());
        return true;
    }
    InputFactory.buildBasicConversation().withFirstPrompt(new BuilderInputPrompt()).buildConversation((Conversable) event.sender()).begin();
    return true;
}
 
源代码8 项目: EchoPet   文件: NameFactory.java
public static void askForName(Conversable whom, IPet pet, boolean admin) {
    new ConversationFactory(EchoPet.getPlugin())
            .withModality(true)
            .withLocalEcho(false)
            .withPrefix(new NameConversationPrefix())
            .withTimeout(90)
            .withFirstPrompt(new NamePrompt(pet, admin))
            .withEscapeSequence("exit")
            .withEscapeSequence("quit")
            .buildConversation(whom).begin();
}
 
源代码9 项目: HoloAPI   文件: LangSetting.java
public void send(Conversable conversable, String... pairedReplacements) {
    send(conversable, getValue(pairedReplacements));
}
 
 类所在包
 同包方法