Skip to content

Commit

Permalink
Expand Boolean Prompt Values
Browse files Browse the repository at this point in the history
  • Loading branch information
md-5 authored and SpigotMC committed Sep 4, 2014
1 parent 26c480d commit fa8e64c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/bukkit/conversations/BooleanPrompt.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ public BooleanPrompt() {

@Override
protected boolean isInputValid(ConversationContext context, String input) {
String[] accepted = {"true", "false", "on", "off", "yes", "no"};
String[] accepted = {"true", "false", "on", "off", "yes", "no" /* Spigot: */, "y", "n", "1", "0", "right", "wrong", "correct", "incorrect", "valid", "invalid"}; // Spigot
return ArrayUtils.contains(accepted, input.toLowerCase());
}

@Override
protected Prompt acceptValidatedInput(ConversationContext context, String input) {
if (input.equalsIgnoreCase("y") || input.equals("1") || input.equalsIgnoreCase("right") || input.equalsIgnoreCase("correct") || input.equalsIgnoreCase("valid")) input = "true"; // Spigot
return acceptValidatedInput(context, BooleanUtils.toBoolean(input));
}

Expand Down

0 comments on commit fa8e64c

Please sign in to comment.