Code:
public static String getCompleteString(String[] commands, int start) {
StringBuilder sb = new StringBuilder();
for (int i = start; i < commands.length; i++) {
if (i == start) {
sb.append(commands[i]);
continue;
}
sb.append(" " + commands[i]);
}
return sb.toString();
}
Usage :
Code:
String passwordToSet = getCompleteString(command, 1).substring(0, getCompleteString(command, 1).length());
Use your Encrypt class to encrypt it.
Hope this helped. I used this in the "itemid" command where players would simple do ;;itemid Abyssal whip, if they however wrote "abyssal whip" it wouldn't be able to retrieve it from the item definition because the item definition has the dumped names exact from the cache so using the exact string for the item name would result in retrieving the correct item.