forked from xjboss/KCauldronX
Initial commit (Forge 1291).
This commit is contained in:
17
patches/org/bukkit/conversations/BooleanPrompt.java.patch
Normal file
17
patches/org/bukkit/conversations/BooleanPrompt.java.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- ../src-base/minecraft/org/bukkit/conversations/BooleanPrompt.java
|
||||
+++ ../src-work/minecraft/org/bukkit/conversations/BooleanPrompt.java
|
||||
@@ -15,12 +15,13 @@
|
||||
|
||||
@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));
|
||||
}
|
||||
|
23
patches/org/bukkit/conversations/Conversation.java.patch
Normal file
23
patches/org/bukkit/conversations/Conversation.java.patch
Normal file
@ -0,0 +1,23 @@
|
||||
--- ../src-base/minecraft/org/bukkit/conversations/Conversation.java
|
||||
+++ ../src-work/minecraft/org/bukkit/conversations/Conversation.java
|
||||
@@ -209,6 +209,7 @@
|
||||
* @param input The user's chat text.
|
||||
*/
|
||||
public void acceptInput(String input) {
|
||||
+ try { // Spigot
|
||||
if (currentPrompt != null) {
|
||||
|
||||
// Echo the user's input
|
||||
@@ -228,6 +229,12 @@
|
||||
currentPrompt = currentPrompt.acceptInput(context, input);
|
||||
outputNextPrompt();
|
||||
}
|
||||
+ // Spigot Start
|
||||
+ } catch ( Throwable t )
|
||||
+ {
|
||||
+ org.bukkit.Bukkit.getLogger().log( java.util.logging.Level.SEVERE, "Error handling conversation prompt", t );
|
||||
+ }
|
||||
+ // Spigot End
|
||||
}
|
||||
|
||||
/**
|
Reference in New Issue
Block a user