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"; |                                     valueType = "Villager Profession"; | ||||||
|                                 } else if (PotionEffectType.class == c) { |                                 } else if (PotionEffectType.class == c) { | ||||||
|                                     valueType = "Potion effect"; |                                     valueType = "Potion effect"; | ||||||
|  |                                 } else if (c == int[].class) { | ||||||
|  |                                     valueType = "number,number,number..."; | ||||||
|                                 } |                                 } | ||||||
|                                 if (valueType != null) { |                                 if (valueType != null) { | ||||||
|                                     ChatColor methodColor = ChatColor.YELLOW; |                                     ChatColor methodColor = ChatColor.YELLOW; | ||||||
|   | |||||||
| @@ -541,6 +541,17 @@ public abstract class BaseDisguiseCommand implements CommandExecutor { | |||||||
|                         } catch (Exception ex) { |                         } catch (Exception ex) { | ||||||
|                             throw parseToException("a potioneffect type", valueString, methodName); |                             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