mirror of
https://github.com/TotalFreedomMC/TF-PlotSquared.git
synced 2025-08-07 04:53:00 +00:00
flags + meta
This commit is contained in:
parent
f1a7e0d73f
commit
1ad65122b7
8 changed files with 50 additions and 19 deletions
|
@ -36,13 +36,8 @@ public class Flag {
|
|||
* @throws IllegalArgumentException if you provide inadequate inputs
|
||||
*/
|
||||
public Flag(final AbstractFlag key, final String value) {
|
||||
final char[] allowedCharacters = new char[] { '[', ']', '(', ')', ',', '_', '-', '.', ',', '?', '!', '&', ':', '\u00A7' };
|
||||
String tempValue = value;
|
||||
for (final char c : allowedCharacters) {
|
||||
tempValue = tempValue.replace(c, 'c');
|
||||
}
|
||||
if (!StringUtils.isAlphanumericSpace(tempValue)) {
|
||||
throw new IllegalArgumentException("Flag must be alphanumerical (colours and some special characters are allowed)");
|
||||
if (!StringUtils.isAsciiPrintable(value)) {
|
||||
throw new IllegalArgumentException("Flag must be ascii");
|
||||
}
|
||||
if (value.length() > 128) {
|
||||
throw new IllegalArgumentException("Value must be <= 128 characters");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue