Add int[] to valid params in disguise commands
This commit is contained in:
		| @@ -204,6 +204,8 @@ public class DisguiseHelpCommand extends BaseDisguiseCommand { | ||||
|                                     valueType = "Villager Profession"; | ||||
|                                 } else if (PotionEffectType.class == c) { | ||||
|                                     valueType = "Potion effect"; | ||||
|                                 } else if (c == int[].class) { | ||||
|                                     valueType = "number,number,number..."; | ||||
|                                 } | ||||
|                                 if (valueType != null) { | ||||
|                                     ChatColor methodColor = ChatColor.YELLOW; | ||||
|   | ||||
| @@ -541,6 +541,17 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { | ||||
|                         } catch (Exception ex) { | ||||
|                             throw parseToException("a potioneffect type", valueString, methodName); | ||||
|                         } | ||||
|                     } else if (param == int[].class) { | ||||
|                         String[] split = valueString.split(","); | ||||
|                         int[] values = new int[split.length]; | ||||
|                         for (int b = 0; b < values.length; b++) { | ||||
|                             try { | ||||
|                                 values[b] = Integer.parseInt(split[b]); | ||||
|                             } catch (NumberFormatException ex) { | ||||
|                                 throw parseToException("Number,Number,Number...", valueString, methodName); | ||||
|                             } | ||||
|                         } | ||||
|                         value = values; | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user