本文整理汇总了Java中org.bukkit.conversations.Prompt.END_OF_CONVERSATION属性的典型用法代码示例。如果您正苦于以下问题:Java Prompt.END_OF_CONVERSATION属性的具体用法?Java Prompt.END_OF_CONVERSATION怎么用?Java Prompt.END_OF_CONVERSATION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.conversations.Prompt
的用法示例。
在下文中一共展示了Prompt.END_OF_CONVERSATION属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext arg0, Number arg1) {
if (arg1.intValue() < 0) {
return new SilverTransferItem(plugin);
}
if (arg1.intValue() > sply.getCurrency()) {
return new SilverTransferItem(plugin);
}
Player dply = (Player) arg0.getSessionData("player");
SPlayer dsply = plugin.players.get(dply.getName());
dsply.sendMessage(sply.getPlayer().getDisplayName() + " (" + sply.getPlayer().getName() + ") just sent you " + arg1.intValue() + " silver.");
dsply.addCurrency(arg1.intValue(), false);
sply.delCurrency(arg1.intValue());
arg0.getForWhom().sendRawMessage(
ChatColor.AQUA + "Inventory: Transferred "
+ NumberFormat.getInstance().format(arg1.intValue())
+ " silver to " + dply.getName() + ".");
return Prompt.END_OF_CONVERSATION;
}
示例2: acceptInput
@Override
public Prompt acceptInput(ConversationContext context, String input)
{
PlayerData data = plugin.getPlayerDataCache().getData(player);
if (data.getInvited().contains(input.toLowerCase()))
{
player.sendRawMessage(FormatUtil.format("&cError: &4" + plugin.getMessage("already_invited")));
return Prompt.END_OF_CONVERSATION;
}
OfflinePlayer invite = Util.matchOfflinePlayer(input);
if (invite == null || ! invite.hasPlayedBefore())
{
data.getInvited().add(input.toLowerCase());
player.sendRawMessage(FormatUtil.format(plugin.getPrefix() + plugin.getMessage("invite_confirmed"), input));
}
else
{
player.sendRawMessage(FormatUtil.format("&cError: &4" + plugin.getMessage("has_played_before")));
}
return Prompt.END_OF_CONVERSATION;
}
示例3: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String input)
{
if(input.equalsIgnoreCase("quit") || input.equalsIgnoreCase("stop") || input.equalsIgnoreCase("end"))
return Prompt.END_OF_CONVERSATION;
if(listener.onAnswer(input))
return Prompt.END_OF_CONVERSATION;
else
return this;
}
示例4: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context,
String choice) {
if (choice.equalsIgnoreCase("use")) {
context.setSessionData("free", true);
item.runExtraData(context, plugin);
item.runPurchaseAnnoucement(context, plugin);
} else if (choice.equalsIgnoreCase("sell")) {
context.setSessionData("itemobj", item);
return new ItemSellbackConfirmation(plugin);
} else if (choice.equalsIgnoreCase("back")) {
return new ItemList(plugin);
}
return Prompt.END_OF_CONVERSATION;
}
示例5: acceptInput
@Override
public Prompt acceptInput(ConversationContext context, String input) {
int amount = 0;
if(input.equalsIgnoreCase("cancel")) return Prompt.END_OF_CONVERSATION;
if(NumberUtils.isNumber(input)) {
amount = Integer.valueOf(input);
if(amount <= 0) {
context.setSessionData(SessionConstants.ERROR, errorPrompt());
return new TryAgainPrompt(this);
}
} else {
context.setSessionData(SessionConstants.ERROR, errorPrompt());
return new TryAgainPrompt(this);
}
Account a = (Account) context.getSessionData(SessionConstants.ACCOUNT);
if(a.deposit(amount)) {
context.setSessionData(SessionConstants.OUTCOME, ChatColor.GREEN + "You have deposited " + "( " + amount + " )" +
ChatColor.GOLD + " Gold Nugget(s)" + ChatColor.RESET + "into your account.");
return new OutcomePrompt(bank, teller, customer);
} else {
context.setSessionData(SessionConstants.ERROR, "You do not have enough cash to deposit this amount!");
return new TryAgainPrompt(this);
}
}
示例6: acceptInput
@Override
public Prompt acceptInput(ConversationContext context, String input) {
switch (input) {
case "check balance":
context.setSessionData(SessionConstants.SELECTION, "check balance");
context.setSessionData(SessionConstants.NEXT_PROMPT, new CheckBalancePrompt(bank, teller, customer));
break;
case "withdraw":
context.setSessionData(SessionConstants.SELECTION, "withdraw");
context.setSessionData(SessionConstants.NEXT_PROMPT, new WithdrawPrompt(bank, teller, customer));
break;
case "deposit":
context.setSessionData(SessionConstants.SELECTION, "deposit");
context.setSessionData(SessionConstants.NEXT_PROMPT, new DepositPrompt(bank, teller, customer));
break;
case "transfer":
context.setSessionData(SessionConstants.SELECTION, "transfer");
break;
case "close account":
context.setSessionData(SessionConstants.SELECTION, "close");
break;
case "transfer account":
context.setSessionData(SessionConstants.SELECTION, "transfer account");
break;
case "open account":
context.setSessionData(SessionConstants.SELECTION, "open account");
context.setSessionData(SessionConstants.NEXT_PROMPT, new OpenAccountPrompt(bank, teller, customer));
return new AccountTypeSelectorPrompt(bank, teller, customer);
case "end":
case "stop":
case "//":
default:
return Prompt.END_OF_CONVERSATION;
}
return new AccountSelectorPrompt(bank, teller, customer);
}
示例7: acceptInput
@Override
public Prompt acceptInput(ConversationContext context, String input) {
int amount = 0;
if(input.equalsIgnoreCase("cancel")) return Prompt.END_OF_CONVERSATION;
if(NumberUtils.isNumber(input)) {
amount = Integer.valueOf(input);
if(amount <= 0) {
context.setSessionData(SessionConstants.ERROR, errorPrompt());
return new TryAgainPrompt(this);
}
} else {
context.setSessionData(SessionConstants.ERROR, errorPrompt());
return new TryAgainPrompt(this);
}
Account a = (Account) context.getSessionData(SessionConstants.ACCOUNT);
if(a.withdraw(amount)) {
context.setSessionData(SessionConstants.OUTCOME, ChatColor.GREEN + "You have withdrawn " + "( " + amount + " )" +
ChatColor.GOLD + " Gold Nugget(s)" + ChatColor.RESET + "from your account.");
return new OutcomePrompt(bank, teller, customer);
} else {
context.setSessionData(SessionConstants.ERROR, "You do not have sufficient funds to complete this transaction.");
return new TryAgainPrompt(this);
}
}
示例8: acceptInput
@Override
public Prompt acceptInput(ConversationContext context, String input) {
if(input.equalsIgnoreCase("Yes")) {
context.setSessionData(SessionConstants.CONTINUE, true);
context.setSessionData(SessionConstants.WAIT, true);
return new WelcomePrompt(bank, teller, customer);
}
else if(input.equalsIgnoreCase("No")) return Prompt.END_OF_CONVERSATION;
else {
context.setSessionData(SessionConstants.ERROR, errorPrompt());
return new TryAgainPrompt(this);
}
}
示例9: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context,
String input) {
context.setSessionData("color", StringToChatColor.getChatColorByName(ChatColor.stripColor(input)));
p.createTeam((String) context.getSessionData("nomTeam"), (ChatColor) context.getSessionData("color"));
context.getForWhom().sendRawMessage(ChatColor.GRAY+"Team "+((ChatColor)context.getSessionData("color"))+context.getSessionData("nomTeam")+ChatColor.GRAY+" créée.");
return Prompt.END_OF_CONVERSATION;
}
示例10: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String s) {
if (s.equalsIgnoreCase("NO")) {
return Prompt.END_OF_CONVERSATION;
}
context.setSessionData("continue", s.toLowerCase());
return this.promptReturn;
}
示例11: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String s) {
if (s.equalsIgnoreCase("Mixed")) {
context.setSessionData("mode", s);
return new SetModeResult();
}
if (s.equalsIgnoreCase("Dedicated")) {
context.setSessionData("mode", s);
return new SetModeResult();
}
return Prompt.END_OF_CONVERSATION;
}
示例12: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String s) {
if (s.equalsIgnoreCase("Yes")) {
context.setSessionData("pre", 2);
return new DisplayModes();
}
if (s.equalsIgnoreCase("No")) {
context.setSessionData("pre", 2);
return new SetDisplayMode("Mixed", "Dedicated", "Quit");
}
return Prompt.END_OF_CONVERSATION;
}
示例13: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String s) {
if (s.equalsIgnoreCase("Yes")) {
context.setSessionData("pre", 1);
return new DoAutoSetUp();
}
if (s.equalsIgnoreCase("No")) {
return Prompt.END_OF_CONVERSATION;
}
return Prompt.END_OF_CONVERSATION;
}
示例14: acceptValidatedInput
@Override
protected Prompt acceptValidatedInput(ConversationContext context, String s) {
if (s.equalsIgnoreCase("Yes")) {
context.setSessionData("pre", 1);
return new FinalConfirmation("Yes", "No");
}
if (s.equalsIgnoreCase("No")) {
context.setSessionData("pre", 1);
return Prompt.END_OF_CONVERSATION;
}
return Prompt.END_OF_CONVERSATION;
}
示例15: acceptValidatedInput
@Override
public Prompt acceptValidatedInput(ConversationContext con, String s) {
if (s.equalsIgnoreCase("one") || s.equals("1")) {
removeLoginExemption(con);
} else if (s.equalsIgnoreCase("two") || s.equals("2")) {
removeRejoinExemption(con);
} else if (s.equalsIgnoreCase("zero") || s.equalsIgnoreCase("cancel") ||
s.equals("0")) {
con.getForWhom().sendRawMessage(getPlugin().formatPlayerMessage(
getLocalString("EXEMPT_PROMPT_CANCEL")));
}
return Prompt.END_OF_CONVERSATION;
}