mirror of
https://hub.spigotmc.org/stash/scm/spigot/spigot.git
synced 2025-09-18 21:33:01 +00:00

* Now Tracks Commands * Resolved Performance issue with Bukkit HandlerList method. Now all timings simply uses the Spigot System * Performance Improvement simply not using TimedRegisteredListener too * Bug with SyncChunkLoad tracking resolved. Now properly tracks many aspects of sync chunk load. * Reset/On/Off accuracy - should no longer have any issues turning it on/off during runtime, so this has been re-enabled. * Paste command on RCON now works * Now tracks everything related to plugins too, so you can easily see total plugin cost * Now tracks Tasks better and where they came from * Now tracks plugins event handlers to the Listener/Method name too. * Merged some Bukkit Patches so all timings changes are in 1 patch. * Moved back to a CLQ for CustomTimingsHandler for thread safety for when tasks are created Async but then executed sync.
28 lines
1.4 KiB
Diff
28 lines
1.4 KiB
Diff
From 65d240aa5cae1be3dbf48382eea65dafa45e8dd4 Mon Sep 17 00:00:00 2001
|
|
From: md_5 <md_5@live.com.au>
|
|
Date: Sat, 3 Aug 2013 19:42:16 +1000
|
|
Subject: [PATCH] Expand Boolean Prompt Values
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/conversations/BooleanPrompt.java b/src/main/java/org/bukkit/conversations/BooleanPrompt.java
|
|
index 3f2c97f..81ef78c 100644
|
|
--- a/src/main/java/org/bukkit/conversations/BooleanPrompt.java
|
|
+++ b/src/main/java/org/bukkit/conversations/BooleanPrompt.java
|
|
@@ -15,12 +15,13 @@ public abstract class BooleanPrompt extends ValidatingPrompt{
|
|
|
|
@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));
|
|
}
|
|
|
|
--
|
|
1.9.1
|
|
|