mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	Support for colour codes
This commit is contained in:
		@@ -21,8 +21,9 @@ public class Flag {
 | 
				
			|||||||
	 *             if you provide inadequate inputs
 | 
						 *             if you provide inadequate inputs
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	public Flag(AbstractFlag key, String value) {
 | 
						public Flag(AbstractFlag key, String value) {
 | 
				
			||||||
		if (!StringUtils.isAlphanumericSpace(ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', value)))) {
 | 
					        String tempValue = ChatColor.stripColor(value.replaceAll("&", "").replaceAll("§", "").replaceAll("-", "").replaceAll("_", ""));
 | 
				
			||||||
			throw new IllegalArgumentException("Flag must be alphanumerical");
 | 
							if (!StringUtils.isAlphanumericSpace(tempValue)) {
 | 
				
			||||||
 | 
								throw new IllegalArgumentException("Flag must be alphanumerical (colours, - and _ are allowed)");
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (value.length() > 48) {
 | 
							if (value.length() > 48) {
 | 
				
			||||||
			throw new IllegalArgumentException("Value must be <= 48 characters");
 | 
								throw new IllegalArgumentException("Value must be <= 48 characters");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user