Check whether the given text is valid. @param text The text. @return True if the string contains only defined characters, false otherwise.
(@NotNull String text)
| 88 | * otherwise. |
| 89 | */ |
| 90 | public boolean isValid(@NotNull String text) { |
| 91 | for (int i = 0; i < text.length(); ++i) { |
| 92 | char ch = text.charAt(i); |
| 93 | if (ch == ChatColor.COLOR_CHAR || ch == '\n') continue; |
| 94 | if (chars.get(ch) == null) return false; |
| 95 | } |
| 96 | return true; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Represents the graphics for a single character in a MapFont. |